Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Play specific file from playlist?

1 reply [Last post]

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.

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