]> git.sesse.net Git - vlc/commitdiff
mozilla test.html still used some old vlc.playlist calls that are depreceated.
authorJean-Paul Saman <jpsaman@videolan.org>
Mon, 20 Apr 2009 20:28:20 +0000 (22:28 +0200)
committerJean-Paul Saman <jpsaman@videolan.org>
Tue, 5 May 2009 09:41:43 +0000 (11:41 +0200)
These calls have been replaced by vlc.playlist.items.* calls.

projects/mozilla/test.html

index 702b3d11153ec66c4e5732c6c4675401599e040a..c618e30e37d7344a4396a46d7ff052cc22f483a9 100644 (file)
@@ -153,7 +153,7 @@ Insert Slider widget
 <TR><TD>Playlist:\r
 <INPUT type=button value="Prev" onClick='getVLC("vlc").playlist.prev();'>\r
 <INPUT type=button value="Next" onClick='getVLC("vlc").playlist.next();'>\r
-<INPUT type=button value="Clear All" onClick='getVLC("vlc").playlist.clear(); doItemCount();'>\r
+<INPUT type=button value="Clear All" onClick='doPlaylistClearAll();'>\r
     Aspect Ratio:\r
     <SELECT readonly onChange='doAspectRatio(this.value)'>\r
       <OPTION value="default">Default</OPTION>\r
@@ -329,7 +329,7 @@ function doItemCount()
     var vlc = getVLC("vlc");\r
     if( vlc )\r
     {\r
-        var count = vlc.playlist.itemCount;\r
+        var count = vlc.playlist.items.count;\r
         document.getElementById("itemCount").value = " Items " + count + " ";\r
     }\r
 }\r
@@ -338,7 +338,21 @@ function doRemoveItem(item)
 {\r
     var vlc = getVLC("vlc");\r
     if( vlc )\r
-        vlc.playlist.removeItem(item);\r
+        vlc.playlist.items.remove(item);\r
+}\r
+\r
+function doPlaylistClearAll()\r
+{\r
+    var vlc = getVLC("vlc");\r
+    if( vlc )\r
+    {\r
+        vlc.playlist.items.clear();\r
+        while( vlc.playlist.items.count > 0)\r
+        {\r
+            // wait till playlist empties.\r
+        }\r
+        doItemCount();\r
+    }\r
 }\r
 \r
 function doMessages()\r
@@ -532,8 +546,8 @@ function doGo(targetURL)
 \r
     if( vlc )\r
     {\r
-        vlc.playlist.clear();\r
-        while( vlc.playlist.itemCount > 0 )\r
+        vlc.playlist.items.clear();\r
+        while( vlc.playlist.items.count > 0 )\r
         {\r
             // clear() may return before the playlist has actually been cleared\r
             // just wait for it to finish its job\r
@@ -546,7 +560,7 @@ function doGo(targetURL)
             vlc.log.verbosity = 1;\r
             vlc.log.messages.clear();\r
             // play MRL\r
-            vlc.playlist.play();\r
+            vlc.playlist.playItem(itemId);\r
             if( monitorTimerId == 0 )\r
             {\r
                 monitor();\r
@@ -583,7 +597,7 @@ function doPlayOrPause()
             vlc.playlist.togglePause();\r
             monitor();\r
         }\r
-        else if( vlc.playlist.itemCount > 0 )\r
+        else if( vlc.playlist.items.count > 0 )\r
         {\r
             // clear the message log and enable error logging\r
             vlc.log.verbosity = 1;\r