From 23df8319a58f83f2b6015ab8704f59118cc56cd5 Mon Sep 17 00:00:00 2001 From: "M. Voerman" Date: Wed, 12 Dec 2012 13:14:12 +0100 Subject: Schedule added --- History | 6 ++ index.html | 204 ++++++++++++++++++++++++++++++++++++++++-------------------- settings.js | 1 + 3 files changed, 142 insertions(+), 69 deletions(-) diff --git a/History b/History index c0e8b0d..6ee65d9 100644 --- a/History +++ b/History @@ -7,4 +7,10 @@ split channels.js / settings.js & settings2.js (in the future settings2.js -> cfg.custom.xxx) Added switch timers (atm 1 switch timer possible and for next program only) switch timer reset from mainmenu. + EPG language is now based on Satellite/ NID/ TID + Added CA Mode to OSD + Full schedule try. + In guide mode Red - switch timer next program, Green now/next, Yellow Schedule, Blue program info. + + diff --git a/index.html b/index.html index 70d3125..5345fe7 100644 --- a/index.html +++ b/index.html @@ -15,7 +15,6 @@ // // Sound mapping for AC3 // auto epg switch language for EIT Cache -// show full epg if avaible (atm only now/next) // // make VDR connection // get/set/create/edit timers @@ -222,11 +221,11 @@ function onKeyDown(event) { if(NowNext) { settimer(); switchtimer.style.opacity = 1; - timerId = setTimeout("switchtimer.style.opacity = 0; ", 2000); + setTimeout("switchtimer.style.opacity = 0; ", 2000); } else { switchtimer.innerHTML = "
Program is running use OK to switch
"; switchtimer.style.opacity = 1; - timerId = setTimeout("switchtimer.style.opacity = 0; ", 2000); + setTimeout("switchtimer.style.opacity = 0; ", 2000); } } break; @@ -240,19 +239,19 @@ function onKeyDown(event) { osdlang1.style.opacity = 1; osdlang2.style.opacity = 0; osdlang3.style.opacity = 0; - timerId = setTimeout("osdlang1.style.opacity = 0; ", 3000); + setTimeout("osdlang1.style.opacity = 0; ", 3000); } else if(audio == 2) { is.setObject("cfg.media.audio.languagepriority","ger,deu,eng",is.STORAGE_VOLATILE); osdlang1.style.opacity = 0; osdlang2.style.opacity = 1; osdlang3.style.opacity = 0; - timerId = setTimeout("osdlang2.style.opacity = 0; ", 3000); + setTimeout("osdlang2.style.opacity = 0; ", 3000); } else if(audio == 3) { is.setObject("cfg.media.audio.languagepriority","eng",is.STORAGE_VOLATILE); osdlang1.style.opacity = 0; osdlang2.style.opacity = 0; osdlang3.style.opacity = 1; - timerId = setTimeout("osdlang3.style.opacity = 0; ", 3000); + setTimeout("osdlang3.style.opacity = 0; ", 3000); audio = 0; } } else { @@ -260,7 +259,7 @@ function onKeyDown(event) { osdepginfonext.style.opacity = 0; } } else { - NowNext = 0; + NowNext = 1 - NowNext; showChannelList(); } @@ -268,13 +267,17 @@ function onKeyDown(event) { case "Yellow": if(isFullscreen) { if(!epgactive) { + GetSchedule(currChan); + schedule.style.opacity = 1; + setTimeout("schedule.style.opacity = 0;", 3000); } else { - osdepginfo.style.opacity = 0; - osdepginfonext.style.opacity = 0.9; + osdepginfo.style.opacity = 0; + osdepginfonext.style.opacity = 0.9; } } else { - NowNext = 1; - showChannelList(); + GetSchedule(currChan); + schedule.style.opacity = 1; + setTimeout("schedule.style.opacity = 0;", 3000); } break; case "Blue": @@ -284,7 +287,7 @@ function onKeyDown(event) { SetOsdInfo(); osdepginfo.style.opacity = 1 - NowNext; osdepginfonext.style.opacity = NowNext; - timerId = setTimeout("epgactive = 0; osdepginfo.style.opacity = 0; osdepginfonext.style.opacity = 0;", 5000); + setTimeout("epgactive = 0; osdepginfo.style.opacity = 0; osdepginfonext.style.opacity = 0;", 5000); } break; case "BrowserBack": @@ -302,7 +305,7 @@ function onKeyDown(event) { osdepginfo.style.opacity = 0.9; osdepginfonext.style.opacity = 0; epgactive = 1; - timerId = setTimeout("epgactive = 0; osdepginfo.style.opacity = 0; osdepginfonext.style.opacity = 0;", 5000); + setTimeout("epgactive = 0; osdepginfo.style.opacity = 0; osdepginfonext.style.opacity = 0;", 5000); } else if(!isFullscreen){ isFullscreen = 1; FullScreen(); @@ -348,7 +351,6 @@ function onKeyDown(event) { isSetupMenu = 1; mainmenu.style.opacity = 1; InitMenu(); -// timerId = setTimeout("mainmenu.style.opacity = 0;", 5000); } break; case "Scroll": @@ -451,7 +453,7 @@ function onKeyDown(event) { case "MediaPlayPause": break; case "MediaStop": - + break; case "MediaRecord": break; @@ -520,22 +522,30 @@ function SetLed(NumLed,color,blinkfreq){ function showOSD() { + if (osdtimeout) { + clearTimeout(osdtimeout); + } SetOsdInfo(); opacity = 1; - osd.style.opacity = opacity; + OSD(opacity); + setTimeout("fadeOut()", 3000); +} + +function OSD(opacity) { + osdmain.style.opacity = opacity; osdnr.style.opacity = opacity; osdtime.style.opacity = opacity; osdname.style.opacity = opacity; osdepg.style.opacity = opacity; - timerId = setTimeout("fadeOut()", 3000); - + osdca.style.opacity = opacity; } + function SetOsdInfo() { OSDchannr(currChan); date_time(); osdtime.innerHTML = "" + result +""; - osdname.innerHTML = "" + Left(channelsnames[currChan],25) + ""; + osdname.innerHTML = "" + Left(channelsnames[currChan],30) + ""; GetEPG(currChan); osdepg.innerHTML = "

