[vlc-commits] commit: http-interface: - fixed large playlist loading failure ( Mark Hassman )

git at videolan.org git at videolan.org
Wed Jul 28 20:01:30 CEST 2010


vlc | branch: master | Mark Hassman <mark at hassman.org> | Wed Jul 28 12:02:23 2010 -0400| [11c280f342df4e6ffc57e041b01f332419ab3a3f] | committer: 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: Ilkka Ollakka <ileoo at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=11c280f342df4e6ffc57e041b01f332419ab3a3f
---

 share/http/js/functions.js |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/share/http/js/functions.js b/share/http/js/functions.js
index fcd6c7a..f259542 100644
--- a/share/http/js/functions.js
+++ b/share/http/js/functions.js
@@ -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()
 {
-    loadXMLDoc( 'requests/status.xml', parse_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;
             



More information about the vlc-commits mailing list