Advertisement
tuvok81

websdr java

Aug 8th, 2022
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function html5orjavamenu()
  2. {
  3.    var s;
  4.    if (sup_webaudio) {
  5.       if (sup_webaudio) {
  6.          if (!document['ct']) document['ct']= new sup_webaudio;
  7.          try {
  8.             var cc=document['ct'].createConvolver;
  9.          } catch (e) {
  10.             document['ct']=null; // firefox 23 supports webaudio, but not yet createConvolver(), making it unusable.
  11.             sup_webaudio=false;
  12.          };
  13.       }
  14.    }
  15.    sup_iOS = 0;   // global!
  16.    sup_android = 0;   // global!
  17.    sup_chrome = 0;  // global!
  18.    try {
  19.       var n=navigator.userAgent.toLowerCase();
  20.       if (n.indexOf('iphone')!=-1) sup_iOS=1;
  21.       if (n.indexOf('ipad')!=-1) sup_iOS=1;
  22.       if (n.indexOf('ipod')!=-1) sup_iOS=1;
  23.       if (n.indexOf('ios')!=-1) sup_iOS=1;
  24.       if (n.indexOf('android')!=-1) sup_android=1;
  25.    } catch (e) {};
  26.    if (sup_iOS) isTouchDev=true;
  27.    var usecookie= readCookie('usejava');
  28.    if (!usecookie) {
  29.       if (sup_socket && sup_canvas) usecookie="n"; else usecookie="y";
  30.       if (sup_socket && (sup_webaudio || sup_mozaudio)) usecookie+="n"; else usecookie+="y";
  31.    }
  32.    usejavawaterfall=(usecookie.substring(0,1)=='y');
  33.    usejavasound=(usecookie.substring(1,2)=='y');
  34.  
  35.    var javacolor=checkjava();
  36.    s='<b>Waterfall:</b>';
  37.    s+='<span style="color: '+javacolor+'"><input type="radio" name="groupw" value="Java" onclick="html5orjava(0,1);"'+(usejavawaterfall?" checked":"")+'>Java</span>';
  38.    if (sup_socket && sup_canvas) s+='<span style="color:green">'; else s+='<span style="color:red">';
  39.    s+='<input type="radio" name="groupw" value="HTML5" onclick="html5orjava(0,0);"'+(!usejavawaterfall?" checked":"")+'>HTML5</span>';
  40.    s+='&nbsp;&nbsp;&nbsp;<b>Sound:</b>';
  41.    s+='<span style="color: '+javacolor+'"><input type="radio" name="groupa" value="Java" onclick="html5orjava(1,1);"'+(usejavasound?" checked":"")+'>Java</span>';
  42.    if (sup_socket && sup_webaudio) s+='<span style="color: green">';
  43.    else if (sup_socket && sup_mozaudio) s+='<span style="color: blue">';
  44.    else s+='<span style="color: red">';
  45.    s+='<input type="radio" name="groupa" value="HTML5" onclick="html5orjava(1,0);"'+(!usejavasound?" checked":"")+'>HTML5</span>';
  46.    if (sup_iOS && sup_socket && sup_webaudio) s+='<input type="button" value="iOS audio start" onclick="iOS_audio_start()">';
  47.    document.getElementById('html5choice').innerHTML = s;
  48.    document.getElementById('record_span').style.display = usejavasound ? "none" : "inline";
  49. }
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement