Commit 11c280f3 authored by Mark Hassman's avatar Mark Hassman Committed by Ilkka Ollakka

http-interface: - fixed large playlist loading failure

large playlists can take >10 seconds to load. since the xmlhttp object is
common within the page, multiple /status.xml requests would occurr (1 per sec)
before the playlist was loaded cancelling the /playlist.xml request.. i moved
the xmlhttp request object to a global variable. it's now checked to see if
there are any outstanding/active requests before submitting a new request. -
improved playlist display of large playlists.
Signed-off-by: default avatarIlkka Ollakka <ileoo@videolan.org>
parent c8ab1739
......@@ -28,6 +28,7 @@
var old_time = 0;
var pl_cur_id;
var albumart_id = -1;
var req = null;
/**********************************************************************
* Slider functions
......@@ -389,7 +390,10 @@ function hotkey( str )
}
function update_status()
{
if( req == null || req.readyState == 0 || req.readyState == 4 )
{
loadXMLDoc( 'requests/status.xml', parse_status );
}
}
function update_playlist()
{
......@@ -540,6 +544,8 @@ function parse_playlist()
var answer = req.responseXML.documentElement;
var playtree = document.getElementById( 'playtree' );
var pos = document.createElement( "div" );
pos.style.height = document.body.clientHeight - 100 + "px";
pos.style.overflow = "auto";
var pos_top = pos;
var elt = answer.firstChild;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment