[vlc-devel] commit: mozilla test.html still used some old vlc. playlist calls that are depreceated. (Jean-Paul Saman )

git version control git at videolan.org
Tue May 5 11:48:47 CEST 2009


vlc | branch: master | Jean-Paul Saman <jpsaman at videolan.org> | Mon Apr 20 22:28:20 2009 +0200| [55fbd58c6a9110b319389d4103ae6687c257ac0f] | committer: Jean-Paul Saman 

mozilla test.html still used some old vlc.playlist calls that are depreceated.

These calls have been replaced by vlc.playlist.items.* calls.

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

 projects/mozilla/test.html |   28 +++++++++++++++++++++-------
 1 files changed, 21 insertions(+), 7 deletions(-)

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




More information about the vlc-devel mailing list