From fd58ae6ec5e640b040b1c9907174c74c2bd29341 Mon Sep 17 00:00:00 2001 From: "M. Voerman" Date: Thu, 20 Dec 2012 00:25:56 +0100 Subject: Release 0.04 --- index.html | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 109 insertions(+), 19 deletions(-) (limited to 'index.html') diff --git a/index.html b/index.html index 055c9f2..061f3f5 100644 --- a/index.html +++ b/index.html @@ -26,10 +26,12 @@ // change IP server // -var Version = "0.04 2012/12/xx" +var Version = "0.04 2012/12/20" var nrChannels = channels.length; var nrMedia = recording.length - 1; +for (var i = 1; i < nrChannels; i++) { EPG[0][4][i] = "";EPG[1][4][i] = "";EPG[0][5][i] = "";EPG[1][5][i] = "";EPG[0][7][i] = "";EPG[1][7][i] = ""; } + window.onkeydown = onKeyDown; function onLoad() { @@ -84,12 +86,19 @@ function createPlayer() { function play(uri) { try { + if (initialDelayID != -1) { + clearTimeout(initialDelayID); + initialDelayID = -1; + } if (mediaPlayer.getState() != mediaPlayer.STATE_IDLE) { mediaPlayer.close(); } uri = ServerAdres + uri; mediaPlayer.open(uri); - mediaPlayer.play(1000); + mediaPlayer.play(mediaPlayer.PACE_PLAY); + if(TimeShift){ + initialDelayID = setTimeout("startTimeshiftBuffering();", 5000); + } if(isFullscreen) { showOSD(); } @@ -97,6 +106,8 @@ function play(uri) { GetEPG(currChan); } catch (e) { alert("Failed opening stream: " + e); + alert("error: " + mediaPlayer.getTimeshiftError().source); + alert("error: " + mediaPlayer.getTimeshiftError().details); return; } } @@ -112,6 +123,17 @@ function preview(urip) { } +function startTimeshiftBuffering() { + // check that media player is working + if (mediaPlayer.getState() != mediaPlayer.STATE_PLAYING ) { + alert("Media Player must be playing when starting timeshift buffering!"); + return; + } + + mediaPlayer.startTimeshiftBuffering(600); +} + + function FullScreen() { videoplane.style.width = "100%"; videoplane.style.height = "100%"; @@ -268,18 +290,15 @@ function onKeyDown(event) { if(isFullscreen) { if(!epgactive) { if(!isSchedule) { - schedule.style.zIndex = 505; schedule.style.opacity = 1; schedule.style.height = "75%"; GetSchedule(currChan,15); isSchedule = 1; } else { isSchedule = 0; - schedule.style.zIndex = 450; schedule.style.opacity = 0; schedule.style.height = "45%"; } -// setTimeout("schedule.style.opacity = 0;schedule.style.height = '45%';schedule.style.zIndex = 450;", 3000); } } else { GetSchedule(currChan,10); @@ -309,9 +328,16 @@ function onKeyDown(event) { } Change = 0; } else { + if(isSchedule) { + isSchedule = 0; + schedule.style.opacity = 0; + schedule.style.height = "45%"; + epgactive = 1; // else we get EPGinfo on the screen, bit nasty but works + } + if(isFullscreen) { //SHOW epg info - if(!epgactive){ + if(!epgactive) { SetOsdInfo(); osdepginfo.style.opacity = 1; osdepginfonext.style.opacity = 0; @@ -465,17 +491,29 @@ function onKeyDown(event) { break; case "MediaRewind": + mediaPlayer.play(mediaPlayer.PACE_REWIND); break; case "MediaForward": + mediaPlayer.play(mediaPlayer.PACE_FASTFORWARD); break; case "MediaPlayPause": + if(mediaPlayer.getState() == mediaPlayer.STATE_PAUSED) { + SetLed(1,1,0); + mediaPlayer.play(1000); + break; + } + if(mediaPlayer.getState() == mediaPlayer.STATE_PLAYING) { + SetLed(1,1,10); + mediaPlayer.play(0); + break; + } break; case "MediaStop": - mediaList.style.opacity = 0.8; - isMediaMenu = 1; - showDisplay("STOP", false, 100, 0 ); - currMed = 0; - showMediaList(); + mediaList.style.opacity = 0.8; + isMediaMenu = 1; + showDisplay("STOP", false, 100, 0 ); + currMed = 0; + showMediaList(); break; case "MediaRecord": break; @@ -592,7 +630,11 @@ function onCacheUpdated() { // showChannelList(); // } if (isSchedule) { - GetSchedule(currChan,10); + if (!isFullscreen) { + GetSchedule(currChan,10); + } else { + GetSchedule(currChan,15); + } } } @@ -605,8 +647,8 @@ function OSDhtml(){ osdtime.innerHTML = "" + result +""; osdname.innerHTML = "" + Left(channelsnames[currChan],30) + ""; 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][currChan],750) + "

