var b=0; //if(b){ // var stb=0; //}else{ if(typeof(stb)=='undefined') var stb=new Stb(); Uncaught ReferenceError: Stb is not defined if(typeof(stb_media)=='undefined') var stb_media=new Stb_Media(); if(typeof(network)=='undefined') var network=new Network(); //network.igmp=2; network.iptvtimeout=10; //} var listobj; var little=0; var curchannel=""; var ignoreUpdatesState = true; var TimerID = 0; function eid(id){ return document.getElementById(id); } function shs(id){ eid(id).style.display=eid(id).style.display=="block"?"none":"block"; } function sh(id){ eid(id).style.display="block"; } function SetAlphaLevel() { if(b==0) stb_media.setAlphaLevel(obj_AlphaValue.value); } function ignoreUpdates() { if (ignoreUpdatesState == true) { ignoreUpdatesState = false; if(b==0) stb_media.ignoreUpdates(ignoreUpdatesState); } } function SetSpeed() { var newVal = obj_speedValue.value; if(b==0) stb_media.setSpeed(newVal); /* Update AudioPID Setting Edit */ TimerID = setTimeout("updateMediaInfo(2)", 2000); //obj_speedValue.value = stb_media.getSpeed(); } function SetAudioPID() { var newVal = obj_audioPIDValue.value; if(b==0) stb_media.setAudioPID(newVal); /* Update AudioPID Setting Edit */ TimerID = setTimeout("updateMediaInfo(4)", 2000); } function SetAlpha() { var newVal = obj_alphaValue.value; if(b==0) stb_media.setAlphaLevel(newVal); } function IGMP_Play(url) { curchannel=url; //stb_media.stop(); if(b==0) stb_media.setPIG(true,win_scale, win_x, win_y); if(b==0) stb_media.play(url); if(b==0) TimerID = setTimeout("updateMediaInfo(6)", 5000); } function FULL() { if(b==0) stb_media.setPIG(false); } function fullscreen() { var plyfull=document.getElementById("plywin_f"); if(stb_media.getPIG() == false) { plyfull.className="plywin0"; stb_media.setPIG(true, win_scale, win_x, win_y); } else { plyfull.className="plywin1"; stb_media.setPIG(false); } } function change_theme(k){ // eid('t'+stheme).className='but1'; // eid('t'+k).className='but2'; stheme=k; generate_channels(k); } function change_channel(k){ eid('c'+schannel).className='ch1'; eid('c'+k).className='ch2'; schannel=k; IGMP_Play(channels[stheme][schannel]['href']); load_tvprog(k,0); } function keyListener(event) { var key = event.keyCode ? event.keyCode : event.which; var handled=true; if(key!=93 && key!=91 && key!=92 && key!=13) sh('main'); switch(key) { // case 48: case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: // case 57: // change_theme(key-49); break; case 38: //up clearTimeout(tim); var curch=schannel-1; if(curch<0) curch=channels[stheme].length-1 change_channel(curch); break; case 40: //down clearTimeout(tim); var curch=schannel+1; if(curch>=channels[stheme].length) curch=0 change_channel(curch); break case 39: //right scroll_themes(1); break; case 37: //left scroll_themes(-1); break case 13: shs('mainbox'); tim=setTimeout('hide_info()',3000); break; default: handled=false; break; case 123: load_tvprog(schannel,1-little); break; } return !handled; } function exitPage() { if(b==0) stb_media.stop(); } function updateMediaInfo(updateElement) { if (TimerID) { clearTimeout(TimerID); TimerID = 0; } if (stb_media.eventCode == 4) { if (updateElement & 2) obj_speedValue.value = stb_media.getSpeed(); if (updateElement & 4) obj_audioPIDValue.value = stb_media.getAudioPID(); //TimerID = setTimeout("updateMediaInfo(6)", 10000); } } function statechange(){ if(b==0) stb.print("iptv_ui.js statechange() called\n"); } function initPage(){ document.addEventListener("keypress", keyListener, true); generate_themes(); change_theme(0); if(b==0) stb.menutype=2;// Set as IPTV } var tempsc=0; function load_tvprog(chan,full){ little=full; var ajax_main = new sack(); ajax_main.requestFile='response.php?chp=channel&chan='+channels[stheme][chan]['id']+(full?'&act=full':''); ajax_main.onCompletion=function(){ if(full){ eid('numdiv').style.top='40px'; eid('numdiv').style.visibility='visible'; } else{ eid('infodiv').style.visibility='visible'; eid('numdiv').style.visibility='hidden'; tim=setTimeout('hide_info()',5000); } eid(full?'numdiv':'infodiv').innerHTML=ajax_main.response; } ajax_main.runAJAX(); } function hide_info(){ eid('infodiv').style.visibility=eid('mainbox').style.display=='block'?'visible':'hidden'; } function change_pics(vec,inn){ eid(vec>0?'next_image':'prev_image').src='img/'+(vec>0?'next':'prev')+(inn?'_h':'')+'.png' if(inn) setTimeout('change_pics('+vec+',0)',500); } function generate_themes(){ var buttons_html=themes[0]; document.getElementById('themes_div').innerHTML=buttons_html; } function scroll_themes(vec){ schannel=0; change_pics(vec,1); var ntd=eid('themes_div'); stheme+=vec; if(stheme>=themes.length) stheme=0; if(stheme<0) stheme=themes.length-1; ntd.innerHTML=themes[stheme]; generate_channels(stheme) } function generate_channels(typ){ var channels_html=''; for(var i=0;i'+channels[typ][i]['name']+'' channels_html+='
'; document.getElementById('channels_div').innerHTML=channels_html; change_channel(0); } /* function refreshka(){ var ajax_refresh = new sack(); ajax_refresh.requestFile='response.php?chp=refresh&id='+channels[stheme][schannel]['id']; ajax_refresh.runAJAX(); } */ window.onload = initPage; window.onunload=exitPage; //setInterval(refreshka,60000);