I'm trying to use the index number in the playlist to highlight the currently playing song on a page. Here is my JS:
function itemMonitorPlaying(obj)
{
var current_song = 'song'+player.getPlaylistItem().index;
if (gid(current_song) == current_song) {
document.getElementById('song'+player.getPlaylistItem().index).style.backgroundColor="#cccccc";
}
};And here is my PHP:
<tr id="song<? echo ($i + 0); ?>" class="lined sectiontableentry<? echo $k; ?>" >
I'm not sure what I'm doing wrong but I sure would appreciate some help.
Nick
index is not a property of the object returned by getPlaylistItem().
Capture the event:
jwplayer().onPlaylistItem(function(event) {var current_song = 'song'+event.index;
.....
})