From 09cd523c5f06ab474a6537541a1e4c5db3a694a0 Mon Sep 17 00:00:00 2001 From: "M. Voerman" Date: Thu, 13 Dec 2012 14:12:52 +0100 Subject: Schedule changes. --- index.html | 71 ++++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 27 deletions(-) (limited to 'index.html') diff --git a/index.html b/index.html index ce885ab..4ab29af 100644 --- a/index.html +++ b/index.html @@ -40,6 +40,7 @@ function onLoad() { eitCache = toi.dvbEitService.createInstance(); eitCache.setFilterMode(eitCache.FILTER_MODE_PF_AND_SCHEDULE); // eitCache.setFilterMode(eitCache.FILTER_MODE_PF_ONLY); + eitCache.addEventListener(eitCache.ON_CACHE_UPDATED, onCacheUpdated); showOSD(); } @@ -102,6 +103,9 @@ function preview(urip) { play(urip); } showChannelList(); + if (isSchedule) { + GetSchedule(currChan,10); + } } @@ -260,14 +264,16 @@ function onKeyDown(event) { case "Yellow": if(isFullscreen) { if(!epgactive) { - GetSchedule(currChan); - schedule.style.opacity = 1; - setTimeout("schedule.style.opacity = 0;", 3000); +// GetSchedule(currChan,15); +// schedule.style.opacity = 1; +// schedule.style.height = "75%"; +// setTimeout("schedule.style.opacity = 0;schedule.style.height = '45%';", 3000); } } else { - GetSchedule(currChan); - schedule.style.opacity = 1; - setTimeout("schedule.style.opacity = 0;", 3000); + GetSchedule(currChan,10); + schedule.style.opacity = 1 - schedule.style.opacity; + channelList.style.opacity = 1 - schedule.style.opacity; + isSchedule = schedule.style.opacity; } break; case "Blue": @@ -518,7 +524,7 @@ function showOSD() { SetOsdInfo(); opacity = 1; OSD(opacity); - setTimeout("fadeOut()", 3000); + osdtimeout = setTimeout("fadeOut()", 3000); } function OSD(opacity) { @@ -540,6 +546,13 @@ function SetOsdInfo() { return; } +function onCacheUpdated() { + if (osdtimeout) { + GetEPG(currChan); + SetOsdInfo(); + } +} + function OSDchannr(channr) { osdnr.innerHTML = "
" + channr + "
"; } @@ -547,9 +560,9 @@ function OSDchannr(channr) { function OSDhtml(){ osdtime.innerHTML = "" + result +""; osdname.innerHTML = "" + Left(channelsnames[currChan],30) + ""; - osdepg.innerHTML = "

" + EPGNow + "

\n

" + EPGNext + "

"; - osdepginfo.innerHTML = "

" + EPGNow + "

\n

" + EPGShortnow + "

\n

" + Left(EPGExtnow,750) + "

"; - osdepginfonext.innerHTML = "

" + EPGNext + "

\n

" + EPGShortnext + "

\n

" + Left(EPGExtnext,750) + "

"; + osdepg.innerHTML = "

" + EPG[0][7][currChan] + "

\n

" + EPG[1][7][currChan] + "

"; + osdepginfo.innerHTML = "

" + EPG[0][7][currChan] + "

\n

" + EPG[0][4][currChan] + "

\n

" + Left(EPG[0][5][epgchan],750) + "

"; + osdepginfonext.innerHTML = "

" + EPG[1][7][currChan] + "

\n

" + EPG[1][4][currChan] + "

\n

" + Left(EPG[1][5][epgchan],750) + "

"; } @@ -673,10 +686,10 @@ function date_time() function GetEPG(epgchan) { - EPGNow = ""; + EPG[0][7][epgchan] = ""; EPGShortnow = ""; EPGExtnow = ""; - EPGNext = ""; + EPG[1][7][epgchan] = ""; EPGShortnext = ""; EPGExtnext = ""; cds = 0; @@ -745,15 +758,16 @@ function GetEPG(epgchan) } if(cds){ // CDS has short info, other providers, a little longer. - EPGNow = th + ":" + tm + " (" + EPGminutes + " / " + ((event.duration/60)-EPGminutes).toFixed(0) + ")" + " " + event.name + " " + EPGShortnow; + EPG[0][7][epgchan] = th + ":" + tm + " (" + EPGminutes + " / " + ((event.duration/60)-EPGminutes).toFixed(0) + ")" + " " + event.name + " " + EPGShortnow; } else { - EPGNow = th + ":" + tm + " (" + EPGminutes + " / " + ((event.duration/60)-EPGminutes).toFixed(0) + ")" + " " + event.name + " "; + EPG[0][7][epgchan] = th + ":" + tm + " (" + EPGminutes + " / " + ((event.duration/60)-EPGminutes).toFixed(0) + ")" + " " + event.name + " "; } if (!event.time) { - EPGNow = " "; + EPG[0][7][epgchan] = " "; } + event = eitCache.getFollowingEvent(eitService); EPG[1][1][epgchan] = event.name; @@ -786,14 +800,16 @@ function GetEPG(epgchan) if(cds){ // CDS has short info, other providers, a little longer. - EPGNext = th + ":" + tm + " (" + (event.duration/60).toFixed(0) + ")" + " " + event.name + " " + EPGShortnext; + EPG[1][7][epgchan] = th + ":" + tm + " (" + (event.duration/60).toFixed(0) + ")" + " " + event.name + " " + EPGShortnext; } else { - EPGNext = th + ":" + tm + " (" + (event.duration/60).toFixed(0) + ")" + " " + event.name + " "; + EPG[1][7][epgchan] = th + ":" + tm + " (" + (event.duration/60).toFixed(0) + ")" + " " + event.name + " "; } if (!event.time) { - EPGNext = " "; + EPG[1][7][epgchan] = " "; } + + } catch(e) { alert("Get EPG problem: " + e); } @@ -801,7 +817,7 @@ function GetEPG(epgchan) -function GetSchedule(schchan){ +function GetSchedule(schchan,tablelength){ try { SI=channels[schchan].split("-"); is = toi.informationService; @@ -826,9 +842,9 @@ function GetSchedule(schchan){ events.more = t.more; } - var txt = ""; + var txt = ""; var i = 0; - for (i = 0; i < events.infoSequence.length && i < 12; i++) { + for (i = 0; i < events.infoSequence.length && i < tablelength; i++) { while ((i > 0) && (events.infoSequence[i].eventId == events.infoSequence[(i-1)].eventId)) { i = i +1; @@ -849,10 +865,10 @@ function GetSchedule(schchan){ tm = "0"+tm; } - txt = txt + th + ":" + tm + " (" + events.infoSequence[i].duration/60 + ") " + events.infoSequence[i].name + "

"; + txt = txt + ""; } txt = txt + "
" + th + ":" + tm + " (" + events.infoSequence[i].duration/60 + ") " + events.infoSequence[i].name + "
"; - schedule.innerHTML = "

" + channelsnames[schchan] + "

" + txt; + schedule.innerHTML = channelsnames[schchan] + txt; } else { schedule.innerHTML = "

" + channelsnames[schchan] + "

"; } @@ -898,8 +914,8 @@ function showChannelList() { } else { liststyle = ""; } - EpgInfo[0] = EPGNow; - EpgInfo[1] = EPGNext; + EpgInfo[0] = EPG[0][7][listChan]; + EpgInfo[1] = EPG[1][7][listChan]; htmlstring = htmlstring + "" + listChan + "" + Left(channelsnames[listChan],15) + "" + Left(EpgInfo[NowNext],64) + ""; } htmlstring = htmlstring + ""; @@ -1121,7 +1137,9 @@ function InitMenu() { -
+
+
+
Timer Now / Next @@ -1146,7 +1164,6 @@ function InitMenu() {
-
Nederlands
-- cgit v1.2.3