" + EPGNow + "

\n

" + EPGNext + "<\p>"; osdepginfo.innerHTML = "

" + EPGNow + "

\n

" + EPGShortnow + "

\n

" + Left(EPGExtnow,750) + "<\p>

"; @@ -573,7 +583,7 @@ function settimer() { switchtimerID = setTimeout(TimerActions, StartTime); switchtimer.innerHTML = "

Name : " + EPG[NowNext][1][currChan] + "

channel : " + channelsnames[currChan] + "

Starttime : " + th + ":" + tm + "

"; osdtimer.innerHTML = "

" + th + ":" + tm + "

"; - SetLed(0,2,0); + SetLed(0,2,1); } else { // // No Switch timer so send timer info to Server @@ -605,29 +615,21 @@ function Right(str, n){ function fadeIn() { opacity += 0.2; - osd.style.opacity = opacity; - osdnr.style.opacity = opacity; -// osdtime.style.opacity = opacity; -// osdname.style.opacity = opacity; -// osdepg.style.opacity = opacity; - if (osd.style.opacity >= 1) { - timerId = setTimeout("fadeOut()", 200); + OSD(opcity); + if (opacity >= 1) { + setTimeout("fadeOut()", 200); return; } - timerId = setTimeout("fadeIn()", 100); + setTimeout("fadeIn()", 100); } function fadeOut() { opacity -= 0.2; - osd.style.opacity = opacity; - osdnr.style.opacity = opacity; -// osdtime.style.opacity = opacity; -// osdname.style.opacity = opacity; -// osdepg.style.opacity = opacity; - if (osd.style.opacity <= 0) { + OSD(opacity); + if (opacity <= 0) { return; } - timerId = setTimeout("fadeOut()", 100); + setTimeout("fadeOut()", 100); } function RestartPortal(){ @@ -695,19 +697,16 @@ function GetEPG(epgchan) is.setObject("cfg.locale.ui","dut",is.STORAGE_VOLATILE); cds = 1; } - if (SI[0]=="T" ) { - is.setObject("cfg.locale.ui","ned",is.STORAGE_VOLATILE); - } - if(epgchan > 419 && epgchan < 550) - { - is.setObject("cfg.locale.ui","Deu",is.STORAGE_VOLATILE); - cds = 0; - } - eitService = toi.statics.ToiDvbEitCacheServiceItem.create(SI[1],SI[2],SI[3]); eitCache.addService(eitService); event = eitCache.getPresentEvent(eitService); + if(event.freeCaMode){ + osdca.innerHTML = ""; + } else { + osdca.innerHTML = ""; + } + if (event.name) { events = eitCache.getEvents(eitService, 1000000000, 2000000000); @@ -724,6 +723,7 @@ function GetEPG(epgchan) EPG[0][3][epgchan] = (event.duration/60); EPG[0][4][epgchan] = ""; EPG[0][5][epgchan] = ""; + if(EPGShortnow) { EPG[0][4][epgchan] = EPGShortnow; } @@ -766,7 +766,7 @@ function GetEPG(epgchan) EPG[1][4][epgchan] = ""; EPG[1][5][epgchan] = ""; - if(EPGExtnext) { + if(EPGShortnext) { EPG[1][4][epgchan] = EPGShortnext; } if(EPGExtnext) { @@ -803,8 +803,75 @@ function GetEPG(epgchan) } } + + +function GetSchedule(schchan){ + try { + SI=channels[schchan].split("-"); + is = toi.informationService; + is.setObject("cfg.locale.ui","ger",is.STORAGE_VOLATILE); + if(SI[0]=="S28.2E") { + is.setObject("cfg.locale.ui","eng",is.STORAGE_VOLATILE); + } + if((SI[0]=="S23.5E" && SI[1]=="3") || SI[2]=="1026" || SI[2]=="1097" || SI[2]=="1105" || SI[2]=="1119") { + is.setObject("cfg.locale.ui","dut",is.STORAGE_VOLATILE); + cds = 1; + } + + eitService = toi.statics.ToiDvbEitCacheServiceItem.create(SI[1],SI[2],SI[3]); + eitCache.addService(eitService); + event = eitCache.getPresentEvent(eitService); + events = eitCache.getEvents(eitService, 1000000000, 2000000000); + + if (event.name) { + if (events.more) { + var t = eitCache.getEvents(eitService, 1000000000, 2000000000); + events.infoSequence.concat(t.infoSequence); + events.more = t.more; + } + + var txt = ""; + var i = 0; + for (i = 0; i < events.infoSequence.length && i < 12; i++) { + + while ((i > 0) && (events.infoSequence[i].eventId == events.infoSequence[(i-1)].eventId)) { + i = i +1; + } + + tijd = events.infoSequence[i].time; + date = new Date(tijd*1000); + tijd = date.toUTCString(); + tijd = new Date(tijd); + var tm = tijd.getMinutes(); + var th = tijd.getHours(); + if(th<10) + { + th = "0"+th; + } + if(tm<10) + { + tm = "0"+tm; + } + + txt = txt + th + ":" + tm + " (" + events.infoSequence[i].duration/60 + ") " + events.infoSequence[i].name + "

