
display title of currently playing item
Hello,
I have been trying to ...Hello,
I have been trying to get the title of the currently playing item to display, and cannot.
Here is my code. The display script, got from; a suggestion from Lefty on another forum.
here is my code. The playlist plays, but I cannot get the currently playing item to display.
Cheers! Ricco
-----
bc.. <html>
webulite.com media player
<script type="text/javascript" src="http://webulite.com/media/swfobject.js"></script>
<script type="text/javascript">
function createPlayer() {
var xxx = 'http://webulite.com/media/playlist.xml?t='+Math.round(1000 * Math.random())
var flashvars = {
file: xxx,
autostart:"true",
playlist:"none",
repeat:"always",
volume:"100"
}
var params = {
allowfullscreen:"true",
allowscriptaccess:"always"
}
var attributes = {
id:"player1",
name:"player1"
}
swfobject.embedSWF("http://webulite.com/media/player.swf", "placeholder1", "250", "20", "9.0.115", false, flashvars, params, attributes);
}
</script>
<script type="text/javascript">
var player = null;
function playerReady(obj)
{
player = gid(obj.id);
displayFirstItem();
};
function itemMonitor(obj)
{
gid('nowplaying').innerHTML = 'Now Playing: <span>' + player.getPlaylist()[obj.index].title + '</span>';
};
function displayFirstItem()
{
if(player.getPlaylist())
{
itemMonitor({index:0});
player.addControllerListener('ITEM', 'itemMonitor');
}
else
{
setTimeout("displayFirstItem()",100);
}
};
function gid(name)
{
return document.getElementById(name);
};
</script>
</head>
<body onload="createPlayer();">
<div id="placeholder1"></div>
<p>
<div id="nowplaying"></div>
</body>
</html>