From ea570e05e4f15d99fd185afc0b0079747e837c18 Mon Sep 17 00:00:00 2001 From: "M. Voerman" Date: Sun, 13 Jan 2013 12:43:19 +0100 Subject: Info menu added Standby now closes stream --- index.html | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 62 insertions(+), 9 deletions(-) (limited to 'index.html') diff --git a/index.html b/index.html index 9fdc59c..3ad9d1c 100644 --- a/index.html +++ b/index.html @@ -48,7 +48,12 @@ function onLoad() { // eitCache.setFilterMode(eitCache.FILTER_MODE_PF_ONLY); eitCache.addEventListener(eitCache.ON_CACHE_UPDATED, onCacheUpdated); mediaPlayer.addEventListener(mediaPlayer.ON_DATA_AVAILABLE,onDataAvailableEvent); + if (mediaRecorder) { mediaRecorder.addEventListener(mediaRecorder.ON_STATE_CHANGED, onRecorderStateChanged); + } + + toi.informationService.addEventListener(toi.informationService.ON_OBJECTS_CHANGED, onEvent); + toi.informationService.subscribeObject(onEvent, "var.io.state", true); var ss = toi.schedulerService; ss.addEventListener(ss.ON_SCHEDULED_START, onScheduledStart); @@ -78,7 +83,22 @@ function onLoad() { mediaList.innerHTML = "

Please WAIT

"; } - +function onEvent(event) { +var numObjs = event.objectNames.length; + for (var i=0; i 100) { Volume = 100; } @@ -680,7 +702,7 @@ function onKeyDown(event) { showVolume(); break; case "VolumeDown": - Volume = Volume - 10; + Volume = Volume - VolumeStep; if (Volume < 0) { Volume = 0; } @@ -1645,7 +1667,11 @@ function onKeyMenu(keyCode) { menu = 3; playMPD(MPDAddress); InitMenu(menu); + } else if (menu == 1) { + menu = 4; // INFO menu + InitMenu(menu); } + break; case KEY_0: if (menu !== 0) { @@ -1661,14 +1687,14 @@ function onKeyMenu(keyCode) { osdmute.style.opacity = mute; break; case "VolumeUp": - Volume = Volume + 10; + Volume = Volume + VolumeStep; if (Volume > 100) { Volume = 100; } toi.audioOutputService.setVolume(AudioOut, Volume); break; case "VolumeDown": - Volume = Volume - 10; + Volume = Volume - VolumeStep; if (Volume < 0) { Volume = 0; } @@ -1700,7 +1726,7 @@ function playMPD(uri) { function InitMenu(menu) { if(menu == 0) { // Main Menu - mainmenu.innerHTML = "

MainMenu \n ( " + Version + " )

   1 - SettingsMenu \n   2 - Recordings \n   3 - TimersMenu\n   4 -\n   5 -\n   6 -\n   7 -\n   8 -\n   9 - MPD Server Connection\n\n   BLUE - Restart Portal 
"; + mainmenu.innerHTML = "

MainMenu \n ( " + Version + " )

   1 - SettingsMenu \n   2 - Recordings \n   3 - TimersMenu\n\n\n\n\n\n   9 - MPD Server Connection\n\n   BLUE - Restart Portal 
"; } if(menu == 1) { // settings menu @@ -1712,7 +1738,7 @@ if(menu == 1) { // settings menu if (ShowProtectedChannels) { htmltext = htmltext + "\uE017"; } else { htmltext = htmltext + "\uE016"; } htmltext = htmltext + " Protection\n 8 - "; if (SwitchGuide) { htmltext = htmltext + "\uE017"; } else { htmltext = htmltext + "\uE016"; } - htmltext = htmltext + " Preview guide\n\n\n 0 - MainMenu "; + htmltext = htmltext + " Preview guide\n 9 - Show INFO\n 0 - MainMenu "; mainmenu.innerHTML = htmltext; } @@ -1746,6 +1772,33 @@ if(menu == 3) { // MPD Menu mainmenu.innerHTML = "

MPD Connection

 MENU to exit \n 0 - back to MainMenu 
"; } +if(menu == 4) { // INFO Menu + var htmltext = "

INFO

";
+	try {
+		is = toi.informationService;
+	
+		htmltext = htmltext + "\n   Product name: " + is.getObject("config.productdisplayname");
+		htmltext = htmltext + "\n   Build date : " + is.getObject("config.build.date");
+//		htmltext = htmltext + "\n   IO State: " + is.getObject("var.io.state");
+
+		htmltext = htmltext + "\n\n   IP address:" + is.getObject("config.ipaddress");
+		var x = is.getObject("cfg.ip.eth0.mode");
+		if (x == "DHCP") { htmltext = htmltext + "\n \uE017 "; } else { htmltext = htmltext + "\n \uE016 "; }
+		htmltext = htmltext + "DHCP";
+		var x = is.getObject("var.capabilities.dvr");
+		if (x !== "FALSE") { htmltext = htmltext + "\n \uE017 "; } else { htmltext = htmltext + "\n \uE016 "; }
+		htmltext = htmltext + "DVR ";
+
+
+	} catch(e) {
+		alert("Error : " + e);
+	}
+	htmltext = htmltext + "\n\n\n\n\n   0 - back to MainMenu 
"; + mainmenu.innerHTML = htmltext; + +} + + } // end of initmenu function LoadTimers() { @@ -1943,7 +1996,7 @@ function onKeyMedia(keyCode) { osdmute.style.opacity = mute; break; case "VolumeUp": - Volume = Volume + 10; + Volume = Volume + VolumeStep; if (Volume > 100) { Volume = 100; } @@ -1951,7 +2004,7 @@ function onKeyMedia(keyCode) { showVolume(); break; case "VolumeDown": - Volume = Volume - 10; + Volume = Volume - VolumeStep; if (Volume < 0) { Volume = 0; } -- cgit v1.2.3