"; + } + txt = txt + ""; + schedule.innerHTML = "

" + channelsnames[schchan] + "

" + txt; + } else { + schedule.innerHTML = "

" + channelsnames[schchan] + "

"; + } + + } catch(e) { + alert("Get EPG problem: " + e); + schedule.innerHTML = "

" + channelsnames[schchan] + "

NO EPG

"; + } + +} + // End of EPG section + + // Channelslist / EPG Guide // // show currchan - 5 @@ -818,27 +885,26 @@ function showChannelList() { var htmlstring = ""; listChan = currChan-5; for(var i=currChan-5; i<=currChan+5; i++) { - if (listChan<1) { + if (listChan<1) { listChan=nrChannels-2; } - if (listChan>nrChannels-2) { + if (listChan>nrChannels-2) { listChan=0; } - do - { - listChan = listChan + 1; + do + { + listChan = listChan + 1; + } + while (!channels[listChan] && (listChan" + listChan + "" + Left(channelsnames[listChan],15) + "" + Left(EpgInfo[NowNext],64) + ""; + EpgInfo[0] = EPGNow; + EpgInfo[1] = EPGNext; + htmlstring = htmlstring + "" + listChan + "" + Left(channelsnames[listChan],15) + "" + Left(EpgInfo[NowNext],64) + ""; } htmlstring = htmlstring + "
"; channelList.innerHTML = htmlstring; @@ -1063,9 +1129,9 @@ function InitMenu() {
- Switchtimer - NOW - NEXT + Timer + Now / Next + Schedule INFO
@@ -1075,26 +1141,26 @@ function InitMenu() { -
-
+
-
+
+
Nederlands
Deutsch
English
- + + diff --git a/settings.js b/settings.js index bae5de7..f3f177f 100644 --- a/settings.js +++ b/settings.js @@ -74,6 +74,7 @@ EPG[2][4] = new Array(); EPG[2][5] = new Array(); EPG[2][6] = new Array(); +var osdtimeout = 0; var epgactive = 0; var preChan = 0; var cds = 1; -- cgit v1.2.3