Tracksessions

Tracksessions represent playback sequences of tracks (media files). To perform any playback operation, a player must have an active tracksession so it knows which track is currently selected for playback and the relative order of the tracks.

A player must monitor the current track selection so it knows which media file the user wants to play and so it can provide them with information about any media content being played or scheduled to be played next. Knowing the playback order is necessary to update the current track information when carrying out operations such as next or previous.

Each tracksession object stores only a tracksession ID (to distinguish it from other tracksessions) and the number of tracks in the playback sequence. In this release, this object doesn't need to reference the individual tracks because players support only one tracksession at a time. This design could change in future releases to support multiple tracksessions per player.

With the current design, when a client creates a tracksession based on a media node ID, the tracksession becomes the only active one for the player. Clients must then pass this ID in when retrieving either the tracks in the tracksession or the metadata of the current track, and when selecting a new track to play. The tracksession object as well as the index (playback position), media node object, and metadata of the current track are stored in the player's state information, which clients can obtain through mm-player commands.