Skip to main content
Version: 11.8.0

HLS date ranges on Android

The #EXT-X-DATERANGE tag associates a date range (i.e. a range of time defined by a starting and ending date) with a set of attribute/value pairs. It is a way of providing timed metadata in an HLS manifest. A possible use case is defining timed metadata for interstitial regions such as advertisements, but it can be used for any timed metadata needed by your stream.

Date ranges are not parsed by default. To enable them, set hlsDateRange to true, either on the player configuration (for all sources) or on an individual source.

Once enabled, the player exposes the date ranges as cues on a metadata text track, which you can consume through the text tracks API.

Enabling date ranges

// in the player configuration
val playerConfig = THEOplayerConfig.Builder()
.hlsDateRange(true)
.build()
val theoPlayerView = THEOplayerView(this, playerConfig)

// or in the source description
val typedSource = TypedSource.Builder("https://example.com/example-stream.m3u8")
.hlsDateRange(true)
.build()

Reading date range cues

Date ranges are exposed as cues on a metadata text track. See "How to detect active text track cues" to learn how to listen for those cues.

Resources