From 49b8df6572c7e16c279fb9a26c5c8dd0428b11cf Mon Sep 17 00:00:00 2001
From: "M. Voerman"
Date: Tue, 8 Jan 2013 00:52:03 +0100
Subject: New MainMenu and some fixes
---
index.html | 335 ++++++++++++++++++++++++++++++++++++++-----------------------
1 file changed, 209 insertions(+), 126 deletions(-)
(limited to 'index.html')
diff --git a/index.html b/index.html
index e5a5cb4..57c087c 100644
--- a/index.html
+++ b/index.html
@@ -4,6 +4,7 @@
+
@@ -32,18 +33,17 @@
var Version = "0.10 2013/01/xx"
var nrMedia = recording.length - 1;
-for (var i = minTVchan; i < (maxTVchan+1); 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] = ""; }
-for (var i = minRDchan; i < (maxRDchan+1); 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] = ""; }
-for (var i = minPRTchan; i < (maxPRTchan+1); 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] = ""; }
+for (var i = minChan[0]; i < (maxChan[0]+1); 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] = ""; }
+for (var i = minChan[1]; i < (maxChan[1]+1); 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] = ""; }
+for (var i = minChan[5]; i < (maxChan[5]+1); 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] = ""; }
+for (var i = minChan[6]; i < (maxChan[6]+1); 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] = ""; }
+for (var i = minChan[9]; i < (maxChan[9]+1); 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() {
createPlayer();
- if(Experimental){
- // Space for testing experimental parts.
- createRecorder();
- }
+ createRecorder();
embedTeletextPlugin();
toi.audioOutputService.setVolume(AudioOut, StartVolume);
toi.audioOutputService.setMuteState(AudioOut, false);
@@ -79,6 +79,15 @@ function onUnload() {
try {
mediaPlayer.close();
mediaPlayer.releaseInstance();
+ if(TimeShift){
+ mediaPlayer.stopTimeshiftBuffering();
+ mediaPlayer.discardTimeshiftBuffer();
+ }
+ mediaRecorder.close();
+ mediaRecorder.releaseInstance();
+ eitCache.removeEventListener(eitCache.ON_CACHE_UPDATED, onCacheUpdated);
+ mediaPlayer.removeEventListener(mediaPlayer.ON_DATA_AVAILABLE,onDataAvailableEvent);
+
} catch(e) {
alert(e);
}
@@ -86,8 +95,8 @@ function onUnload() {
function incChan(step) {
currChan = currChan + step;
- if (currChan > maxChan) {
- currChan = minChan;
+ if (currChan > maxChan[ChanGroup]) {
+ currChan = minChan[ChanGroup];
}
osdnr.style.opacity = isFullscreen;
OSDchannr(currChan);
@@ -95,8 +104,8 @@ function incChan(step) {
function decChan(step) {
currChan = currChan - step;
- if (currChan < minChan ) {
- currChan = maxChan ;
+ if (currChan < minChan[ChanGroup] ) {
+ currChan = maxChan[ChanGroup] ;
}
osdnr.style.opacity = isFullscreen;
OSDchannr(currChan);
@@ -129,7 +138,11 @@ function play(uri) {
mediaPlayer.close();
}
+ if (ChanGroup == 5) {
+ uri = "239.255.0." + (currChan - baseChn[5]).toString() + ":11111";
+ } else {
uri = ServerAdres + uri;
+ }
mediaPlayer.open(uri);
mediaPlayer.play(1000);
SetLed(1,1,0);
@@ -225,10 +238,19 @@ for(x=0; x (minChan + 8)) {
+ if (currChan > (minChan[ChanGroup] + 8)) {
decChan(9);
} else {
- currChan = maxChan - currChan;
+ currChan = maxChan[ChanGroup] - currChan;
}
do
{
decChan(1);
}
while (!channels[currChan]);
- if(isFullscreen) {
- play(channels[currChan]);
- } else {
- preview(channels[currChan]);
+ preview(channels[currChan]);
}
break;
case "Right":
count = 0;
+ if(isFullscreen) {
+ defChan[ChanGroup] = currChan;
+ do
+ {
+ ChanGroup = ChanGroup + 1;
+ if (ChanGroup > 9) {
+ ChanGroup = 0;
+ }
+ if (ChanGroup == 6 && ShowProtectedChannels == 1) {
+ ChanGroup = ChanGroup + 1;
+ }
+ }
+ while (!minChan[ChanGroup]);
+ currChan = defChan[ChanGroup];
+ play(channels[currChan]);
+
+ } else {
prevChan = currChan;
- if (currChan < (maxChan - 9 )) {
+ if (currChan < (maxChan[ChanGroup] - 9 )) {
incChan(9);
} else {
- currChan = maxChan - currChan;
+ currChan = maxChan[ChanGroup] - currChan;
}
do
{
incChan(1);
}
while (!channels[currChan]);
- if(isFullscreen) {
- play(channels[currChan]);
- } else {
- preview(channels[currChan]);
+ preview(channels[currChan]);
}
break;
case "Red":
@@ -522,7 +571,8 @@ function onKeyDown(event) {
if(isFullscreen) {
isSetupMenu = 1;
mainmenu.style.opacity = 1;
- InitMenu();
+ menu = 0;
+ InitMenu(menu);
}
break;
case "Scroll":
@@ -554,10 +604,24 @@ function onKeyDown(event) {
}
break;
case "TV":
- currChan = prevChan;
- showDisplay((currChan.toString()), false, 100, 0 );
- play(channels[currChan]);
- break;
+// currChan = prevChan;
+// showDisplay((currChan.toString()), false, 100, 0 );
+// play(channels[currChan]);
+// break;
+ case "RADIO":
+ if(ChanGroup !== 9) {
+ //Radio
+ ChanGroup = 9;
+ currChan = defChan[9];
+ } else {
+ //TV
+ ChanGroup = 0;
+ currChan = defChan[0];
+ }
+ isSetupMenu = 0;
+ mainmenu.style.opacity = 0;
+ play(channels[currChan]);
+ break;
case KEY_0:
digit = 0;
@@ -636,12 +700,12 @@ function onKeyDown(event) {
break;
case "MediaPlayPause":
if(TimeShift){
- if(mediaPlayer.getState() == mediaPlayer.STATE_PAUSED) {
+ if(mediaPlayer.getState() == mediaPlayer.STATE_PAUSED || mediaPlayer.getState() == mediaPlayer.STATE_FASTFORWARDING || mediaPlayer.getState() == mediaPlayer.STATE_REWINDING) {
SetLed(1,1,0);
mediaPlayer.play(mediaPlayer.PACE_PLAY);
break;
}
- if(mediaPlayer.getState() == mediaPlayer.STATE_PLAYING) {
+ if(mediaPlayer.getState() == mediaPlayer.STATE_PLAYING) {
SetLed(1,1,10);
mediaPlayer.play(0);
break;
@@ -649,9 +713,20 @@ function onKeyDown(event) {
}
break;
case "MediaStop":
- LoadMediaSettings();
+ try {
+ SetLed(1,1,0);
+ mediaPlayer.playFromPosition(mediaPlayer.POSITION_LIVE,mediaPlayer.PACE_PLAY);
+ } catch(e) {
+ alert(e);
+ }
break;
+ case KEY_REC:
case "MediaRecord":
+ if (isRecording == 1) {
+ recordStop();
+ } else {
+ recordStart();
+ }
break;
default:
@@ -686,7 +761,7 @@ function Makedigit() {
function CheckChannel(CheckThis) {
// function to check if channel exists
- CheckThis = chanBase + CheckThis;
+ CheckThis = baseChn[ChanGroup] + CheckThis;
if(channels[CheckThis]) {
ChangeOK = 1;
currChan = CheckThis;
@@ -1138,6 +1213,12 @@ function StreamInfo(si) {
is.setObject("cfg.locale.ui","dut",is.STORAGE_VOLATILE);
}
+ if(SI[1]=="3" && ( SI[2]=="3210" || ( SI[2]=="3219" && SI[3]!=="13135") )) {
+ //Canal Digitaal/ TV Vlaanderen use CZE channels on 23East
+ // Strangly set filter to cze but epg is in Dutch. (But not for JimJam)
+ is.setObject("cfg.locale.ui","cze",is.STORAGE_VOLATILE);
+ }
+
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")) {
//Swiss ITA channels
is.setObject("cfg.locale.ui","ita",is.STORAGE_VOLATILE);
@@ -1162,6 +1243,10 @@ function StreamInfo(si) {
is.setObject("cfg.locale.ui","pol",is.STORAGE_VOLATILE);
}
+ if(SI[0]=="S19.2E" && (SI[2]=="1074") || (SI[2]=="1018") || (SI[2]=="1024") || (SI[2]=="1068") || (SI[2]=="1070") || (SI[2]=="1072") || (SI[2]=="1076") || (SI[2]=="1080") || (SI[2]=="1084") || (SI[2]=="1086") || (SI[2]=="1090") || (SI[2]=="1092") || (SI[2]=="1094") || (SI[2]=="1096") || (SI[2]=="1100") || (SI[2]=="1102") || (SI[2]=="1106") || (SI[2]=="1110") || (SI[2]=="1112") || (SI[2]=="1114") || (SI[2]=="1116") || (SI[2]=="1118") || (SI[2]=="1120")) {
+ //CanalSat S19.2
+ is.setObject("cfg.locale.ui","fra",is.STORAGE_VOLATILE);
+ }
}
@@ -1186,15 +1271,15 @@ function showChannelList() {
do
{
listChan = listChan + 1;
- if (listChanmaxChan) {
- listChan=minChan;
+ if (listChan>maxChan[ChanGroup]) {
+ listChan=minChan[ChanGroup];
}
}
- while (!channels[listChan] && (listChan MainMenu ( " + Version + " )
Frontdisplay Clock : " + showClock + "
Prio audio track : " + (toi.informationService.getObject("cfg.media.audio.languagepriority")) + "
Switch timer : " + Boolean(switchtimerID) + "
Preview guide : " + SwitchGuide + "
1 - Show Subs : " + Boolean(ShowSubs) + "
2 - Subs Type Prio : " + (toi.informationService.getObject("cfg.media.subtitling.typepriority")) + "
3 - Subs Mode Prio : " + (toi.informationService.getObject("cfg.media.subtitling.modepriority")) + "
4 - Audio Type Prio : " + (toi.informationService.getObject("cfg.media.audio.typepriority")) + "
9 - Switch Protected / TV
0 - Switch TV / Radio
";
+function InitMenu(menu) {
+
+if(menu == 0) {
+// Main Menu
+
+ mainmenu.innerHTML = " MainMenu \n ( " + Version + " )
1 - SettingsMenu \n 2 - Recordings \n 3 - Switch timer : " + Boolean(switchtimerID) + "\n 4 -\n 5 -\n 6 -\n 7 -\n 8 -\n 9 -\n 0 - Restart Portal
";
}
-function InitInfo() {
- mainmenu.innerHTML = " INFO
" + "Bla bla bla" + "
";
+if(menu == 1) {
+// settings menu
+ mainmenu.innerHTML = " Settings
Frontdisplay Clock : " + Boolean(showClock) + "\n Prio audio track : " + (toi.informationService.getObject("cfg.media.audio.languagepriority")) + "\n Preview guide : " + Boolean(SwitchGuide) + "\n 1 - Show Subs : " + Boolean(ShowSubs) + "\n 2 - Subs Type Prio : " + (toi.informationService.getObject("cfg.media.subtitling.typepriority")) + "\n 3 - Subs Mode Prio : " + (toi.informationService.getObject("cfg.media.subtitling.modepriority")) + "\n 4 - Audio Type Prio : " + (toi.informationService.getObject("cfg.media.audio.typepriority")) + "\n 5 - Protection : " + Boolean(ShowProtectedChannels) + "\n\n\n\n 0 - MainMenu ";
}
+
+
+}
+
// End of Menu section
// Media Player Section
@@ -1521,7 +1605,9 @@ function UnloadMediaSettings() {
mediaList.style.opacity = 0;
showDisplay((currChan.toString()), false, 100, 0 );
isMediaMenu = 0;
+ if (mediaPlayer.getState() != mediaPlayer.STATE_PLAYING ) {
play(channels[currChan]);
+ }
}
@@ -1566,7 +1652,7 @@ function onKeyMedia(keyCode) {
} else {
osdmedia.style.opacity = 1 - osdmedia.style.opacity;
ShowMediaOSD();
-// mediaPlayer.playFromPosition(60000,1000);
+// mediaPlayer.playFromPosition(12000,1000);
}
break;
case "Green":
@@ -1704,14 +1790,11 @@ function playRec(uri) {
if (mediaPlayer.getState() != mediaPlayer.STATE_IDLE) {
mediaPlayer.close();
}
-// uri = "file://" + uri;
mediaPlayer.open(uri);
mediaPlayer.play(1000);
showDisplay("PLAY", false, 100, 0 );
} catch (e) {
alert("Failed opening recording: " + e);
- alert("error: " + mediaPlayer.getTimeshiftError().source);
- alert("error: " + mediaPlayer.getTimeshiftError().details);
return;
}
}
@@ -1728,10 +1811,10 @@ function createNewAsset() {
function recordStart() {
createNewAsset();
-
+ uri = ServerAdres + channels[currChan];
alert("opening mediaRecorder...");
try {
- mediaRecorder.open(uri, assetId, 0);
+ mediaRecorder.open(uri, assetId);
} catch(e) {
alert("Cannot open mediaRecorder. " + e);
}
@@ -1791,8 +1874,8 @@ function ShowMediaOSD() {
-
-
+
+
--
cgit v1.2.3