
Start a playlist at a specific index and calling 'onPlaylistItem' only once
Lets say I have a playlist with multiple items. Whenever a user loads my page, I want to load the playlist, and I want to start the playlist at a specific index (that is maybe submitted by an query parameter).
Well, I could do this:
var player = jwplayer('player').setup({
playlist: somePlaylistArray,
...
...
}).playlistItem(someVarIndicatingTheDesiredIndex)
This works, but the problem lies in the 'onPlaylistItem' callback. This callback is now fired TWICE: once for index 0, and once for the desired index.
I have logic in this callback that I ONLY want to execute once so I'm getting into trouble with this. I don't want to use some stupid 'var firstrun = true' mechanism for obvious reasons.
Any suggestions would be appreciated,