"; - osdepginfonext.innerHTML = "

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

\n

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

\n

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

"; + osdepginfo.innerHTML = "

" + currChan + "\uE003" + channelsnames[currChan] + "

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

\n

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

\n

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

"; + osdepginfonext.innerHTML = "

" + currChan + "\uE003" + channelsnames[currChan] + "

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

\n

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

\n

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

"; } @@ -751,6 +793,28 @@ function GetEPG(epgchan) cds = 1; } + if((SI[0]=="S13.0E" && SI[3]=="14003") || (SI[0]=="S13.0E" && SI[3]=="14009") || (SI[0]=="S13.0E" && SI[3]=="14051") || (SI[0]=="S13.0E" && SI[3]=="951")) { + is.setObject("cfg.locale.ui","ita",is.STORAGE_VOLATILE); + cds = 1; + } + + if((SI[0]=="S13.0E" && SI[2]=="12800")) { + is.setObject("cfg.locale.ui","eng",is.STORAGE_VOLATILE); + } + + + if((SI[0]=="S13.0E" && SI[3]=="14002") || (SI[0]=="S13.0E" && SI[3]=="14008") ) { + is.setObject("cfg.locale.ui","fra",is.STORAGE_VOLATILE); + cds = 1; + } + + if((SI[0]=="S13.0E" && SI[2]=="1400") ) { + is.setObject("cfg.locale.ui","pol",is.STORAGE_VOLATILE); + cds = 1; + } + + + eitService = toi.statics.ToiDvbEitCacheServiceItem.create(SI[1],SI[2],SI[3]); eitCache.addService(eitService); event = eitCache.getPresentEvent(eitService); @@ -877,17 +941,41 @@ function GetEPG(epgchan) function GetSchedule(schchan,tablelength){ try { + // streaminfo + // SI[x] 0-sat,1-NID,2-TID,3-SID 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; } + if((SI[0]=="S13.0E" && SI[3]=="14003") || (SI[0]=="S13.0E" && SI[3]=="14009") || (SI[0]=="S13.0E" && SI[3]=="14051") || (SI[0]=="S13.0E" && SI[3]=="951")) { + is.setObject("cfg.locale.ui","ita",is.STORAGE_VOLATILE); + cds = 1; + } + + if((SI[0]=="S13.0E" && SI[2]=="12800")) { + is.setObject("cfg.locale.ui","eng",is.STORAGE_VOLATILE); + } + + + if((SI[0]=="S13.0E" && SI[3]=="14002") || (SI[0]=="S13.0E" && SI[3]=="14008") ) { + is.setObject("cfg.locale.ui","fra",is.STORAGE_VOLATILE); + cds = 1; + } + + if((SI[0]=="S13.0E" && SI[2]=="1400") ) { + is.setObject("cfg.locale.ui","pol",is.STORAGE_VOLATILE); + cds = 1; + } + + eitService = toi.statics.ToiDvbEitCacheServiceItem.create(SI[1],SI[2],SI[3]); eitCache.addService(eitService); event = eitCache.getPresentEvent(eitService); @@ -905,7 +993,7 @@ function GetSchedule(schchan,tablelength){ 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; + i = i + 1; } tijd = events.infoSequence[i].time; @@ -923,12 +1011,12 @@ function GetSchedule(schchan,tablelength){ tm = "0"+tm; } - txt = txt + "" + th + ":" + tm + " (" + events.infoSequence[i].duration/60 + ") " + events.infoSequence[i].name + ""; + txt = txt + "" + "\uE003\uE003\uE003\uE003\uE003" + th + ":" + tm + " (" + events.infoSequence[i].duration/60 + ") " + events.infoSequence[i].name + ""; } txt = txt + ""; - schedule.innerHTML = "" + schchan + "\uE003" + channelsnames[schchan] + "" + txt; + schedule.innerHTML = "" + "\uE003" + schchan + "\uE003" + channelsnames[schchan] + "" + txt; } else { - schedule.innerHTML = "

" + channelsnames[schchan] + "

"; + schedule.innerHTML = "" + "\uE003" + schchan + "\uE003" + channelsnames[schchan] + ""; } } catch(e) { @@ -1397,7 +1485,7 @@ function ShowMediaOSD() {
-
+
----- Next Schedule INFO
@@ -1424,9 +1512,11 @@ function ShowMediaOSD() {
+
+
-- cgit v1.2.3