From 32b78254c76ebd9a07ad19edf25f1f0846a33bb8 Mon Sep 17 00:00:00 2001 From: TheTroll Date: Sat, 27 Feb 2010 02:12:43 +0100 Subject: Sessions WIP --- javascript/ajax.js | 14 +++++++------- javascript/functions.js | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'javascript') diff --git a/javascript/ajax.js b/javascript/ajax.js index b9291cf..98006e6 100755 --- a/javascript/ajax.js +++ b/javascript/ajax.js @@ -1,16 +1,16 @@ -function ajax() +function ajax(session) { var xhr=null; - + xhr = new XMLHttpRequest(); //on définit l'appel de la fonction au retour serveur - xhr.onreadystatechange = function() { alert_ajax(xhr); }; - - xhr.open("GET", "streamstatus.php", true); + xhr.onreadystatechange = function() { alert_ajax(xhr, session); }; + + xhr.open("GET", "ram/" + session + "/streamstatus.php", true); xhr.send(null); } -function alert_ajax(xhr) +function alert_ajax(xhr, session) { if (xhr.readyState==4) { @@ -22,7 +22,7 @@ function alert_ajax(xhr) if ( streamstatus == 'error' ) this.location.href = 'error.php'; else - swapPic(); + swapPic(session); } } diff --git a/javascript/functions.js b/javascript/functions.js index c54f44e..b713232 100755 --- a/javascript/functions.js +++ b/javascript/functions.js @@ -46,8 +46,8 @@ function sendForm(formid) { frm.submit(); } -function swapPic() { - document.getElementById('videofeed').src = "ram/stream.m3u8"; +function swapPic(session) { + document.getElementById('videofeed').src = "ram/" +session +"/stream.m3u8"; } function openSelectDate(timer_year,timer_month,timer_day) { -- cgit v1.2.3