summaryrefslogtreecommitdiff
path: root/javascript
diff options
context:
space:
mode:
authorAlib <aliboba@free.fr>2010-02-25 00:30:24 +0100
committerAlib <aliboba@free.fr>2010-02-25 00:30:24 +0100
commit0f2b4641c3c8f4fbb9f4d48d34a6cd06fc64e13b (patch)
treeed000ac16f0b74acba516653f4cad4857b51d579 /javascript
parentdabff11bcdaf22ae9f2df6dd50aef866cfdbbc42 (diff)
downloadistreamdev-0f2b4641c3c8f4fbb9f4d48d34a6cd06fc64e13b.tar.gz
istreamdev-0f2b4641c3c8f4fbb9f4d48d34a6cd06fc64e13b.tar.bz2
ajax based m3u playlist generation
Diffstat (limited to 'javascript')
-rwxr-xr-xjavascript/ajax.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/javascript/ajax.js b/javascript/ajax.js
index 7ccafe2..a33bdf9 100755
--- a/javascript/ajax.js
+++ b/javascript/ajax.js
@@ -25,3 +25,32 @@ function alert_ajax(xhr)
swapPic();
}
}
+
+function playmusic(path,name)
+{
+ var xhr=null;
+
+ xhr = new XMLHttpRequest();
+ //on définit l'appel de la fonction au retour serveur
+ xhr.onreadystatechange = function() { openpls(xhr); };
+
+ xhr.open("GET", "genplaylist.php?path=" + path + "&name=" + name, true);
+ xhr.send(null);
+
+}
+
+function openpls(xhr)
+{
+ if (xhr.readyState==4)
+ {
+ var docXML= xhr.responseXML;
+ var streamstatus = null;
+ var items = docXML.getElementsByTagName("m3u")
+
+ streamstatus = items.item(0).firstChild.data;
+ if ( streamstatus == 'error' )
+ this.location.href = 'error.php';
+ else
+ document.player.Play()
+ }
+}