Forum Moderators: open
I also have a "Now Playing" Div that listens for a new file to start and displays the filename. So it would display, "Now Playing: video.flv" or something like that.
My question is, is there a way to write some Javascript inline that will strip the extension off of the video's file name?
Here's the 'now playing' script:
<script type="text/javascript">
var player = null;
function playerReady(obj)
{
player = gid(obj.id);
displayFirstItem();
};
function itemMonitor(obj)
{
gid('nowplaying').innerHTML = '<span class="style1">Now Playing: ' + player.getPlaylist()[obj.index].file + '</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>