HLS Support
HTTP Live Streaming (HLS) enables content delivery using standard web servers and CDNs, making it an efficient solution for distributing STANAG-compliant video-on-demand (VOD) content.
Because HLS is based on MPEG-TS (with MPEG-4 support in recent versions), it is well-suited for STANAG VOD distribution.
The STANAG Player SDK provides support for basic HLS functionality, including playback from local file-based playlists.
HLS Modes
The SDK supports two main HLS scenarios:
-
HLS Video On Demand (Playlist)
Playback from a static.m3u8playlist file representing pre-recorded content. -
HLS Live Streaming
Playback of a continuously updated playlist representing a live broadcast (e.g., low-latency stream recorded via HLS).
On-Demand Mode (VOD)
In Video on Demand (VOD) sessions, all media files for the entire duration of the content are available upfront.
The playlist (index file) is static and contains a complete list of URLs referencing every segment created since the beginning of the presentation.
This allows the client to:
- Access the entire program from start to finish
- Perform trick modes such as seeking and scrubbing
- Replay any portion of the video freely
Example VOD Playlist
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:11
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:10.560000,
#EXT-X-PROGRAM-DATE-TIME:2017-12-03T12:15:16.000+0200
StHls0.ts
#EXTINF:9.760000,
#EXT-X-PROGRAM-DATE-TIME:2017-12-03T12:15:26.560+0200
StHls1.ts
#EXTINF:9.760000,
#EXT-X-PROGRAM-DATE-TIME:2017-12-03T12:15:36.320+0200
StHls2.ts
#EXTINF:9.920000,
#EXT-X-PROGRAM-DATE-TIME:2017-12-03T12:15:46.080+0200
StHls3.ts
#EXTINF:10.200000,
#EXT-X-PROGRAM-DATE-TIME:2017-12-03T12:15:56.000+0200
StHls4.ts
#EXTINF:10.040000,
#EXT-X-PROGRAM-DATE-TIME:2017-12-03T12:16:06.200+0200
StHls5.ts
#EXTINF:10.120000,
#EXT-X-PROGRAM-DATE-TIME:2017-12-03T12:16:16.240+0200
StHls6.ts
#EXTINF:10.200000,
#EXT-X-PROGRAM-DATE-TIME:2017-12-03T12:16:26.360+0200
StHls7.ts
#EXTINF:9.960000,
#EXT-X-PROGRAM-DATE-TIME:2017-12-03T12:16:36.560+0200
StHls8.ts
#EXTINF:9.600000,
#EXT-X-PROGRAM-DATE-TIME:2017-12-03T12:16:46.520+0200
StHls9.ts
#EXTINF:10.200000,
#EXT-X-PROGRAM-DATE-TIME:2017-12-03T12:16:56.120+0200
StHls10.ts
#EXTINF:10.200000,
#EXT-X-PROGRAM-DATE-TIME:2017-12-03T12:17:06.320+0200
StHls11.ts
#EXTINF:9.600000,
#EXT-X-PROGRAM-DATE-TIME:2017-12-03T12:17:16.520+0200
StHls12.ts
#EXTINF:10.160000,
#EXT-X-PROGRAM-DATE-TIME:2017-12-03T12:17:26.120+0200
StHls13.ts
#EXTINF:10.200000,
#EXT-X-PROGRAM-DATE-TIME:2017-12-03T12:17:36.280+0200
StHls14.ts
#EXTINF:9.600000,
#EXT-X-PROGRAM-DATE-TIME:2017-12-03T12:17:46.480+0200
StHls15.ts
#EXTINF:10.040000,
#EXT-X-PROGRAM-DATE-TIME:2017-12-03T12:17:56.080+0200
StHls16.ts
#EXTINF:10.080000,
#EXT-X-PROGRAM-DATE-TIME:2017-12-03T12:18:06.120+0200
StHls17.ts
#EXTINF:10.160000,
#EXT-X-PROGRAM-DATE-TIME:2017-12-03T12:18:16.200+0200
StHls18.ts
#EXTINF:10.080000,
#EXT-X-PROGRAM-DATE-TIME:2017-12-03T12:18:26.360+0200
StHls19.ts
#EXTINF:9.960000,
#EXT-X-PROGRAM-DATE-TIME:2017-12-03T12:18:36.440+0200
StHls20.ts
#EXT-X-ENDLIST
The EXT-X-ENDLIST tag indicates that no more media files will be added to the playlist file.
Live Playlist mode.
For live sessions, the index file is updated by removing media URIs from the file as new media files are created and made available.
Note: The EXT-X-ENDLIST tag is not present in the Live playlist, indicating that new media files will be added to the index file as they become available.
#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:1
#EXTINF:10,
StHls0.ts
#EXTINF:10,
StHls1.ts
#EXTINF:10,
StHls2.ts
#EXTINF:10,
StHls3.ts
#EXTINF:10,
StHls4.ts
SDK operation with HLS.
The SDK works seamlessly with HLS. All you have to do is to provide a manifest file (with extension .m3u8) instead of TS file. In addition to the standard HTTP support, the StCore SDK allows local file playback (no need for the http server). The file location is relative to the manifest (index) file.