Page 1 of 1

vlc plugin don't play entire song in playlist .

Posted: 24 Jun 2011 16:56
by RamyRew
I try to create music page using php & javascript.

first of all I add 01.mpg and 02.mpg to playlist and then click play. when song(01.mpg) finished. vlc don't start to play 02.mpg.
when I use "vlc.playlist.items.count" to check the number of song in playlist. It shows "2" that mean vlc plugin don't play 2rd song in playlist.

this is my code.

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2" width="640" height="480" id="vlc" autoplay="yes" loop="yes"> </embed> <script language="Javascript"> var vlc = document.getElementById("vlc"); //var currSongLength; /////////// /////////////////////// function getLength() { var vlc = document.getElementById("vlc"); var length=vlc.input.length; alert (length); } ///MY function getTotal() { var vlc = document.getElementById("vlc"); //var total=vlc.playlist.itemCount; var total=vlc.playlist.items.count; alert(total); } //setInterval('getLength()', 5000); </script> <a href="#" onclick="javascript:vlc.playlst.clear()">Clear</a> <a href="#" onClick="javascript:vlc.playlist.add('01.mpg');">Add</a> <a href="#" onClick="javascript:vlc.playlist.add('02.mpg');">Add2</a> <a href="#" onClick="javascript:vlc.playlist.play();">Play</a> <a href="#" onClick="javascript:getTotal();">Total</a> <a href="#" onClick="javascript:vlc.playlist.next();">Next</a> <a href="#" onClick="javascript:getLength();">Get Length</a><br/> </body> </html>

Re: vlc plugin don't play entire song in playlist .

Posted: 17 Aug 2011 18:50
by darius
Thanks for your code, just tested and it started to work for me Firefox + plugin.

Re: vlc plugin don't play entire song in playlist .

Posted: 10 Nov 2011 05:44
by Beefster
I try to create music page using php & javascript.

first of all I add 01.mpg and 02.mpg to playlist and then click play. when song(01.mpg) finished. vlc don't start to play 02.mpg.
when I use "vlc.playlist.items.count" to check the number of song in playlist. It shows "2" that mean vlc plugin don't play 2rd song in playlist.

this is my code.

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2" width="640" height="480" id="vlc" autoplay="yes" loop="yes"> </embed> <script language="Javascript"> var vlc = document.getElementById("vlc"); //var currSongLength; /////////// /////////////////////// function getLength() { var vlc = document.getElementById("vlc"); var length=vlc.input.length; alert (length); } ///MY function getTotal() { var vlc = document.getElementById("vlc"); //var total=vlc.playlist.itemCount; var total=vlc.playlist.items.count; alert(total); } //setInterval('getLength()', 5000); </script> <a href="#" onclick="javascript:vlc.playlst.clear()">Clear</a> <a href="#" onClick="javascript:vlc.playlist.add('01.mpg');">Add</a> <a href="#" onClick="javascript:vlc.playlist.add('02.mpg');">Add2</a> <a href="#" onClick="javascript:vlc.playlist.play();">Play</a> <a href="#" onClick="javascript:getTotal();">Total</a> <a href="#" onClick="javascript:vlc.playlist.next();">Next</a> <a href="#" onClick="javascript:getLength();">Get Length</a><br/> </body> </html>
Not really sure what Darius is talking about (the previous poster is clearly asking for help), but I was curious to know if this issue has been resolved at all. I'm having the same annoying issue as Ramy here. The audio in my playlist stops about 30 seconds in and I can't, for the life of me, figure out why. Not sure if my computer speakers are on the fritz or what? Does anyone have a solution to this issue? It would be sincerely appreciated. Maybe someone can PM me with a solution? The code that Ramy posted is very similar to the one that I've observed. Thanks, all! Sorry for posting on here so late. :(