summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.svg80
-rw-r--r--main.js185
-rw-r--r--settings.js7
3 files changed, 151 insertions, 121 deletions
diff --git a/index.svg b/index.svg
index 8454ce5..390cb7a 100644
--- a/index.svg
+++ b/index.svg
@@ -44,26 +44,26 @@
</g>
<g id="OSD" visibility="visible" >
- <rect height="288" width="1600" y="700" x="230" fill="#0000ff" rx="50"/>
+ <rect height="288" width="1600" y="700" x="230" fill="#000066" rx="50"/>
<rect height="150" width="212" y="635" x="132" fill="#ff0000" rx="50"/>
<text id="osdnr" y="750" x="140" style="fill:white;font-size:100px;" />
<text id="osdtime" y="750" x="1400" style="fill:white;font-size:36px;" />
<text id="osdname" y="775" x="375" style="fill:white;font-size:64px;" />
<text id="osdca" y="825" x="1675" style="fill:white;font-size:64px;" />
- <text id="osdtimenow" y="875" x="250" style="fill:white;font-size:48px;" />
+ <text id="osdtimenow" y="875" x="300" style="fill:white;font-size:48px;" />
<text id="osdpnow" y="875" x="500" style="fill:white;font-size:48px;" />
- <text id="osddurationnow" y="875" x="1500" style="fill:white;font-size:48px;" />
+ <text id="osddurationnow" y="875" x="1450" style="fill:white;font-size:48px;" />
- <text id="osdtimenext" y="950" x="250" style="fill:white;font-size:48px;" />
+ <text id="osdtimenext" y="950" x="300" style="fill:white;font-size:48px;" />
<text id="osdpnext" y="950" x="500" style="fill:white;font-size:48px;" />
- <text id="osddurationnext" y="950" x="1500" style="fill:white;font-size:48px;" />
+ <text id="osddurationnext" y="950" x="1450" style="fill:white;font-size:48px;" />
</g>
<g id="MENU" visibility="invisible" >
- <rect height="900" width="1300" y="75" x="300" fill="#0000ff" rx="50" opacity="0.6" />
+ <rect height="900" width="1300" y="75" x="300" fill="#000066" rx="50" opacity="0.6" />
<rect height="75" width="250" y="875" x="450" fill="red" rx="50" />
<rect height="75" width="250" y="875" x="700" fill="green" rx="50" />
<rect height="75" width="250" y="875" x="950" fill="yellow" rx="50" />
@@ -83,29 +83,28 @@
</g>
<g id="GUIDE" visibility="invisible" >
- <rect height="900" width="1500" y="75" x="200" fill="#0000ff" rx="50" opacity="0.6" />
+ <rect height="900" width="1500" y="75" x="200" fill="#000066" rx="50" opacity="0.8" />
<rect id="guidebar" height="50" width="1400" y="275" x="250" fill="#0066FF" rx="50" />
<rect height="75" width="300" y="875" x="275" fill="red" rx="50" />
<rect height="75" width="300" y="875" x="625" fill="green" rx="50" />
<rect height="75" width="300" y="875" x="975" fill="yellow" rx="50" />
<rect height="75" width="300" y="875" x="1325" fill="blue" rx="50" />
- <text id="guidename" y="175" x="600" style="fill:white;font-size:88px;" />
- <text id="guidetime" y="175" x="600" style="fill:white;font-size:88px;" />
- <text id="guide0" y="150" x="300" style="fill:white;font-size:38px;" />
- <text id="guide1" y="200" x="300" style="fill:white;font-size:38px;" />
- <text id="guide2" y="250" x="300" style="fill:white;font-size:38px;" />
- <text id="guide3" y="300" x="300" style="fill:white;font-size:38px;" />
- <text id="guide4" y="350" x="300" style="fill:white;font-size:38px;" />
- <text id="guide5" y="400" x="300" style="fill:white;font-size:38px;" />
- <text id="guide6" y="450" x="300" style="fill:white;font-size:38px;" />
- <text id="guide7" y="500" x="300" style="fill:white;font-size:38px;" />
- <text id="guide8" y="550" x="300" style="fill:white;font-size:38px;" />
- <text id="guide9" y="600" x="300" style="fill:white;font-size:38px;" />
- <text id="guide10" y="650" x="300" style="fill:white;font-size:38px;" />
- <text id="guide11" y="700" x="300" style="fill:white;font-size:38px;" />
- <text id="guide12" y="750" x="300" style="fill:white;font-size:38px;" />
- <text id="guide13" y="800" x="300" style="fill:white;font-size:38px;" />
- <text id="guide14" y="850" x="300" style="fill:white;font-size:38px;" />
+
+ <text id="guide0" y="150" x="300" />
+ <text id="guide1" y="200" x="300" />
+ <text id="guide2" y="250" x="300" />
+ <text id="guide3" y="300" x="300" />
+ <text id="guide4" y="350" x="300" />
+ <text id="guide5" y="400" x="300" />
+ <text id="guide6" y="450" x="300" />
+ <text id="guide7" y="500" x="300" />
+ <text id="guide8" y="550" x="300" />
+ <text id="guide9" y="600" x="300" />
+ <text id="guide10" y="650" x="300" />
+ <text id="guide11" y="700" x="300" />
+ <text id="guide12" y="750" x="300" />
+ <text id="guide13" y="800" x="300" />
+ <text id="guide14" y="850" x="300" />
<text id="guide_red" y="930" x="325" style="fill:white;font-size:48px;"/>
<text id="guide_green" y="930" x="675" style="fill:black;font-size:48px;"/>
@@ -113,8 +112,37 @@
<text id="guide_blue" y="930" x="1375" style="fill:white;font-size:48px;"/>
</g>
+<g id="SCHEDULE" visibility="invisible" >
+ <rect height="900" width="1500" y="75" x="200" fill="#000066" rx="50" opacity="0.8" />
+ <rect height="75" width="300" y="875" x="275" fill="red" rx="50" />
+ <rect height="75" width="300" y="875" x="625" fill="green" rx="50" />
+ <rect height="75" width="300" y="875" x="975" fill="yellow" rx="50" />
+ <rect height="75" width="300" y="875" x="1325" fill="blue" rx="50" />
+
+ <text id="schedule0" y="150" x="300" style = "fill:white;font-size:64px;"/>
+ <text id="schedule1" y="200" x="300" style = "fill:white;font-size:36px;"/>
+ <text id="schedule2" y="250" x="300" style = "fill:white;font-size:36px;"/>
+ <text id="schedule3" y="300" x="300" style = "fill:white;font-size:36px;"/>
+ <text id="schedule4" y="350" x="300" style = "fill:white;font-size:36px;"/>
+ <text id="schedule5" y="400" x="300" style = "fill:white;font-size:36px;"/>
+ <text id="schedule6" y="450" x="300" style = "fill:white;font-size:36px;"/>
+ <text id="schedule7" y="500" x="300" style = "fill:white;font-size:36px;"/>
+ <text id="schedule8" y="550" x="300" style = "fill:white;font-size:36px;"/>
+ <text id="schedule9" y="600" x="300" style = "fill:white;font-size:36px;"/>
+ <text id="schedule10" y="650" x="300" style = "fill:white;font-size:36px;"/>
+ <text id="schedule11" y="700" x="300" style = "fill:white;font-size:36px;"/>
+ <text id="schedule12" y="750" x="300" style = "fill:white;font-size:36px;"/>
+ <text id="schedule13" y="800" x="300" style = "fill:white;font-size:36px;"/>
+ <text id="schedule14" y="850" x="300" style = "fill:white;font-size:36px;"/>
+
+ <text id="schedule_red" y="930" x="325" style="fill:white;font-size:48px;"/>
+ <text id="schedule_green" y="930" x="675" style="fill:black;font-size:48px;"/>
+ <text id="schedule_yellow" y="930" x="1025" style="fill:black;font-size:48px;"/>
+ <text id="schedule_blue" y="930" x="1375" style="fill:white;font-size:48px;"/>
+</g>
+
<g id="EPGnow" visibility="invisible" overlay="top">
- <rect height="800" width="1300" y="100" x="300" fill="#0000ff" rx="50" />
+ <rect height="800" width="1300" y="100" x="300" fill="#000066" rx="50" />
<text id="epgchannel" y="175" x="350" style="fill:white;font-size:64px;" />
<text id="epgtime" y="250" x="350" style="fill:white;font-size:40px;" />
<text id="epgduration" y="250" x="550" style="fill:white;font-size:40px;" />
@@ -123,7 +151,7 @@
</g>
<g id="EPGnext" visibility="invisible" overlay="top">
- <rect height="800" width="1300" y="100" x="300" fill="#0000ff" rx="50" />
+ <rect height="800" width="1300" y="100" x="300" fill="#000066" rx="50" />
<text id="epgchanneln" y="175" x="350" style="fill:white;font-size:64px;" />
<text id="epgtimen" y="250" x="350" style="fill:white;font-size:40px;" />
<text id="epgdurationn" y="250" x="550" style="fill:white;font-size:40px;" />
diff --git a/main.js b/main.js
index 3b229d4..06051ec 100644
--- a/main.js
+++ b/main.js
@@ -21,7 +21,6 @@ var Version = "0.10 2012/12/xx"
var nrChannels = channels.length;
var nrMedia = recording.length - 1;
-
function onLoad() {
document.addEventListener("keydown", onKeyDown, false);
video = document.getElementById("videoplane");
@@ -106,6 +105,7 @@ function play(uri) {
mediaPlayer.open(uri);
mediaPlayer.play(1000);
if(isFullscreen) {
+ GetEPG(currChan);
showOSD();
}
showDisplay((currChan.toString()), false, 100, 0 );
@@ -121,13 +121,12 @@ function preview(urip) {
}
showChannelList();
if (isSchedule) {
- GetSchedule(currChan,10);
+// GetSchedule(currChan);
}
}
function FullScreen() {
-// video.setAttribute("overlay", "500");
video.setAttribute("x", "0");
video.setAttribute("y", "0");
video.setAttribute("width", videoWidth);
@@ -238,8 +237,7 @@ function onKeyDown(event) {
} else {
if(NowNext) {
settimer();
- switchtimer.style.opacity = 1;
- setTimeout("switchtimer.style.opacity = 0; ", 2000);
+ showChannelList();
}
}
break;
@@ -281,21 +279,19 @@ function onKeyDown(event) {
break;
case "Yellow":
+ alert ("YELLOW");
+ alert (isFullscreen);
+ alert (isSchedule);
+ alert (currChan);
if(isFullscreen) {
- if(!epgactive) {
- GetSchedule(currChan,15);
- schedule.style.opacity = 1;
- schedule.style.height = "75%";
- setTimeout("schedule.style.opacity = 0;schedule.style.height = '45%';", 3000);
+ if (isSchedule) {
+ document.getElementById("SCHEDULE").setAttribute("visibility","invisible");
+ } else {
+ document.getElementById("SCHEDULE").setAttribute("visibility","visible");
+ SetSchedule();
}
- } else {
- GetSchedule(currChan,10);
- schedule.style.opacity = 1 - schedule.style.opacity;
- channelList.style.opacity = 1 - schedule.style.opacity;
- schedkeys.style.opacity = schedule.style.opacity;
- colorkeys.style.opacity = 1 - schedule.style.opacity;
- isSchedule = schedule.style.opacity;
}
+ isSchedule = !isSchedule;
break;
case "Blue":
if(isFullscreen) {
@@ -576,12 +572,23 @@ function showVolume() {
function SetOsdInfo() {
date_time();
- GetEPG(currChan);
+// GetEPG(currChan);
makeOSD();
return;
}
+function SetSchedule() {
+ for (var i = 1; i < 15; i++) {
+ document.getElementById(("schedule"+i)).textContent = schedule[i][currChan];
+ }
+ document.getElementById("schedule0").textContent = currChan + "\uE003" + channelsnames[currChan];
+}
+
+
+
function onCacheUpdated() {
+ GetEPG(currChan);
+
if (osdtimeout) {
SetOsdInfo();
}
@@ -589,7 +596,7 @@ function onCacheUpdated() {
// showChannelList();
// }
if (isSchedule) {
- GetSchedule(currChan,10);
+ SetSchedule();
}
}
@@ -640,9 +647,9 @@ document.getElementById("epgchanneln").textContent = Left(channelsnames[currChan
document.getElementById("osdtimenext").textContent = th + ":" + tm;
document.getElementById("epgtimen").textContent = th + ":" + tm;
-document.getElementById("osdpnow").textContent = EPG[0][1][currChan] + " " + EPG[0][6][currChan];
+document.getElementById("osdpnow").textContent = Left(EPG[0][1][currChan] + " " + EPG[0][6][currChan],35);
document.getElementById("epginfo").textContent = EPG[0][1][currChan] + " " + EPG[0][6][currChan];
-document.getElementById("osdpnext").textContent = EPG[1][1][currChan] + " " + EPG[1][6][currChan];
+document.getElementById("osdpnext").textContent = Left(EPG[1][1][currChan] + " " + EPG[1][6][currChan],35);
document.getElementById("epginfon").textContent = EPG[1][1][currChan] + " " + EPG[1][6][currChan];
document.getElementById("epgextinfo").textContent = EPG[0][4][currChan] + EPG[0][5][currChan];
@@ -674,14 +681,14 @@ function settimer() {
dateCurrent = new Date();
var StartTime = Math.floor((date.getTime() - dateCurrent.getTime()));
timerChan = currChan;
- TimerActions = "isVisible = 0; isFullscreen = 1; FullScreen(); setVisible(isVisible); currChan = timerChan; play(timerChan); osdtimer.innerHTML = '';SetLed(0,0,0);"
+ TimerActions = "isVisible = 0; isFullscreen = 1; FullScreen(); setVisible(isVisible); currChan = timerChan; play(timerChan);SetLed(0,0,0);"
// only 1 switch timer possible
if(switchtimerID) {
clearTimeout(switchtimerID);
}
switchtimerID = setTimeout(TimerActions, StartTime);
- switchtimericon = "\uE00C";
- switchtimer.innerHTML = "<font color=black size=4><p> Name : " + EPG[NowNext][1][currChan] + "</p><p> channel : " + channelsnames[currChan] + "</p><p> Starttime : " + th + ":" + tm + "</p></font>";
+ switchicon = "\uE00C";
+ switchtimericon[0] = currChan;
SetLed(0,2,1);
} else {
//
@@ -766,9 +773,9 @@ function GetEPG(epgchan)
eitCache.addService(eitService);
event = eitCache.getPresentEvent(eitService);
if(event.freeCaMode){
- document.getElementById("osdca").textContent = "\uE00D" + switchtimericon ;
+ document.getElementById("osdca").textContent = "\uE00D" + switchicon ;
} else {
- document.getElementById("osdca").textContent = "\uE00F" + switchtimericon;
+ document.getElementById("osdca").textContent = "\uE00F" + switchicon;
}
if (event.name)
@@ -802,54 +809,9 @@ function GetEPG(epgchan)
EPG[0][6][epgchan] = "";
}
- event = eitCache.getFollowingEvent(eitService);
- EPG[1][1][epgchan] = event.name;
- EPG[1][2][epgchan] = event.time;
- EPG[1][3][epgchan] = (event.duration/60).toFixed(0);
- EPG[1][4][epgchan] = "";
- EPG[1][5][epgchan] = "";
-
- if(EPGShortnext) {
- EPG[1][4][epgchan] = EPGShortnext;
- }
- if(EPGExtnext) {
- EPG[1][5][epgchan] = EPGExtnext;
- }
-
- if(cds){
- // CDS has short info, other providers, a little longer.
- EPG[1][6][epgchan] = EPGShortnow;
- } else {
- EPG[1][6][epgchan] = "";
- }
-
-
- } catch(e) {
- alert("Get EPG problem: " + e);
- }
-}
-
-
-
-function GetSchedule(schchan,tablelength){
- 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);
+// schedule
events = eitCache.getEvents(eitService, 1000000000, 2000000000);
-
if (event.name) {
if (events.more) {
var t = eitCache.getEvents(eitService, 1000000000, 2000000000);
@@ -857,13 +819,7 @@ function GetSchedule(schchan,tablelength){
events.more = t.more;
}
- var txt = "<table><tr>";
- var i = 0;
- 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;
- }
+ for (var i = 0; i < events.infoSequence.length && i < 14; i++) {
tijd = events.infoSequence[i].time;
date = new Date(tijd*1000);
@@ -879,21 +835,41 @@ function GetSchedule(schchan,tablelength){
{
tm = "0"+tm;
}
-
- txt = txt + "<td>" + th + ":" + tm + " (" + events.infoSequence[i].duration/60 + ") " + events.infoSequence[i].name + "</td></tr>";
+ schedule[i+1][epgchan] = th + ":" + tm + " (" + events.infoSequence[i].duration/60 + ") " + events.infoSequence[i].name;
}
- txt = txt + "</table>";
- schedule.innerHTML = channelsnames[schchan] + txt;
+ }
+// end schedule
+
+ event = eitCache.getFollowingEvent(eitService);
+
+ EPG[1][1][epgchan] = event.name;
+ EPG[1][2][epgchan] = event.time;
+ EPG[1][3][epgchan] = (event.duration/60).toFixed(0);
+ EPG[1][4][epgchan] = "";
+ EPG[1][5][epgchan] = "";
+
+ if(EPGShortnext) {
+ EPG[1][4][epgchan] = EPGShortnext;
+ }
+ if(EPGExtnext) {
+ EPG[1][5][epgchan] = EPGExtnext;
+ }
+
+ if(cds){
+ // CDS has short info, other providers, a little longer.
+ EPG[1][6][epgchan] = EPGShortnow;
} else {
- schedule.innerHTML = "<p>" + channelsnames[schchan] + "</p> ";
+ EPG[1][6][epgchan] = "";
}
+
+
+
} catch(e) {
alert("Get EPG problem: " + e);
- schedule.innerHTML = "<p>" + channelsnames[schchan] + "</p><p> NO EPG </p>";
}
+}
-}
// End of EPG section
@@ -932,7 +908,7 @@ function showChannelList() {
var y = 110 + (50 * yy);
document.getElementById("guidebar").setAttribute("y",y);
}
- tijd = EPG[0][2][currChan];
+ tijd = EPG[0][2][listChan];
date = new Date(tijd*1000);
tijd = date.toUTCString();
tijd = new Date(tijd);
@@ -952,11 +928,35 @@ function showChannelList() {
tm = "0"+tm;
}
- EpgInfo[0] = th + ":" + tm + "\uE003(" + EPGminutes + "\uE003/\uE003" + (EPG[0][3][listChan] - EPGminutes).toFixed(0) + ")" + "\uE003" + EPG[0][1][listChan] + "\uE003" + EPG[0][6][listChan];
+ EpgInfo[0] = th + ":" + tm + "\uE003(" + EPGminutes + "/" + (EPG[0][3][listChan] - EPGminutes).toFixed(0) + ")" + "\uE003" + EPG[0][1][listChan] + "\uE003" + EPG[0][6][listChan];
+
+
+ tijd = EPG[1][2][listChan];
+ date = new Date(tijd*1000);
+ tijd = date.toUTCString();
+ tijd = new Date(tijd);
+ dateCurrent = new Date();
+ var tm = tijd.getMinutes();
+ var th = tijd.getHours();
+ if(th<10)
+ {
+ th = "0"+th;
+ }
+ if(tm<10)
+ {
+ tm = "0"+tm;
+ }
+
EpgInfo[1] = th + ":" + tm + "\uE003(" + (EPG[1][3][listChan]) + ")" + "\uE003" + EPG[1][1][listChan] + "\uE003" + EPG[1][6][listChan];
+
try {
- document.getElementById(("guide"+yy)).textContent = listChan + "\uE003" + Left(channelsnames[listChan],15) + "\uE003" + Left(EpgInfo[NowNext],64);
+ if (listChan == switchtimericon[0] && NowNext == 1) {
+ document.getElementById("guide"+yy).setAttribute("style","fill:red;font-size:36px;");
+ } else {
+ document.getElementById("guide"+yy).setAttribute("style","fill:white;font-size:36px;");
+ }
+ document.getElementById(("guide"+yy)).textContent = listChan + "\uE003" + Left(channelsnames[listChan],15) + "\uE003" + Left(EpgInfo[NowNext],60);
} catch (e) {
alert("Error file guide list: " + e);
}
@@ -964,10 +964,6 @@ function showChannelList() {
}
-// htmlstring = htmlstring + "</table>";
-// channelList.innerHTML = htmlstring;
-// chanlistepg.innerHTML = "<center><font color=black size=4><p>" + EPG[NowNext][1][currChan] + "</p></font><font color=black size=3><p>" + Left(EPG[NowNext][4][currChan],250) + "</p></font></center>" ;
-
}
@@ -1014,7 +1010,8 @@ function onKeyMenu(keyCode) {
clearTimeout(switchtimerID);
switchtimerID = 0;
InitMenu();
- switchtimericon = "\uE003"
+ switchtimericon[0] = 0;
+ switchicon = "\uE003";
SetLed(0,0,0);
break;
case "Blue":
diff --git a/settings.js b/settings.js
index be702a3..8df6a1e 100644
--- a/settings.js
+++ b/settings.js
@@ -57,7 +57,8 @@ var KEY_9 = "U+0039";
var videoWidth = "544"; // fallbacksize
var videoHeight = "576";
-var switchtimericon = "\uE003";
+var switchtimericon = new Array();
+var switchicon = "\uE003";
var guide = null;
var video = null;
@@ -80,6 +81,7 @@ NN[1] = "Next";
NN[2] = "Schedule";
NN[3] = "-----";
NN[4] = "TIMER";
+NN[5] = "TIMER";
//
//NowNext, 1 = programma naam event.name ,currchan
@@ -112,6 +114,9 @@ EPG[2][4] = new Array();
EPG[2][5] = new Array();
EPG[2][6] = new Array();
+var schedule = new Array();
+for (var i = 1; i < 15; i++) { schedule[i] = new Array(); }
+
var osdtimeout = 0;
var osdVolumetimeout = 0;
var epgactive = 0;