module M3U8
Overview
This M3U8
module provides functionality for working with m3u8 playlists in HTTP Live Streaming (HLS).
In HLS, a Playlist
can be one of two types:
- A Master Playlist, which defines a set of Variant Streams using tags.
- A Media Playlist, which lists individual media segments.
The following tags and their corresponding classes or properties are supported:
Basic Tags:
EXTM3U
: Represents the start of a playlist (handled by thePlaylist
class).EXT-X-VERSION
: Indicates the protocol compatibility version (Playlist#version
).
Media Playlist Tags:
EXT-X-TARGETDURATION
: The maximum segment duration (Playlist#target
).EXT-X-MEDIA-SEQUENCE
: The sequence number of the first segment (Playlist#sequence
).EXT-X-DISCONTINUITY-SEQUENCE
: The discontinuity sequence number (Playlist#discontinuity_sequence
).EXT-X-ENDLIST
: Indicates that no more segments will be added (Playlist.footer
).EXT-X-PLAYLIST-TYPE
: Specifies the playlist type (e.g., VOD or EVENT;Playlist#type
).EXT-X-I-FRAMES-ONLY
: Marks an I-frame only playlist (Playlist#iframes_only
).EXT-X-ALLOW-CACHE
: Indicates whether caching is allowed (Playlist#cache
, deprecated in protocol version 7).
Media Segment Tags:
EXTINF
: Provides segment duration and an optional comment (SegmentItem
).EXT-X-BYTERANGE
: Specifies a sub-range of a media segment (ByteRange
).EXT-X-DISCONTINUITY
: Marks a discontinuity between segments (DiscontinuityItem
).EXT-X-KEY
: Contains encryption key attributes (KeyItem
).EXT-X-MAP
: Specifies the media initialization section (MapItem
).EXT-X-PROGRAM-DATE-TIME
: Associates an absolute date and time with a segment (TimeItem
).EXT-X-DATERANGE
: Associates a date range with a set of attributes (DateRangeItem
).
Master Playlist Tags:
EXT-X-MEDIA
: Specifies alternative renditions (MediaItem
).EXT-X-STREAM-INF
: Defines a Variant Stream (PlaylistItem
withPlaylistItem#iframe
set to false).EXT-X-I-FRAME-STREAM-INF
: Defines an I-frame only Variant Stream (PlaylistItem
withPlaylistItem#iframe
set to true).EXT-X-SESSION-DATA
: Contains session-level metadata (SessionDataItem
).EXT-X-SESSION-KEY
: Contains session-level encryption key attributes (SessionKeyItem
).
Common Tags (Applicable to both Media and Master Playlists):
EXT-X-INDEPENDENT-SEGMENTS
: Indicates that each segment can be decoded independently (Playlist#independent_segments
).EXT-X-START
: Specifies the preferred start point for playback (PlaybackStart
).
Included Modules
- M3U8::Protocol
Defined in:
m3u8.crm3u8/byte_range.cr
m3u8/codecs.cr
m3u8/concern.cr
m3u8/date_range_item.cr
m3u8/discontinuity_item.cr
m3u8/encryptable.cr
m3u8/error.cr
m3u8/key_item.cr
m3u8/map_item.cr
m3u8/media_item.cr
m3u8/parser.cr
m3u8/playback_start.cr
m3u8/playlist.cr
m3u8/playlist_item.cr
m3u8/protocol.cr
m3u8/scanner.cr
m3u8/segment_item.cr
m3u8/session_data_item.cr
m3u8/session_key_item.cr
m3u8/time_item.cr
m3u8/version.cr
Constant Summary
-
VERSION =
"1.0.2"