This technology is growing roots of television equipment and software that allows you to run under the control of a video operator. We use the updated form of playlists. The practice shows that users are more pleasant to watch predefined shows and not to search video manually.
Instead of server-side playlists today recommended to use client-side playlists because of the following problems:
- inability to use targeted ads;
- inability to use stats for ads with adriver and other similar networks;
- complexity of creating a multibitrate broadcasting: different files can contain different number of different bitrates;
- technically unreasonably difficult to create rewinding, but rewinding is one of the major advantages of online broadcasting compared to classic broadcasting;
- pause is too complex to implement.
In fact, the inability to implement an adequate system of accounting advertising nullifies all desire to use server-side playlists.
If you still want to use server-side playlists, then flussonic have such feature. First of all you should create a playlist file, let it be in the directory /tmp/playlist.txt:
The config file should contain the following lines:
http 80; stream playlist1 playlist:///tmp/playlist.txt; stream playlist2 playlist://http://host/playlist.txt; file vod /var/movies;
If directory /var/movies contain video1.mp4 and video2.mp4, their playback will start immediately and will be looped.
Playlist consists of URLs and control commands:
#EXT-X-MEDIA-SEQUENCE:20 #EXT-X-PROGRAM-DATE-TIME:2013-02-12T12:58:08Z vod/video1.mp4 #EXTINF:64, vod/video2.mp4
Flussonic support the following list of control commands:
- #EXT-X-MEDIA-SEQUENCE number of the first element. You can use it for valid rotation and updating of a playlist;
- #EXTINF duration in seconds of playing playlist element. You can use it for embedding live;
- #EXT-X-UTC unix timestamp of the time when you need to start playing a playlist element
start time for an element, in ISO 8601 format:
After each file playlist will be re-readed. You must consider the following rules for processing playlists:
- If the option EXT-X-MEDIA-SEQUENCE is specified, it remembers the last number, and playback continues from the next number after rereading. Ie the contents of the new playlist can be anything, and it will be synced from the next number. If the new playlist contain only numbers less than last number, playlist file will be rereaded every second, waiting for the correct number;
- If the option EXT-X-MEDIA-SEQUENCE is not specified and the text file is not changed, then the next element will be played. If the file is changed, playback starts from the beginning.