diff options
author | M. Voerman <rekordc@gmail.com> | 2014-07-10 21:02:27 +0200 |
---|---|---|
committer | M. Voerman <rekordc@gmail.com> | 2014-07-10 21:02:27 +0200 |
commit | 3930a0ff840051111070bb7b72da879ef8c32644 (patch) | |
tree | 747d73caea35bf27f53bc42fc4d0005e50124c68 | |
parent | 5498c0b58aee588ebbad61b26e6e76ce4d9be2b9 (diff) | |
download | vdr-vipclient-3930a0ff840051111070bb7b72da879ef8c32644.tar.gz vdr-vipclient-3930a0ff840051111070bb7b72da879ef8c32644.tar.bz2 |
Get recordings with streamdev and restfulapi but only with SmartTVweb plugin you can play
-rw-r--r-- | History | 2 | ||||
-rw-r--r-- | index.html | 134 | ||||
-rw-r--r-- | settings.js | 4 |
3 files changed, 124 insertions, 16 deletions
@@ -3,6 +3,8 @@ Motorola Vip : 1960, 1910, 1903, 1963. VDR 1.7.29+ +0.25 : + 0.24 vip.getmarks used for selecting getmarks 0 = restfulapi, 1 = SmartTVWeb (not all users have the newest SmartTVWeb) Channels update. @@ -2861,6 +2861,14 @@ if(menu == 9) { // INFO2 Menu htmltext += "Experimental 2"; htmltext += "\n getmarks from"; if (Number(is.getObject("vip.getmarks"))) { htmltext += " smarttvweb "; } else { htmltext += " restfulapi "; } + htmltext += "\n getrecordings from"; + if (get_recordings == 1) { + htmltext += " smarttvweb "; + } else if (get_recordings == 0) { + htmltext += " restfulapi "; + } else { + htmltext += " streamdev "; + } htmltext += "\n EPGMode : " if (EPGMode) { htmltext += "Full EPG"; } else { htmltext += "Now/Next Only"; } } catch(e) { @@ -3817,20 +3825,113 @@ try { for (var i=0;i<x.length;i++) { - recTitl[i] = (x[i].getElementsByTagName("title")[0].childNodes[0].nodeValue); - recTitl[i] = recTitl[i].split("~"); - recTitl[i] = (x[i].getElementsByTagName("enclosure")[0].getAttribute('url')); - recDesc[i] = ""; - recDura[i] = ""; - recStrt[i] = ""; - rec_New[i] = ""; - recGUID[i] = (x[i].getElementsByTagName("link")[0].childNodes[0].nodeValue); - recChan[i] = 0; - recProt[i] = 0; - alert(i); + rec_lst[i] = new Array(); + for (var yy=0;yy<9;yy++) { rec_lst[i][yy] = new Array(); } + rec_lst[i][0] = (x[i].getElementsByTagName("title")[0].childNodes[0].nodeValue); + rec_lst[i][0] = rec_lst[i][0].split("~"); + rec_lst[i][0][0] = Right(rec_lst[i][0][0], (rec_lst[i][0][0].length - 18)); + if (Left(rec_lst[i][0][0],1) == " ") { + rec_lst[i][0][0] = Right(rec_lst[i][0][0], (rec_lst[i][0][0].length - 1)); + } + if (Left(rec_lst[i][0][0],1) == " ") { + rec_lst[i][0][0] = Right(rec_lst[i][0][0], (rec_lst[i][0][0].length - 1)); + } + + rec_lst[i][1] = (x[i].getElementsByTagName("enclosure")[0].getAttribute('url')); + rec_lst[i][2] = ""; + rec_lst[i][3] = ""; + rec_lst[i][4] = ""; + rec_lst[i][5] = ""; + rec_lst[i][6] = (x[i].getElementsByTagName("link")[0].childNodes[0].nodeValue); + rec_lst[i][7] = 0; + rec_lst[i][8] = 0; + } + + rec_lst.sort(); + for (var i=0;i<x.length;i++) { + recTitl[i] = rec_lst[i][0]; + recLink[i] = rec_lst[i][1]; + recDesc[i] = rec_lst[i][2]; + recDura[i] = rec_lst[i][3]; + recStrt[i] = rec_lst[i][4]; + rec_New[i] = rec_lst[i][5]; + recGUID[i] = rec_lst[i][6]; + recChan[i] = rec_lst[i][7]; + recProt[i] = rec_lst[i][8]; + } + + + recProt[i] = 1; +} else if (get_recordings == 0) { + // get recordings from restfulapi + xmlhttp=new XMLHttpRequest(); + xmlhttp.open("GET",(server_ip + RestFulAPI + "/recordings.xml?" + new Date().getTime()),false); + xmlhttp.send(); + xmlDoc=xmlhttp.responseXML; + var x=xmlDoc.getElementsByTagName("recording"); + nrMedia = x.length - 1; + recTitl.length = 0; + rec_lst.length = 0; + + if (UseNewReclist) { + for (var i=0;i<x.length;i++) + { + rec_lst[i] = new Array(); + for (var yy=0;yy<9;yy++) { rec_lst[i][yy] = new Array(); } + rec_lst[i][0] = x[i].getElementsByTagName("param")[1].childNodes[0].nodeValue; + rec_lst[i][0] = rec_lst[i][0].split("~"); + rec_lst[i][1] = x[i].getElementsByTagName("param")[2].childNodes[0].nodeValue; + rec_lst[i][2] = x[i].getElementsByTagName("param")[13].textContent; + rec_lst[i][3] = x[i].getElementsByTagName("param")[8].childNodes[0].nodeValue; + rec_lst[i][4] = x[i].getElementsByTagName("param")[14].childNodes[0].nodeValue; + rec_lst[i][5] = x[i].getElementsByTagName("param")[4].childNodes[0].nodeValue; + rec_lst[i][6] = x[i].getElementsByTagName("param")[0].childNodes[0].nodeValue; + //Get channel number from recordings, shows right names only if server & client use same channel order + recDummy = rec_lst[i][1].split("."); + recDummy = recDummy[(recDummy.length-2)].split("-"); + rec_lst[i][7] = recDummy[0] + "\uE003-\uE003" + channelsnames[(recDummy[0])]; + rec_lst[i][8] = protChn[Number(Left((recDummy[0] / 1000),1))]; } + + //Get channel number from recordings + rec_lst.sort(); + for (var i=0;i<x.length;i++) { + recTitl[i] = rec_lst[i][0]; + recLink[i] = rec_lst[i][1]; + recDesc[i] = rec_lst[i][2]; + recDura[i] = rec_lst[i][3]; + recStrt[i] = rec_lst[i][4]; + rec_New[i] = rec_lst[i][5]; + recGUID[i] = rec_lst[i][6]; + recChan[i] = rec_lst[i][7]; + recProt[i] = rec_lst[i][8]; + } + recProt[i] = 1; + } else { + + // old recordings list function + // also used for media listing + + for (var i=0;i<x.length;i++) { + recTitl[i] = (x[i].getElementsByTagName("param")[1].childNodes[0].nodeValue); + recTitl[i] = recTitl[i].split("~"); + recLink[i] = (x[i].getElementsByTagName("param")[2].childNodes[0].nodeValue); + recDesc[i] = (x[i].getElementsByTagName("param")[13].childNodes[0].nodeValue); + recDura[i] = (x[i].getElementsByTagName("param")[8].childNodes[0].nodeValue); + recStrt[i] = (x[i].getElementsByTagName("param")[14].childNodes[0].nodeValue); + rec_New[i] = (x[i].getElementsByTagName("param")[4].childNodes[0].nodeValue); + recGUID[i] = (x[i].getElementsByTagName("param")[0].childNodes[0].nodeValue); + //Get channel number from recordings + recDummy = recLink[i].split("."); + recDummy = recDummy[(recDummy.length-2)].split("-"); + recChan[i] = recDummy[0] + "\uE003-\uE003" + channelsnames[(recDummy[0])]; + recProt[i] = protChn[Number(Left((recDummy[0] / 1000),1))]; + } + // try to fix display double entries in the last directory. (Only shown for some time after deleting files, should be fixed now) recProt[i] = 1; + } + } //end of get_recordings @@ -3892,6 +3993,7 @@ if (get_marks==1) { function setResume() { +if (get_recordings == 1) { try { position += (mediaPlayer.getPosition()/1000) var xmlhttp = new XMLHttpRequest(); @@ -3901,11 +4003,12 @@ try { } catch(e) { alert("Setting Resume problem: " + e); } - +} } function getResume() { position = 0; +if (get_recordings == 1) { try { var xmlhttp = new XMLHttpRequest(); var i = 0; @@ -3917,11 +4020,12 @@ try { } catch(e) { alert("Getting Resume problem: " + e); } - +} } function setResumeNull() { +if (get_recordings == 1) { try { var xmlhttp = new XMLHttpRequest(); xmlhttp.open("POST", server_ip + recServ + "/setResume.xml?guid=" + recGUID[currMed] + "&resume=0", false); @@ -3930,7 +4034,7 @@ try { } catch(e) { alert("Setting Resume problem: " + e); } - +} } function reccmds(option) { @@ -3968,6 +4072,7 @@ try { } function DelRec() { +if (get_recordings == 1) { if (osdepginfo.style.opacity == 1) {osdepginfo.style.opacity = 0;} try { //popup for confirm @@ -3978,6 +4083,7 @@ try { alert("Delete Recordings problem: " + e); } } +} function DelRec2() { try { diff --git a/settings.js b/settings.js index 9512a23..b0730bf 100644 --- a/settings.js +++ b/settings.js @@ -2,7 +2,7 @@ // Default settings // -var Version = "0.24"; +var Version = "0.25.2"; server_ip_array = new Array("http://192.168.1.15","http://192.168.3.15","http://easyvdr","http://192.168.3.100","http://192.168.178.19","http://192.168.1.21","http://192.168.2.100","http://192.168.178.52"); @@ -17,7 +17,7 @@ lang_prio = new Array("dut,eng,und","ger,deu,eng","eng,und","fre,fra,eng"); var subs_prio = "dut,eng"; //Subtitle prio var get_timer = 1; // gettimersserver 1 = smarttvweb, 0 = restfulapi -var get_recordings = 1; // getrecordings 1 = smarttvweb, 2 = streamdev (not working yet) +var get_recordings = 1; // getrecordings 0 = restfulapi, 1 = smarttvweb, 2 = streamdev (not working yet) var UseNewReclist = 1 ; //use new recordingslist function |