Go
Not registered? Sign up!

Play specific file from playlist?

Google Translate
2 posts | return to the Feature Suggestions forum | get the rss feed for this thread

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);
          }
        }
      };

Add a reaction

You can also return to the category or try this search for related threads.


 

Search the Forums

Go

Support

Support Here are some helpful links to learn more about the JW Player™:

Monetize Your Video

Monetize Your Video Earn money with ads from LongTail's AdSolution. Watch our demos and sign up now!

Why Buy a License?

Why Buy a License? 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.