onPlayListItem returns previous rather than current item being displayed
My attempt at using onPlayListItem to get info about current item in playlist always returns the previous item! Anyone know what I am doing wrong? My code looks like this:
bc.. function addMedia(mediaUrl,mediaTitle) { var playlist = jwplayer().getPlaylist(); var newItem = { file: mediaUrl, //image: "../plupload/uploads/4d7946b702a1a.jpg", title: mediaTitle }; playlist.push(newItem); jwplayer().load(playlist); }
I don't know what you're doing wrong, but with a v5.5.1641 player (and all previous releases) I always get the correct information for the currently playing track.
Test Page: bc.. http://willswonders.myip.org:8088/HTML5/JW%20Player%20HTML5-Beta3-01.html
If you post a link to your Test Page, perhaps someone can figure out what is wrong; code snippets are *_NOT_* useful.
You can see the problem I am having at the following web page:
http://www.vavavid.com/jwplayer/test.php
Click on the links to add the three photos to the playlist. The alert shows the result of calling this.getPlaylistItem when event onPlaylistItem happens.
When the three photos have been added, click on one of them in the playlist and you will see that the alert shows that the previous item is returned by this.getPlaylistItem and not the item you have just selected.
Any idea why I am getting this strange behaviour? My guess is it is too do with my addMedia function, but I can't spot what I am doing wrong.