Oct. 15, 2009Jan
Is it possible to tell what file to play from the playlist other than the order in the XML file?
I need to play a specific file, index number would be fine.
Oct. 15, 2009Roger Berry
The playlist is an object with track objects in it, each of which has an index number. So it seems that index number would be the same as the order in the playlist.
How about something else, like title. Grab the playlist from the player, look through it until you find a match, play that item.
API Documentation. http://developer.longtailvideo.com/trac/wiki/FlashApi
Lots of code already posted on the Forum. Google "site:longtailvideo.com play item by title"
Something like this. // play item by Title
function playIt(playItem)
{
playlist = player.getPlaylist();
for(var j in playlist)
{
if(playItem == playlist[j].title)
{
player.sendEvent('ITEM', j);
}
}
};
Here are some helpful links to learn more about the JW Player™:
Earn money with ads from LongTail's AdSolution. Watch our demos and sign up now!
If you don’t buy a commercial license, you cannot use a JW Player™ on (i) a site that has ads; (ii) a corporate site; or a (iii) CMS. Our licenses are very inexpensive, so what are you waiting for? Buy a license today.