vlc plugin don't play entire song in playlist .
Posted: 24 Jun 2011 16:56
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.
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>