There are four kinds of playlists in Flowplayer:
1 An internal playlist is simply an array of clip objects that are played in sequence.
2 A RSS playlist is a playlist that is supplied in the Media RSS format. When this XML-based playlist configuration file is supplied to Flowplayer, it works just like an internal playlist. Note: rss playlists are not supported by the ipad plugin.
3 An instream playlist is an array of clip objects that are defined for a clip. The clips in an instream playlist can be played before, in the middle or after the main video starts. Instream playlists are mainly used in advertisement configurations.
Here is an internal playlist configuration in its simplest form:
Playlist clips can also be complex objects with many different configuration properties:
The common clip is an important concept in Flowplayer. It specifies common properties for every clip in the playlist. The common clip is configured by defining a clip object outside the playlist. Here is an example:
These common properties are applied to all clips and they can be overridden by the entries in the playlist. (The same applies for event properties, described in the events document)
If you define a clip object without playlists, then the playlist is
automatically created on your behalf. The playlist will have one entry
and its properties become the properties of the common clip and the
url is made the first (and only) playlist entry. When
modifying the playlist programmatically using the
all the common clip properties are preserved.
Here is an example playlist where each entry in the list is in a different format:
Here is the configuration for the above playlist:
Show this demo as a standalone version
RSS playlists were introduced in Flowplayer version 3.1.1. You can supply a RSS file that uses the Yahoo Media extensions and the player will load it and build the playlist based on it. Here is a sample RSS file with comments about how the information is mapped to playlist clips.
The following table lists how the RSS data is mapped to playlist clips:
|RSS XML Tag||Tag Attribute||Clip Property|
Custom property named
Custom properties in RSS
In addition to what is listed above, the file can contain additional elements and attributes. These are all mapped to Clip custom properties. Here is an example modeled after an imaginary advertising solution:
Flowplayer specific clip properties in RSS
It's possible to supply Flowplayer specific clip properties in the Media
RSS file. This is done using a
fp namespace and
media:thumbnail element is also supported. By using it you can include a splash image
for a video or a audio clip. You can use
fp:thumbnail to set flowplayer specific properties
for the thumbnail. The following example shows these
fp namespace elements.
Instream playlists were introduced in Flowplayer version 3.1.1. These playlists are defined for an individual clip and not for the configuration root. The clips in an instream playlist can be played before, in the middle and after the main clip so that the clip's index property is not changed. The clips inside the instream playlist are called instream clips. Typically these instream clips are mainly used for advertisement purposes.
You can supply a
position property for the instream clip which
specifies when the clip starts in relation to the parent clip. For
position: 10 means that the instream clip will start at the
10th second of the parent clip. If the position is
0, then the clip
will be played before the parent clip as a preroll and if the position
-1 then the instream clip will be played after the main clip as a
During the time the instream clip is playing the parent clip will be paused. If you use progressive download or pseudostreaming, it will continue loading the parent clip in the background. With RTMP, the loading will be limited to the buffer size. When the instream clip ends, the parent clip will resume from the position where it had left off.
You can use instream clips of any and all of these media types (audio, video, images). Additionally, you can mix different streaming providers, so that the main clip and its instream clips are supplied by different providers.
The following demo has three instream clips specified for the
5 (middle) and
-1 (end). You can see
the configuration below the demo.
Here is the configuration for the example shown above.
View this demo as a standalone version
Take a look at a more advanced instream playlist example. The Flowplayer API can also be used to play instream clips. Here is a mid-roll advertising demo that plays instream clips programmatically via the API.
Clips and events
In this section we assume that you have a basic understanding of Flowplayer events.
When an instream clip is started, the main clip is paused; an
onPause event will be fired and the instream clip plays just like a
regular clip. The instream clip will fire the
onStart events just like a normal clip. The
index property of
the instream clip has the same value as its parent clip. If you have
an event listener, you can differentiate between main and instream
clips by using the
isInStream property as follows:
When an instream clip finishes, the main video is resumed and an
onResume event is fired.