From c0cd92a9e5c49ad007cc776e84a48ecc2fb75987 Mon Sep 17 00:00:00 2001 From: "M. Voerman" Date: Sat, 19 Jan 2013 19:25:51 +0100 Subject: Fixed pause/ timers menu --- History | 6 ++++++ index.html | 71 +++++++++++++++++++++++++++++++++++++++++++------------------ settings.js | 5 +++++ 3 files changed, 61 insertions(+), 21 deletions(-) diff --git a/History b/History index b4602fb..12d0e23 100644 --- a/History +++ b/History @@ -1,3 +1,9 @@ +0.12 Fixed timers menu (didn't work, after you read timers from server) + Fixed pause function with "VDR on SmartTV" + Updated to use the new function 'is_new' from "VDR on SmartTV" + Added (key '5') jump to next mark in recordings. With use of restfulapi plugin + + 0.11 Switch to Scheduler services for settings timers. Some fixes in the recorder & player routine Better support for "VDR on SmartTV" & check if availible. diff --git a/index.html b/index.html index d0bebf2..c92d054 100644 --- a/index.html +++ b/index.html @@ -24,7 +24,7 @@ // // -var Version = "0.11 2013/01/18" +var Version = "0.12 2013/01/xx" 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] = ""; } @@ -1759,8 +1759,8 @@ if(menu == 5) { // Timers from Server booking = ""; var x = timerID - 1; for (var i=0;i<10;i++) { - if (timer.length !== 0) { do { x = x + 1; } while (!timer[x] && (x < timer.length)) } - if (timer.length > x) { booking = booking + timer[x]; } else { booking = booking +"\n"; } + if (timers.length !== 0) { do { x = x + 1; } while (!timers[x] && (x < timers.length)) } + if (timers.length > x) { booking = booking + timers[x]; } else { booking = booking +"\n"; } if (i == 0) { booking = booking + ""; } } @@ -1840,14 +1840,14 @@ try { } timersName[i] = x[i].getElementsByTagName("param")[15].childNodes[0].nodeValue + fill; if (timersFlag[i] == "1") { - timer[i] = "\uE003\uE00C\uE003"; + timers[i] = "\uE003\uE00C\uE003"; } else if (timersFlag[i] == "9") { - timer[i] = "\uE003\uE00B\uE003"; + timers[i] = "\uE003\uE00B\uE003"; } else { - timer[i] = "\uE003\uE003\uE003"; + timers[i] = "\uE003\uE003\uE003"; } timersFile[i] = x[i].getElementsByTagName("param")[14].childNodes[0].nodeValue + fill + fill; - timer[i] = timer[i] + timersDays[i] + "\uE003" + timersStrt[i] + "\uE003" + timersStop[i] + "\uE003" + Left(timersName[i],8) + "\uE003" + Left(timersFile[i],15) + "\n" ; + timers[i] = timers[i] + timersDays[i] + "\uE003" + timersStrt[i] + "\uE003" + timersStop[i] + "\uE003" + Left(timersName[i],8) + "\uE003" + Left(timersFile[i],15) + "\n" ; timerOK = 1; } } catch(e) { @@ -1929,9 +1929,9 @@ function onKeyMedia(keyCode) { if (DelisOK) { switch(keyCode) { case "Accept": - DelRec2(); - getRecList(); - showMediaList(); + mediaList.innerHTML = "

Please WAIT

"; + switchtimer.style.opacity = 0; + setTimeout("DelRec2(); getRecList(); showMediaList();",100) default: switchtimer.style.opacity = 0; DelisOK = 0; @@ -1998,13 +1998,14 @@ if (DelisOK) { while (!recTitl[currMed]); showMediaList(); } else { - mediaPlayer.play(mediaPlayer.PACE_PLAY); - showDisplay("PLAY", false, 100, 0 ); + position = position + (mediaPlayer.getPosition()/1000); + playRec((recLink[currMed] + "?time=" + position)); } break; case "Accept": if (mediaList.style.opacity != 0) { mediaList.style.opacity = 0; + GetMarks(); playRec(recLink[currMed]); } else { osdmedia.style.opacity = 1 - osdmedia.style.opacity; @@ -2071,6 +2072,7 @@ if (DelisOK) { break; case "MediaStop": position = 0; + osdepginfo.style.opacity = 0; isFullscreen = 0; play(channels[currChan]); isFullscreen = 1; if (isRecording == 1) { recordStop(); @@ -2082,11 +2084,11 @@ if (DelisOK) { break; case "MediaPlayPause": if (mediaPlayer.getState() != mediaPlayer.STATE_PAUSED) { - mediaPlayer.play(0); showDisplay("PAUS", false, 100, 0 ); + mediaPlayer.play(0); } else { - mediaPlayer.play(1000); - showDisplay("PLAY", false, 100, 0 ); + position = position + (mediaPlayer.getPosition()/1000); + playRec((recLink[currMed] + "?time=" + position)); } break; @@ -2128,6 +2130,12 @@ if (DelisOK) { playRec((recLink[currMed] + "?time=" + position)); break; + case KEY_5: + if (recMark.length>0) { + position = recMark[posMark]; + playRec(recLink[currMed] + "?time=" + position); + } + break; case KEY_3: position = position + (mediaPlayer.getPosition()/1000) + 30; @@ -2176,6 +2184,7 @@ try { recDesc[i] = (x[i].getElementsByTagName("description")[0].childNodes[0].nodeValue); recDura[i] = (x[i].getElementsByTagName("duration")[0].childNodes[0].nodeValue); recStrt[i] = (x[i].getElementsByTagName("start")[0].childNodes[0].nodeValue); + rec_New[i] = (x[i].getElementsByTagName("isnew")[0].childNodes[0].nodeValue); } MakeRecList(); getRecOK = 1; @@ -2186,6 +2195,25 @@ try { } } +function GetMarks() { +try { + posMark = 0; + xmlhttp=new XMLHttpRequest(); + xmlhttp.open("GET",(RestFulAPI + "/recordings/" + currMed + ".xml?marks=true&" + new Date().getTime()),false); + xmlhttp.send(); + xmlDoc=xmlhttp.responseXML; + var x=xmlDoc.getElementsByTagName("mark"); + for (var i=0;i\uE003\uE003" + Left(recList[listMed],60) + ""; + htmlstring = htmlstring + "\uE003" + Left(recList[listMed],60) + ""; } mediaList.innerHTML = htmlstring + ""; //ShowInfo(); - alert(nrMedia); } @@ -2389,8 +2415,11 @@ function ShowMediaOSD() { var pos = (position + (mediaPlayer.getPosition()/1000)).toFixed(0); var pos2 = ((pos / Number(recDura[currMed])) * 100).toFixed(0); if (pos2 < 1) { pos2 = 1;} + if (pos>recMark[posMark] && recMark.length>0) { posMark = posMark + 1;} + if (recMark[posMark]) { var pos3 = "\n Next Mark : " + (recMark[posMark]/60).toFixed(0); } else { var pos3 = "\n"; } pos2 = ((pos2 * 140) / 100).toFixed(0); - osdmedia.innerHTML = "
  " + Left(recTitl[currMed],50) + "\n  Elapsed time : " + (pos/60).toFixed(0) + " / " + (Number(recDura[currMed])/60).toFixed(0)  + "\n  \uE007" + new Array(pos2 - 1).join("\uE008") + new Array(140 - pos2).join("\uE009") + "\uE00A 
"; + var pos4 = Left(recTitl[currMed],50); + osdmedia.innerHTML = "
  " + pos4 + "\n" + new Array(40).join("\uE003") + (pos/60).toFixed(0) + " / " + (Number(recDura[currMed])/60).toFixed(0) + pos3 + "\n  \uE007" + new Array(pos2 - 1).join("\uE008") + new Array(140 - pos2).join("\uE009") + "\uE00A 
"; } function ShowInfo() { @@ -2494,7 +2523,7 @@ function onScheduledStop(event) {
Volume :
-
+
diff --git a/settings.js b/settings.js index c822ef1..5b3c4dc 100644 --- a/settings.js +++ b/settings.js @@ -215,6 +215,10 @@ var recDesc = new Array(); var recDura = new Array(); var recStrt = new Array(); var recList = new Array(); +var recMark = new Array(); +var rec_New = new Array(); + +var posMark = 0; var recMap = 0; var timersID = new Array(); @@ -231,6 +235,7 @@ var getRecOK = 0; var position = 0; var timer = new Array(); +var timers = new Array(); var getbookingID = 0; var timerID = 0; var nrMedia = 0; -- cgit v1.2.3