From 74e1cb7f145a2def69e3f4a648549ede47b21eb2 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 9 Apr 2014 17:02:05 +0200 Subject: [PATCH] yWeb: dont zap on channel change --- src/nhttpd/web/Y_Live.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/nhttpd/web/Y_Live.js b/src/nhttpd/web/Y_Live.js index 2e936f371..77ae189d3 100644 --- a/src/nhttpd/web/Y_Live.js +++ b/src/nhttpd/web/Y_Live.js @@ -16,6 +16,7 @@ var Mode = "tv"; var AudioChannel = 0; var isSubs=false; var g_intervall=null; +var current_channel = 0; /*resize,init*/ function do_onload(){ if(Mode != "tv" && Mode != "radio") @@ -194,7 +195,11 @@ function do_play_state(_state, _options){ if(Mode == "tv" && isUDP) mrl = "udp://@:31330"; else - mrl = loadSyncURL("/control/build_live_url"); + if(current_channel) + mrl = "http://" + window.location.host + ":31339/id=" + current_channel; + else + mrl = loadSyncURL("/control/build_live_url"); + V2.set_actual_mrl(mrl); V2.play(); V2.next(); @@ -236,8 +241,10 @@ function change_channel(){ var dd = id('channels'); var channel = -1; var sel = dd.selectedIndex; - if(sel != -1) + if(sel != -1){ channel = dd[sel].value; + current_channel = channel; + } do_stop(); AudioChannel = 0; window.setTimeout("change_channel_zapto(\""+channel+"\")",100); @@ -246,14 +253,16 @@ function change_sub_channel(){ var dd = id('subs'); var channel = -1; var sel = dd.selectedIndex; - if(sel != -1) + if(sel != -1){ channel = dd[sel].value; + current_channel = channel; + } do_stop(); AudioChannel = 0; window.setTimeout("change_channel_zapto(\""+channel+"\")",100); } function change_channel_zapto(channel){ - dbox_zapto(channel); + //dbox_zapto(channel); window.setTimeout("change_channel_play()",500); } function build_subchannels(){