idnits 2.17.1 draft-pantos-hls-rfc8216bis-10.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- -- The document has an IETF Trust Provisions (28 Dec 2009) Section 6.c(i) Publication Limitation clause. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 5 instances of lines with non-RFC2606-compliant FQDNs in the document. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (November 8, 2021) is 899 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Informational ---------------------------------------------------------------------------- ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 7230 (Obsoleted by RFC 9110, RFC 9112) Summary: 2 errors (**), 0 flaws (~~), 2 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Informational R. Pantos, Ed. 3 Internet-Draft Apple Inc. 4 Obsoletes: 8216 (if approved) November 8, 2021 5 Intended status: Informational 6 Expires: May 12, 2022 8 HTTP Live Streaming 2nd Edition 9 draft-pantos-hls-rfc8216bis-10 11 Abstract 13 This document obsoletes RFC 8216. It describes a protocol for 14 transferring unbounded streams of multimedia data. It specifies the 15 data format of the files and the actions to be taken by the server 16 (sender) and the clients (receivers) of the streams. It describes 17 version 10 of this protocol. 19 Status of This Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at https://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on May 12, 2022. 36 Copyright Notice 38 Copyright (c) 2021 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (https://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. 48 This document may not be modified, and derivative works of it may not 49 be created, except to format it for publication as an RFC or to 50 translate it into languages other than English. 52 This Informational Internet Draft is submitted as an RFC Editor 53 Contribution and/or non-IETF Document (not as a Contribution, IETF 54 Contribution, nor IETF Document) in accordance with BCP 78 and BCP 55 79. 57 Table of Contents 59 1. Introduction to HTTP Live Streaming . . . . . . . . . . . . . 5 60 2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 5 61 3. Media Segments . . . . . . . . . . . . . . . . . . . . . . . 7 62 3.1. Supported Media Segment Formats . . . . . . . . . . . . . 7 63 3.1.1. MPEG-2 Transport Streams . . . . . . . . . . . . . . 8 64 3.1.2. Fragmented MPEG-4 . . . . . . . . . . . . . . . . . . 8 65 3.1.3. Packed Audio . . . . . . . . . . . . . . . . . . . . 9 66 3.1.4. WebVTT . . . . . . . . . . . . . . . . . . . . . . . 9 67 3.1.5. IMSC Subtitles . . . . . . . . . . . . . . . . . . . 10 68 3.2. Partial Segments . . . . . . . . . . . . . . . . . . . . 11 69 4. Playlists . . . . . . . . . . . . . . . . . . . . . . . . . . 11 70 4.1. Definition of a Playlist . . . . . . . . . . . . . . . . 12 71 4.2. Attribute Lists . . . . . . . . . . . . . . . . . . . . . 13 72 4.3. Variable Substitution . . . . . . . . . . . . . . . . . . 14 73 4.4. Playlist Tags . . . . . . . . . . . . . . . . . . . . . . 15 74 4.4.1. Basic Tags . . . . . . . . . . . . . . . . . . . . . 15 75 4.4.1.1. EXTM3U . . . . . . . . . . . . . . . . . . . . . 15 76 4.4.1.2. EXT-X-VERSION . . . . . . . . . . . . . . . . . . 15 77 4.4.2. Media or Multivariant Playlist Tags . . . . . . . . . 16 78 4.4.2.1. EXT-X-INDEPENDENT-SEGMENTS . . . . . . . . . . . 16 79 4.4.2.2. EXT-X-START . . . . . . . . . . . . . . . . . . . 16 80 4.4.2.3. EXT-X-DEFINE . . . . . . . . . . . . . . . . . . 17 81 4.4.3. Media Playlist Tags . . . . . . . . . . . . . . . . . 18 82 4.4.3.1. EXT-X-TARGETDURATION . . . . . . . . . . . . . . 18 83 4.4.3.2. EXT-X-MEDIA-SEQUENCE . . . . . . . . . . . . . . 19 84 4.4.3.3. EXT-X-DISCONTINUITY-SEQUENCE . . . . . . . . . . 19 85 4.4.3.4. EXT-X-ENDLIST . . . . . . . . . . . . . . . . . . 20 86 4.4.3.5. EXT-X-PLAYLIST-TYPE . . . . . . . . . . . . . . . 20 87 4.4.3.6. EXT-X-I-FRAMES-ONLY . . . . . . . . . . . . . . . 20 88 4.4.3.7. EXT-X-PART-INF . . . . . . . . . . . . . . . . . 21 89 4.4.3.8. EXT-X-SERVER-CONTROL . . . . . . . . . . . . . . 21 90 4.4.4. Media Segment Tags . . . . . . . . . . . . . . . . . 23 91 4.4.4.1. EXTINF . . . . . . . . . . . . . . . . . . . . . 23 92 4.4.4.2. EXT-X-BYTERANGE . . . . . . . . . . . . . . . . . 23 93 4.4.4.3. EXT-X-DISCONTINUITY . . . . . . . . . . . . . . . 24 94 4.4.4.4. EXT-X-KEY . . . . . . . . . . . . . . . . . . . . 24 95 4.4.4.5. EXT-X-MAP . . . . . . . . . . . . . . . . . . . . 26 96 4.4.4.6. EXT-X-PROGRAM-DATE-TIME . . . . . . . . . . . . . 27 97 4.4.4.7. EXT-X-GAP . . . . . . . . . . . . . . . . . . . . 28 98 4.4.4.8. EXT-X-BITRATE . . . . . . . . . . . . . . . . . . 28 99 4.4.4.9. EXT-X-PART . . . . . . . . . . . . . . . . . . . 28 100 4.4.5. Media Metadata Tags . . . . . . . . . . . . . . . . . 29 101 4.4.5.1. EXT-X-DATERANGE . . . . . . . . . . . . . . . . . 29 102 4.4.5.1.1. Mapping SCTE-35 into EXT-X-DATERANGE . . . . 31 103 4.4.5.2. EXT-X-SKIP . . . . . . . . . . . . . . . . . . . 33 104 4.4.5.3. EXT-X-PRELOAD-HINT . . . . . . . . . . . . . . . 34 105 4.4.5.4. EXT-X-RENDITION-REPORT . . . . . . . . . . . . . 35 106 4.4.6. Multivariant Playlist Tags . . . . . . . . . . . . . 36 107 4.4.6.1. EXT-X-MEDIA . . . . . . . . . . . . . . . . . . . 36 108 4.4.6.1.1. Rendition Groups . . . . . . . . . . . . . . 40 109 4.4.6.2. EXT-X-STREAM-INF . . . . . . . . . . . . . . . . 40 110 4.4.6.2.1. Alternative Renditions . . . . . . . . . . . 46 111 4.4.6.3. EXT-X-I-FRAME-STREAM-INF . . . . . . . . . . . . 47 112 4.4.6.4. EXT-X-SESSION-DATA . . . . . . . . . . . . . . . 47 113 4.4.6.5. EXT-X-SESSION-KEY . . . . . . . . . . . . . . . . 48 114 4.4.6.6. EXT-X-CONTENT-STEERING . . . . . . . . . . . . . 49 115 5. Key Files . . . . . . . . . . . . . . . . . . . . . . . . . . 50 116 5.1. Structure of Key Files . . . . . . . . . . . . . . . . . 50 117 5.2. IV for AES-128 . . . . . . . . . . . . . . . . . . . . . 50 118 6. Client/Server Responsibilities . . . . . . . . . . . . . . . 50 119 6.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 50 120 6.2. Server Responsibilities . . . . . . . . . . . . . . . . . 50 121 6.2.1. General Server Responsibilities . . . . . . . . . . . 50 122 6.2.2. Live Playlists . . . . . . . . . . . . . . . . . . . 54 123 6.2.3. Encrypting Media Segments . . . . . . . . . . . . . . 55 124 6.2.4. Providing Variant Streams . . . . . . . . . . . . . . 56 125 6.2.5. Delivery Directives Interface . . . . . . . . . . . . 57 126 6.2.5.1. Playlist Delta Updates . . . . . . . . . . . . . 57 127 6.2.5.2. Blocking Playlist Reload . . . . . . . . . . . . 58 128 6.2.6. Providing Preload Hints . . . . . . . . . . . . . . . 59 129 6.3. Client Responsibilities . . . . . . . . . . . . . . . . . 60 130 6.3.1. General Client Responsibilities . . . . . . . . . . . 60 131 6.3.2. Loading the Media Playlist File . . . . . . . . . . . 61 132 6.3.3. Playing the Media Playlist File . . . . . . . . . . . 62 133 6.3.4. Reloading the Media Playlist File . . . . . . . . . . 63 134 6.3.5. Determining the Next Segment to Load . . . . . . . . 64 135 6.3.6. Decrypting Encrypted Media Segments . . . . . . . . . 65 136 6.3.7. Requesting Playlist Delta Updates . . . . . . . . . . 66 137 6.3.8. Issuing Blocking Requests . . . . . . . . . . . . . . 66 138 7. Content Steering . . . . . . . . . . . . . . . . . . . . . . 67 139 7.1. Steering Manifest . . . . . . . . . . . . . . . . . . . . 67 140 7.2. Steering Query Parameters . . . . . . . . . . . . . . . . 68 141 7.3. Steering Client Responsibilities . . . . . . . . . . . . 69 142 8. Protocol Version Compatibility . . . . . . . . . . . . . . . 70 143 9. Playlist Examples . . . . . . . . . . . . . . . . . . . . . . 72 144 9.1. Simple Media Playlist . . . . . . . . . . . . . . . . . . 72 145 9.2. Live Media Playlist Using HTTPS . . . . . . . . . . . . . 72 146 9.3. Playlist with Encrypted Media Segments . . . . . . . . . 72 147 9.4. Multivariant Playlist . . . . . . . . . . . . . . . . . . 73 148 9.5. Multivariant Playlist with I-Frames . . . . . . . . . . . 73 149 9.6. Multivariant Playlist with Alternative Audio . . . . . . 74 150 9.7. Multivariant Playlist with Alternative Video . . . . . . 74 151 9.8. Session Data in a Multivariant Playlist . . . . . . . . . 75 152 9.9. CHARACTERISTICS Attribute Containing Multiple 153 Characteristics . . . . . . . . . . . . . . . . . . . . . 75 154 9.10. EXT-X-DATERANGE Carrying SCTE-35 Tags . . . . . . . . . . 76 155 9.11. Low-Latency Playlist . . . . . . . . . . . . . . . . . . 76 156 9.12. Content Steering Playlist and Manifest . . . . . . . . . 77 157 10. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 78 158 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 79 159 11.1. vnd.apple.mpegurl . . . . . . . . . . . . . . . . . . . 79 160 11.2. vnd.apple.steering-list . . . . . . . . . . . . . . . . 80 161 12. Security Considerations . . . . . . . . . . . . . . . . . . . 81 162 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 82 163 13.1. Normative References . . . . . . . . . . . . . . . . . . 82 164 13.2. Informative References . . . . . . . . . . . . . . . . . 86 165 Appendix A. Changes from RFC 8216 . . . . . . . . . . . . . . . 86 166 Appendix B. Server Configuration Profiles . . . . . . . . . . . 88 167 B.1. Low-Latency Server Configuration Profile . . . . . . . . 88 168 Appendix C. Low-Latency CDN Tune-in . . . . . . . . . . . . . . 90 169 Appendix D. Interstitials . . . . . . . . . . . . . . . . . . . 91 170 D.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 91 171 D.2. EXT-X-DATERANGE Schema for Interstitials . . . . . . . . 92 172 D.3. Interstitial query parameters . . . . . . . . . . . . . . 94 173 D.4. Client Behavior . . . . . . . . . . . . . . . . . . . . . 95 174 D.5. Example: Interstitial EXT-X-DATERANGE . . . . . . . . . . 95 175 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 96 177 1. Introduction to HTTP Live Streaming 179 HTTP Live Streaming provides a reliable, cost-effective means of 180 delivering continuous and long-form video over the Internet. It 181 allows a receiver to adapt the bit rate of the media to the current 182 network conditions in order to maintain uninterrupted playback at the 183 best possible quality. It supports interstitial content boundaries. 184 It provides a flexible framework for media encryption. It can 185 efficiently offer multiple renditions of the same content, such as 186 audio translations. It offers compatibility with large-scale HTTP 187 caching infrastructure to support delivery to large audiences. It 188 supports low-latency playback at scale. 190 Since its first draft publication in 2009, HTTP Live Streaming has 191 been implemented and deployed by a wide array of content producers, 192 tools vendors, distributors, and device manufacturers. In the 193 subsequent ten years the protocol has been refined by extensive 194 review and discussion with a variety of media streaming implementors. 196 The purpose of this document is to facilitate interoperability 197 between HTTP Live Streaming implementations by describing the media 198 transmission protocol. Using this protocol, a client can receive a 199 continuous stream of media from a server for concurrent presentation. 201 This document describes version 10 of the protocol. 203 2. Overview 205 A multimedia presentation is specified by a Uniform Resource 206 Identifier (URI) [RFC3986] to a Playlist. 208 A Playlist is either a Media Playlist or a Multivariant Playlist. 209 Both are UTF-8 text files containing URIs and descriptive tags. 211 A Media Playlist contains a list of Media Segments, which, when 212 played sequentially, will play the multimedia presentation. 214 Here is an example of a Media Playlist: 216 #EXTM3U 217 #EXT-X-TARGETDURATION:10 219 #EXTINF:9.009, 220 http://media.example.com/first.ts 221 #EXTINF:9.009, 222 http://media.example.com/second.ts 223 #EXTINF:3.003, 224 http://media.example.com/third.ts 226 The first line is the format identifier tag #EXTM3U. The line 227 containing #EXT-X-TARGETDURATION says that all Media Segments will be 228 10 seconds long or less. Then, three Media Segments are declared. 229 The first and second are 9.009 seconds long; the third is 3.003 230 seconds. 232 To play this Playlist, the client first downloads it and then 233 downloads and plays each Media Segment declared within it. The 234 client reloads the Playlist as described in this document to discover 235 any added segments. Data SHOULD be carried over HTTP [RFC7230], but, 236 in general, a URI can specify any protocol that can reliably transfer 237 the specified resource on demand. 239 A more complex presentation can be described by a Multivariant 240 Playlist. A Multivariant Playlist provides a set of Variant Streams, 241 each of which describes a different version of the same content. 242 Earlier drafts used a different term (see Appendix A). 244 A Variant Stream includes a Media Playlist that specifies media 245 encoded at a particular bit rate, in a particular format, and at a 246 particular resolution for media containing video. 248 A Variant Stream can also specify a set of Renditions. Renditions 249 are alternate versions of the content, such as audio produced in 250 different languages or video recorded from different camera angles. 252 Clients should switch between different Variant Streams to adapt to 253 network conditions. Clients should choose Renditions based on user 254 preferences. 256 Certain streams can be played in Low-Latency Mode. Low-Latency Mode 257 refers to the combined use of Partial Segments, Blocking Playlist 258 Reload and preload hinting to enable playback at a reduced delay from 259 live. 261 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 262 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 263 "OPTIONAL" in this document are to be interpreted as described in BCP 264 14 [RFC2119] [RFC8174] when, and only when, they appear in all 265 capitals, as shown here. 267 3. Media Segments 269 A Media Playlist contains a series of Media Segments that make up the 270 overall presentation. A Media Segment is specified by a URI and 271 optionally a byte range. 273 The duration of each Media Segment is indicated in the Media Playlist 274 by its EXTINF tag (Section 4.4.4.1). 276 Each segment in a Media Playlist has a unique integer Media Sequence 277 Number. The Media Sequence Number of the first segment in the Media 278 Playlist is either 0 or declared in the Playlist (Section 4.4.3.2). 279 The Media Sequence Number of every other segment is equal to the 280 Media Sequence Number of the segment that precedes it plus one. 282 Each Media Segment MUST carry the continuation of the encoded 283 bitstream from the end of the segment with the previous Media 284 Sequence Number, where values in a series such as timestamps and 285 Continuity Counters MUST continue uninterrupted. The only exceptions 286 are the first Media Segment ever to appear in a Media Playlist and 287 Media Segments that are explicitly signaled as discontinuities 288 (Section 4.4.4.3). Unmarked media discontinuities can trigger 289 playback errors. 291 Any Media Segment that contains video SHOULD include enough 292 information to initialize a video decoder and decode a continuous set 293 of frames that includes the final frame in the Segment; network 294 efficiency is optimized if there is enough information in the Segment 295 to decode all frames in the Segment. For example, any Media Segment 296 containing H.264 video SHOULD contain an Instantaneous Decoding 297 Refresh (IDR); frames prior to the first IDR will be downloaded but 298 possibly discarded. 300 3.1. Supported Media Segment Formats 302 All Media Segments MUST be in a format described in this section. 303 Transport of other media file formats is not defined. 305 Some media formats require a common sequence of bytes to initialize a 306 parser before a Media Segment can be parsed. This format-specific 307 sequence is called the Media Initialization Section. The Media 308 Initialization Section can be specified by an EXT-X-MAP tag 309 (Section 4.4.4.5). The Media Initialization Section MUST NOT contain 310 sample data. 312 3.1.1. MPEG-2 Transport Streams 314 MPEG-2 Transport Streams are specified by [ISO_13818]. 316 The Media Initialization Section of an MPEG-2 Transport Stream 317 Segment is a Program Association Table (PAT) followed by a Program 318 Map Table (PMT). 320 Transport Stream Segments MUST contain a single MPEG-2 Program; 321 playback of Multi-Program Transport Streams is not defined. Each 322 Transport Stream Segment MUST contain a PAT and a PMT, or have an 323 EXT-X-MAP tag (Section 4.4.4.5) applied to it. The first two 324 Transport Stream packets in a Segment without an EXT-X-MAP tag SHOULD 325 be a PAT and a PMT. 327 3.1.2. Fragmented MPEG-4 329 MPEG-4 Fragments are specified by the ISO Base Media File Format 330 [ISOBMFF]. Unlike regular MPEG-4 files that have a Movie Box 331 ('moov') that contains sample tables and a Media Data Box ('mdat') 332 containing the corresponding samples, an MPEG-4 Fragment consists of 333 a Movie Fragment Box ('moof') containing a subset of the sample table 334 and a Media Data Box containing those samples. Use of MPEG-4 335 Fragments does require a Movie Box for initialization, but that Movie 336 Box contains only non-sample-specific information such as track and 337 sample descriptions. 339 A Fragmented MPEG-4 (fMP4) Segment is a "segment" as defined by 340 Section 3 of [ISOBMFF], including the constraints on Media Data Boxes 341 in Section 8.16 of [ISOBMFF]. 343 The Media Initialization Section for an fMP4 Segment is an ISO Base 344 Media File that can initialize a parser for that Segment. 346 Broadly speaking, fMP4 Segments and Media Initialization Sections are 347 [ISOBMFF] files that also satisfy the constraints described in this 348 section. 350 The Media Initialization Section for an fMP4 Segment MUST contain a 351 File Type Box ('ftyp') containing a brand that is compatible with 352 'iso6' or higher. The File Type Box MUST be followed by a Movie Box. 353 The Movie Box MUST contain a Track Box ('trak') for every Track 354 Fragment Box ('traf') in the fMP4 Segment, with matching track_ID. 355 Each Track Box SHOULD contain a sample table, but its sample count 356 MUST be zero. Movie Header Boxes ('mvhd') and Track Header Boxes 357 ('tkhd') MUST have durations of zero. The Movie Box MUST contain a 358 Movie Extends Box ('mvex'); it SHOULD follow the last Track Box. 359 Note that a Common Media Application Format [CMAF] Header meets all 360 these requirements. 362 In an fMP4 Segment, every Track Fragment Box MUST contain a Track 363 Fragment Decode Time Box ('tfdt'). fMP4 Segments MUST use movie- 364 fragment-relative addressing. fMP4 Segments MUST NOT use external 365 data references. Note that a CMAF Segment meets these requirements. 367 An fMP4 Segment in a Playlist containing the EXT-X-I-FRAMES-ONLY tag 368 (Section 4.4.3.6) MAY omit the portion of the Media Data Box 369 following the intra-coded frame (I-frame) sample data. 371 This specification makes no additional restrictions on [ISOBMFF] 372 boxes or box order. However, fMP4 Segments that indicate 373 compatibility with an additional standard, such as [CMAF], SHOULD 374 comply with whatever rules that standard requires. 376 Each fMP4 Segment in a Media Playlist MUST have an EXT-X-MAP tag 377 applied to it. 379 3.1.3. Packed Audio 381 A Packed Audio Segment contains encoded audio samples and ID3 tags 382 that are simply packed together with minimal framing and no per- 383 sample timestamps. Supported Packed Audio formats are Advanced Audio 384 Coding (AAC) with Audio Data Transport Stream (ADTS) framing 385 [ISO_13818_7], MP3 [ISO_13818_3], AC-3 [AC_3], and Enhanced AC-3 386 [AC_3]. 388 A Packed Audio Segment has no Media Initialization Section. 390 Each Packed Audio Segment MUST signal the timestamp of its first 391 sample with an ID3 Private frame (PRIV) tag [ID3] at the beginning of 392 the segment. The ID3 PRIV owner identifier MUST be 393 "com.apple.streaming.transportStreamTimestamp". The ID3 payload MUST 394 be a 33-bit MPEG-2 Program Elementary Stream timestamp expressed as a 395 big-endian eight-octet number, with the upper 31 bits set to zero. 396 Clients SHOULD NOT play Packed Audio Segments without this ID3 tag. 398 3.1.4. WebVTT 400 A WebVTT Segment is a section of a WebVTT [WebVTT] file. WebVTT 401 Segments carry subtitles. 403 The Media Initialization Section of a WebVTT Segment is the WebVTT 404 header. 406 Each WebVTT Segment MUST contain all subtitle cues that are intended 407 to be displayed during the period indicated by the segment EXTINF 408 duration. The start time offset and end time offset of each cue MUST 409 indicate the total display time for that cue, even if part of the cue 410 time range is outside the Segment period. A WebVTT Segment MAY 411 contain no cues; this indicates that no subtitles are to be displayed 412 during that period. 414 Under certain conditions, like live streaming, where it is not 415 possible to know the cue duration at the time of the segment creation 416 and the subtitle cue interval is split over multiple Segments, the 417 cue time range in each Segment MAY be limited to the WebVTT time 418 range covered by the Segment. 420 Each WebVTT Segment MUST either start with a WebVTT header or have an 421 EXT-X-MAP tag applied to it. 423 In order to synchronize timestamps between audio/video and subtitles, 424 an X-TIMESTAMP-MAP metadata header SHOULD be added to each WebVTT 425 header. This header maps WebVTT cue timestamps to media timestamps 426 in other Renditions of the Variant Stream. Its format is: 428 X-TIMESTAMP-MAP=LOCAL:,MPEGTS: 429 e.g., X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000 431 indicating the media time to which the cue time MUST be mapped. The 432 cue timestamp in the LOCAL attribute MAY fall outside the range of 433 time covered by the segment. 435 The MPEGTS media timestamp MUST use a 90KHz timescale, even when non- 436 WebVTT Media Segments use a different timescale. 438 If a WebVTT segment does not have the X-TIMESTAMP-MAP, the client 439 MUST assume that the WebVTT cue time of 0 maps to an media timestamp 440 of 0. 442 When synchronizing WebVTT with PES timestamps, clients SHOULD account 443 for cases where the 33-bit PES timestamps have wrapped and the WebVTT 444 cue times have not. When the PES timestamp wraps, the WebVTT segment 445 SHOULD have a X-TIMESTAMP-MAP header that maps the current WebVTT 446 time to the new (low valued) PES timestamp. 448 3.1.5. IMSC Subtitles 450 An IMSC Segment is a Fragmented MPEG-4 (Section 3.1.2) Media Segment 451 that carries subtitle media according to MPEG-4 Part 30 452 [MP4_TIMED_TEXT]. This subtitle media MUST comply with the Text 453 Profile of IMSC1 [IMSC1]. 455 The Media Initialization Section of an IMSC Segment is specified in 456 Section 3.1.2. 458 Each IMSC Segment MUST contain all subtitle samples that are intended 459 to be displayed during the period indicated by the segment EXTINF 460 duration. Each Segment MUST contain definitions for all styles which 461 are applied to any part of any sample in the Segment. 463 3.2. Partial Segments 465 One component of viewer delay in a live stream is publishing latency: 466 a Segment cannot be distributed until it has been completely encoded 467 and packaged. A long Segment encoded in real-time introduces a delay 468 equal to its duration. Partial Segments provide a parallel channel 469 for distributing media at the live edge of the Media Playlist, where 470 the media is divided into a larger number of smaller pieces, such as 471 CMAF Chunks. These subsets are called Partial Segments. Because 472 each Partial Segment has a short duration, it can be packaged, 473 published, and added to the Media Playlist much earlier than its 474 Parent Segment. 476 A Partial Segment MUST be in one of the Supported Media Segment 477 Formats described in Section 3.1. A Partial Segment is associated 478 with a regular Media Segment, called its Parent Segment, by appearing 479 before it in the Media Playlist, and after the previous Media 480 Segment. Partial Segments are identified by the EXT-X-PART tag 481 (Section 4.4.4.9). 483 A Partial Segment MUST contain a subset of the media samples in its 484 Parent Segment. A Parent Segment and its entire set of Partial 485 Segments MUST contain the same set of media samples, with the same 486 timing and metadata. 488 Each Partial Segment has a Part Index, which is an integer indicating 489 the position of the Partial Segment within its Parent Segment. The 490 first Partial Segment has a Part Index of zero. 492 Each Partial Segment also has a Media Sequence Number, which is equal 493 to the Media Sequence Number of its Parent Segment. 495 4. Playlists 497 This section describes the Playlist files used by HTTP Live 498 Streaming. In this section, "MUST" and "MUST NOT" specify the rules 499 for the syntax and structure of legal Playlist files. Playlists that 500 violate these rules are invalid; clients MUST fail to parse them. 501 See Section 6.3.2. 503 The format of the Playlist files is derived from the M3U [M3U] 504 playlist file format and inherits two tags from that earlier file 505 format: EXTM3U (Section 4.4.1.1) and EXTINF (Section 4.4.4.1). 507 In the specification of tag syntax, a string enclosed by <> 508 identifies a tag parameter; its specific format is described in its 509 tag definition. If a parameter is further surrounded by [], it is 510 optional; otherwise, it is required. 512 Each Playlist file MUST be identifiable either by the path component 513 of its URI or by HTTP Content-Type. In the first case, the path MUST 514 end with either .m3u8 or .m3u. In the second, the HTTP Content-Type 515 MUST be "application/vnd.apple.mpegurl" or "audio/mpegurl". Clients 516 SHOULD refuse to parse Playlists that are not so identified. 518 4.1. Definition of a Playlist 520 Playlist files MUST be encoded in UTF-8 [RFC3629]. They MUST NOT 521 contain any Byte Order Mark (BOM); clients SHOULD fail to parse 522 Playlists that contain a BOM or do not parse as UTF-8. Playlist 523 files MUST NOT contain UTF-8 control characters (U+0000 to U+001F and 524 U+007F to U+009F), with the exceptions of CR (U+000D) and LF 525 (U+000A). All character sequences MUST be normalized according to 526 Unicode normalization form "NFC" [UNICODE]. Note that US-ASCII 527 [US_ASCII] conforms to these rules. 529 Lines in a Playlist file are terminated by either a single line feed 530 character or a carriage return character followed by a line feed 531 character. Each line is a URI, is blank, or starts with the 532 character '#'. Blank lines are ignored. Whitespace MUST NOT be 533 present, except for elements in which it is explicitly specified. 535 Lines that start with the character '#' are either comments or tags. 536 Tags begin with #EXT. They are case sensitive. All other lines that 537 begin with '#' are comments and SHOULD be ignored. 539 A URI line identifies a Media Segment or a Playlist file (see 540 Section 4.4.6.2). Each Media Segment is specified by a URI and the 541 tags that apply to it. 543 A Playlist is a Media Playlist if all URI lines in the Playlist 544 identify Media Segments. A Playlist is a Multivariant Playlist if 545 all URI lines in the Playlist identify Media Playlists. A Playlist 546 MUST be either a Media Playlist or a Multivariant Playlist; all other 547 Playlists are invalid. 549 A URI in a Playlist, whether it is a URI line or part of a tag, MAY 550 be relative. Any relative URI is considered to be relative to the 551 URI of the Playlist that contains it. 553 The duration of a Media Playlist is the sum of the durations of the 554 Media Segments within it. 556 The segment bit rate of a Media Segment is the size of the Media 557 Segment divided by its EXTINF duration (Section 4.4.4.1). Note that 558 this includes container overhead but does not include overhead 559 imposed by the delivery system, such as HTTP, TCP, or IP headers. 561 The peak segment bit rate of a Media Playlist is the largest bit rate 562 of any contiguous set of segments whose total duration is between 0.5 563 times the Target Duration and 1.5 times the Target Duration plus 0.5 564 seconds (since media segments may exceed the Target Duration by up to 565 0.5 seconds). The bit rate of a set is calculated by dividing the 566 sum of the segment sizes by the sum of the segment durations. 568 The average segment bit rate of a Media Playlist is the sum of the 569 sizes (in bits) of every Media Segment in the Media Playlist, divided 570 by the Media Playlist duration. Note that this includes container 571 overhead, but not HTTP or other overhead imposed by the delivery 572 system. 574 4.2. Attribute Lists 576 Certain tags have values that are attribute-lists. An attribute-list 577 is a comma-separated list of attribute/value pairs with no 578 whitespace. 580 An attribute/value pair has the following syntax: 582 AttributeName=AttributeValue 584 An AttributeName is an unquoted string containing characters from the 585 set [A..Z], [0..9], and '-'. Therefore, AttributeNames contain only 586 uppercase letters, not lowercase. There MUST NOT be any whitespace 587 between the AttributeName and the '=' character, nor between the '=' 588 character and the AttributeValue. 590 An AttributeValue is one of the following: 592 o decimal-integer: an unquoted string of characters from the set 593 [0..9] expressing an integer in base-10 arithmetic in the range 594 from 0 to 2^64-1 (18446744073709551615). A decimal-integer may be 595 from 1 to 20 characters long. 597 o hexadecimal-sequence: an unquoted string of characters from the 598 set [0..9] and [A..F] that is prefixed with 0x or 0X. The maximum 599 length of a hexadecimal-sequence depends on its AttributeNames. 601 o decimal-floating-point: an unquoted string of characters from the 602 set [0..9] and '.' that expresses a non-negative floating-point 603 number in decimal positional notation. 605 o signed-decimal-floating-point: an unquoted string of characters 606 from the set [0..9], '-', and '.' that expresses a signed 607 floating-point number in decimal positional notation. 609 o quoted-string: a string of characters within a pair of double 610 quotes (0x22). The following characters MUST NOT appear in a 611 quoted-string: line feed (0xA), carriage return (0xD), or double 612 quote (0x22). The string MUST be non-empty, unless specifically 613 allowed. Quoted-string AttributeValues SHOULD be constructed so 614 that byte-wise comparison is sufficient to test two quoted-string 615 AttributeValues for equality. Note that this implies case- 616 sensitive comparison. 618 o enumerated-string: an unquoted character string from a set that is 619 explicitly defined by the AttributeName. An enumerated-string 620 will never contain double quotes ("), commas (,), or whitespace. 622 o enumerated-string-list: a quoted-string containing a comma- 623 separated list of enumerated-strings from a set that is explicitly 624 defined by the AttributeName. Each enumerated-string in the list 625 is a string consisting of characters valid in an enumerated- 626 string. The list SHOULD NOT repeat any enumerated-string. To 627 support forward compatibility, clients MUST ignore any 628 unrecognized enumerated-strings in an enumerated-string-list. 630 o decimal-resolution: two decimal-integers separated by the "x" 631 character. The first integer is a horizontal pixel dimension 632 (width); the second is a vertical pixel dimension (height). 634 The type of the AttributeValue for a given AttributeName is specified 635 by the attribute definition. 637 A given AttributeName MUST NOT appear more than once in a given 638 attribute-list. Clients SHOULD refuse to parse such Playlists. 640 4.3. Variable Substitution 642 The following Playlist elements are subject to variable substitution: 644 o URI lines 645 o quoted-string AttributeValues 647 o hexadecimal-sequence AttributeValues 649 A Variable Reference is a string of the form "{$" (0x7B,0x24) 650 followed by a Variable Name followed by "}" (0x7D). Variable Names 651 are defined by the EXT-X-DEFINE tag (Section 4.4.2.3). 653 See Section 6.3.1 for more information about variable substitution. 655 4.4. Playlist Tags 657 Playlist tags specify either global parameters of the Playlist or 658 information about the Media Segments or Media Playlists that appear 659 after them. 661 4.4.1. Basic Tags 663 These tags are allowed in both Media Playlists and Multivariant 664 Playlists. 666 4.4.1.1. EXTM3U 668 The EXTM3U tag indicates that the file is an Extended M3U [M3U] 669 Playlist file. It MUST be the first line of every Media Playlist and 670 every Multivariant Playlist. Its format is: 672 #EXTM3U 674 4.4.1.2. EXT-X-VERSION 676 The EXT-X-VERSION tag indicates the compatibility version of the 677 Playlist file, its associated media, and its server. 679 The EXT-X-VERSION tag applies to the entire Playlist file. Its 680 format is: 682 #EXT-X-VERSION: 684 where n is an integer indicating the protocol compatibility version 685 number. 687 It MUST appear in all Playlists containing tags or attributes that 688 are not compatible with protocol version 1 to support 689 interoperability with older clients. Section 8 specifies the minimum 690 value of the compatibility version number for any given Playlist 691 file. 693 A Playlist file MUST NOT contain more than one EXT-X-VERSION tag. If 694 a client encounters a Playlist with multiple EXT-X-VERSION tags, it 695 MUST fail to parse it. 697 4.4.2. Media or Multivariant Playlist Tags 699 The tags in this section can appear in either Multivariant Playlists 700 or Media Playlists. If one of these tags appears in a Multivariant 701 Playlist, it SHOULD NOT appear in any Media Playlist referenced by 702 that Multivariant Playlist. A tag that appears in both MUST have the 703 same value; otherwise, clients SHOULD ignore the value in the Media 704 Playlist(s). 706 Tags in this section MUST NOT appear more than once in a Playlist. 707 If one does, clients MUST fail to parse the Playlist. The only 708 exception to this rule is EXT-X-DEFINE, which MAY appear more than 709 once. 711 4.4.2.1. EXT-X-INDEPENDENT-SEGMENTS 713 The EXT-X-INDEPENDENT-SEGMENTS tag indicates that all media samples 714 in a Media Segment can be decoded without information from other 715 segments. It applies to every Media Segment in the Playlist. 717 Its format is: 719 #EXT-X-INDEPENDENT-SEGMENTS 721 If the EXT-X-INDEPENDENT-SEGMENTS tag appears in a Multivariant 722 Playlist, it applies to every Media Segment in every Media Playlist 723 in the Multivariant Playlist. 725 4.4.2.2. EXT-X-START 727 The EXT-X-START tag indicates a preferred point at which to start 728 playing a Playlist. By default, clients SHOULD start playback at 729 this point when beginning a playback session. This tag is OPTIONAL. 731 Its format is: 733 #EXT-X-START: 735 The following attributes are defined: 737 TIME-OFFSET 739 The value of TIME-OFFSET is a signed-decimal-floating-point number 740 of seconds. A positive number indicates a time offset from the 741 beginning of the Playlist. A negative number indicates a negative 742 time offset from the end of the last Media Segment in the 743 Playlist. This attribute is REQUIRED. 745 The absolute value of TIME-OFFSET SHOULD NOT be larger than the 746 Playlist duration. If the absolute value of TIME-OFFSET exceeds 747 the duration of the Playlist, it indicates either the end of the 748 Playlist (if positive) or the beginning of the Playlist (if 749 negative). 751 If the Playlist does not contain the EXT-X-ENDLIST tag, the TIME- 752 OFFSET SHOULD NOT be within three Target Durations of the end of 753 the Playlist file. 755 PRECISE 757 The value is an enumerated-string; valid strings are YES and NO. 758 If the value is YES, clients SHOULD start playback at the Media 759 Segment containing the TIME-OFFSET, but SHOULD NOT render media 760 samples in that segment whose presentation times are prior to the 761 TIME-OFFSET. If the value is NO, clients SHOULD attempt to render 762 every media sample in that segment. This attribute is OPTIONAL. 763 If it is missing, its value should be treated as NO. 765 4.4.2.3. EXT-X-DEFINE 767 The EXT-X-DEFINE tag provides a Playlist variable definition or 768 declaration. This tag is OPTIONAL. 770 Its format is: 772 #EXT-X-DEFINE: 774 The following attributes are defined: 776 NAME 778 The value is a quoted-string which specifies the Variable Name. 779 All characters in the quoted-string MUST be from the following 780 set: [a..z], [A..Z], [0..9], '-', and '_'. 782 VALUE 784 The value is a quoted-string which specifies the Variable Value. 785 This attribute is REQUIRED if the EXT-X-DEFINE tag has a NAME 786 attribute. The quoted-string MAY be empty. 788 IMPORT 789 The value is a quoted-string which specifies the Variable Name and 790 indicates that its value is that of the variable of the same name 791 in the Multivariant Playlist. EXT-X-DEFINE tags containing the 792 IMPORT attribute MUST NOT occur in Multivariant Playlists; they 793 are only allowed in Media Playlists. 795 If the IMPORT attribute value does not match any Variable Name 796 declared in the Multivariant Playlist, or if the Media Playlist 797 was not loaded from a Multivariant Playlist, the parser MUST fail 798 to parse the Playlist. 800 An EXT-X-DEFINE tag MUST contain either a NAME or an IMPORT 801 attribute, but not both. 803 An EXT-X-DEFINE tag MUST NOT specify the same Variable Name as any 804 other EXT-X-DEFINE tag in the same Playlist. Parsers that encounter 805 duplicate Variable Name declarations MUST fail to parse the Playlist. 807 Variable Names are case-sensitive. 809 EXT-X-DEFINE tags do NOT implicitly persist across Playlist reloads. 811 4.4.3. Media Playlist Tags 813 Media Playlist tags describe global parameters of the Media Playlist. 814 There MUST NOT be more than one Media Playlist tag of each type in 815 any Media Playlist. 817 A Media Playlist tag MUST NOT appear in a Multivariant Playlist 819 4.4.3.1. EXT-X-TARGETDURATION 821 The EXT-X-TARGETDURATION tag specifies the Target Duration, an upper 822 bound on the duration of all Media Segments in the Playlist. The 823 EXTINF duration of each Media Segment in a Playlist file, when 824 rounded to the nearest integer, MUST be less than or equal to the 825 Target Duration. Longer segments can trigger playback stalls or 826 other errors. It applies to the entire Playlist file. Its format 827 is: 829 #EXT-X-TARGETDURATION: 831 where s is a decimal-integer indicating the Target Duration in 832 seconds. The EXT-X-TARGETDURATION tag is REQUIRED. 834 4.4.3.2. EXT-X-MEDIA-SEQUENCE 836 The EXT-X-MEDIA-SEQUENCE tag indicates the Media Sequence Number of 837 the first Media Segment that appears in a Playlist file. Its format 838 is: 840 #EXT-X-MEDIA-SEQUENCE: 842 where number is a decimal-integer. 844 If the Media Playlist file does not contain an EXT-X-MEDIA-SEQUENCE 845 tag, then the Media Sequence Number of the first Media Segment in the 846 Media Playlist SHALL be considered to be 0. A client MUST NOT assume 847 that segments with the same Media Sequence Number in different Media 848 Playlists contain matching content (see Section 6.3.2). 850 A URI for a Media Segment is not required to contain its Media 851 Sequence Number. 853 See Section 6.2.1 and Section 6.3.5 for more information on setting 854 the EXT-X-MEDIA-SEQUENCE tag. 856 The EXT-X-MEDIA-SEQUENCE tag MUST appear before the first Media 857 Segment in the Playlist. 859 4.4.3.3. EXT-X-DISCONTINUITY-SEQUENCE 861 The EXT-X-DISCONTINUITY-SEQUENCE tag allows synchronization between 862 different Renditions of the same Variant Stream or different Variant 863 Streams that have EXT-X-DISCONTINUITY tags in their Media Playlists. 865 Its format is: 867 #EXT-X-DISCONTINUITY-SEQUENCE: 869 where number is a decimal-integer. 871 If the Media Playlist does not contain an EXT-X-DISCONTINUITY- 872 SEQUENCE tag, then the Discontinuity Sequence Number of the first 873 Media Segment in the Playlist SHALL be considered to be 0. 875 The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before the first 876 Media Segment in the Playlist. 878 The EXT-X-DISCONTINUITY-SEQUENCE tag MUST appear before any EXT- 879 X-DISCONTINUITY tag. 881 See Section 6.2.1 and Section 6.2.2 for more information about 882 setting the value of the EXT-X-DISCONTINUITY-SEQUENCE tag. 884 4.4.3.4. EXT-X-ENDLIST 886 The EXT-X-ENDLIST tag indicates that no more Media Segments will be 887 added to the Media Playlist file. It MAY occur anywhere in the Media 888 Playlist file. Its format is: 890 #EXT-X-ENDLIST 892 4.4.3.5. EXT-X-PLAYLIST-TYPE 894 The EXT-X-PLAYLIST-TYPE tag provides mutability information about the 895 Media Playlist file. It applies to the entire Media Playlist file. 896 It is OPTIONAL. Its format is: 898 #EXT-X-PLAYLIST-TYPE: 900 where type-enum is either EVENT or VOD. 902 Section 6.2.1 defines the implications of the EXT-X-PLAYLIST-TYPE 903 tag. 905 If the EXT-X-PLAYLIST-TYPE value is EVENT, Media Segments can only be 906 added to the end of the Media Playlist. If the EXT-X-PLAYLIST-TYPE 907 value is Video On Demand (VOD), the Media Playlist cannot change. 909 If the EXT-X-PLAYLIST-TYPE tag is omitted from a Media Playlist, the 910 Playlist can be updated according to the rules in Section 6.2.1 with 911 no additional restrictions. For example, a live Playlist 912 (Section 6.2.2) MAY be updated to remove Media Segments in the order 913 that they appeared. 915 4.4.3.6. EXT-X-I-FRAMES-ONLY 917 The EXT-X-I-FRAMES-ONLY tag indicates that each Media Segment in the 918 Playlist describes a single I-frame. I-frames are encoded video 919 frames whose decoding does not depend on any other frame. I-frame 920 Playlists can be used for trick play, such as fast forward, rapid 921 reverse, and scrubbing. 923 The EXT-X-I-FRAMES-ONLY tag applies to the entire Playlist. Its 924 format is: 926 #EXT-X-I-FRAMES-ONLY 927 In a Playlist with the EXT-X-I-FRAMES-ONLY tag, the Media Segment 928 duration (EXTINF tag value) is the time between the presentation time 929 of the I-frame in the Media Segment and the presentation time of the 930 next I-frame in the Playlist, or the end of the presentation if it is 931 the last I-frame in the Playlist. 933 Media resources containing I-frame segments MUST begin with either a 934 Media Initialization Section (Section 3) or be accompanied by an EXT- 935 X-MAP tag indicating the Media Initialization Section so that clients 936 can load and decode I-frame segments in any order. The byte range of 937 an I-frame segment with an EXT-X-BYTERANGE tag applied to it 938 (Section 4.4.4.2) MUST NOT include its Media Initialization Section; 939 clients can assume that the Media Initialization Section is defined 940 by the EXT-X-MAP tag, or is located between the start of the resource 941 and the offset of the first I-frame segment in that resource. 943 Use of the EXT-X-I-FRAMES-ONLY REQUIRES a compatibility version 944 number of 4 or greater. 946 4.4.3.7. EXT-X-PART-INF 948 The EXT-X-PART-INF tag provides information about the Partial 949 Segments in the Playlist. It is REQUIRED if a Playlist contains one 950 or more EXT-X-PART tags. Its format is: 952 #EXT-X-PART-INF: 954 The following attributes are defined: 956 PART-TARGET 958 The value is a decimal-floating-point number of seconds indicating 959 the Part Target Duration. This attribute is REQUIRED. 961 4.4.3.8. EXT-X-SERVER-CONTROL 963 The EXT-X-SERVER-CONTROL tag allows the Server to indicate support 964 for Delivery Directives (Section 6.2.5). Its format is:. 966 #EXT-X-SERVER-CONTROL: 968 The following attributes are defined: 970 CAN-SKIP-UNTIL 972 Indicates that the Server can produce Playlist Delta Updates in 973 response to the _HLS_skip Delivery Directive. Its value is the 974 Skip Boundary, a decimal-floating-point number of seconds. The 975 Skip Boundary MUST be at least six times the Target Duration. 977 This attribute is OPTIONAL. It MAY appear in any Media Playlist. 979 CAN-SKIP-DATERANGES 981 A value of YES indicates that the Server can produce Playlist 982 Delta Updates that skip older EXT-X-DATERANGE tags in addition to 983 Media Segments. 985 This attribute is OPTIONAL. It REQUIRES the presence of the CAN- 986 SKIP-UNTIL attribute. 988 HOLD-BACK 990 The value is a decimal-floating-point number of seconds that 991 indicates the server-recommended minimum distance from the end of 992 the Playlist at which clients should begin to play or to which 993 they should seek, unless PART-HOLD-BACK applies. Its value MUST 994 be at least three times the Target Duration. 996 This attribute is OPTIONAL. Its absence implies a value of three 997 times the Target Duration. It MAY appear in any Media Playlist. 999 PART-HOLD-BACK 1001 The value is a decimal-floating-point number of seconds that 1002 indicates the server-recommended minimum distance from the end of 1003 the Playlist at which clients should begin to play or to which 1004 they should seek when playing in Low-Latency Mode. Its value MUST 1005 be at least twice the Part Target Duration. Its value SHOULD be 1006 at least three times the Part Target Duration. If different 1007 Renditions have different Part Target Durations then PART-HOLD- 1008 BACK SHOULD be at least three times the maximum Part Target 1009 Duration. 1011 PART-HOLD-BACK is REQUIRED if the Playlist contains the EXT-X- 1012 PART-INF tag. 1014 CAN-BLOCK-RELOAD 1016 The value is an enumerated-string whose value is YES if the server 1017 supports Blocking Playlist Reload (Section 6.2.5.2). This 1018 attribute is OPTIONAL; its absence implies no support. 1020 4.4.4. Media Segment Tags 1022 Each Media Segment is specified by a series of Media Segment tags 1023 followed by a URI. Some Media Segment tags apply to just the next 1024 segment; others apply to all subsequent segments until another 1025 instance of the same tag. 1027 A Media Segment tag MUST NOT appear in a Multivariant Playlist. 1028 Clients MUST fail to parse Playlists that contain both Media Segment 1029 tags and Multivariant Playlist tags (Section 4.4.6). 1031 4.4.4.1. EXTINF 1033 The EXTINF tag specifies the duration of a Media Segment. It applies 1034 only to the next Media Segment. This tag is REQUIRED for each Media 1035 Segment. Its format is: 1037 #EXTINF:,[] 1039 where duration is a decimal-floating-point or decimal-integer number 1040 (as described in Section 4.2) that specifies the duration of the 1041 Media Segment in seconds. Durations SHOULD be decimal-floating- 1042 point, with enough accuracy to avoid perceptible error when segment 1043 durations are accumulated. However, if the compatibility version 1044 number is less than 3, durations MUST be integers. Durations that 1045 are reported as integers SHOULD be rounded to the nearest integer. 1046 The remainder of the line following the comma is an optional human- 1047 readable informative title of the Media Segment expressed as UTF-8 1048 text. 1050 4.4.4.2. EXT-X-BYTERANGE 1052 The EXT-X-BYTERANGE tag indicates that a Media Segment is a sub-range 1053 of the resource identified by its URI. It applies only to the next 1054 URI line that follows it in the Playlist. Its format is: 1056 #EXT-X-BYTERANGE:<n>[@<o>] 1058 where n is a decimal-integer indicating the length of the sub-range 1059 in bytes. If present, o is a decimal-integer indicating the start of 1060 the sub-range, as a byte offset from the beginning of the resource. 1061 If o is not present, the sub-range begins at the next byte following 1062 the sub-range of the previous Media Segment. 1064 If o is not present, a previous Media Segment MUST appear in the 1065 Playlist file and MUST be a sub-range of the same media resource, or 1066 the Media Segment is undefined and the client MUST fail to parse the 1067 Playlist. 1069 A Media Segment without an EXT-X-BYTERANGE tag consists of the entire 1070 resource identified by its URI. 1072 Use of the EXT-X-BYTERANGE tag REQUIRES a compatibility version 1073 number of 4 or greater. 1075 4.4.4.3. EXT-X-DISCONTINUITY 1077 The EXT-X-DISCONTINUITY tag indicates a discontinuity between the 1078 Media Segment that follows it and the one that preceded it. 1080 Its format is: 1082 #EXT-X-DISCONTINUITY 1084 The EXT-X-DISCONTINUITY tag MUST be present if there is a change in 1085 any of the following characteristics: 1087 o file format 1089 o number, type, and identifiers of tracks 1091 o timestamp sequence 1093 The EXT-X-DISCONTINUITY tag SHOULD be present if there is a change in 1094 any of the following characteristics: 1096 o encoding parameters 1098 o encoding sequence 1100 See Section 3, Section 6.2.1, and Section 6.3.3 for more information 1101 about the EXT-X-DISCONTINUITY tag. 1103 4.4.4.4. EXT-X-KEY 1105 Media Segments MAY be encrypted. The EXT-X-KEY tag specifies how to 1106 decrypt them. It applies to every Media Segment and to every Media 1107 Initialization Section declared by an EXT-X-MAP tag that appears 1108 between it and the next EXT-X-KEY tag in the Playlist file with the 1109 same KEYFORMAT attribute or a METHOD of NONE (or the end of the 1110 Playlist file). Any Media Segment or Media Initialization 1111 Section that precedes the first EXT-X-KEY tag is unencrypted. Two or 1112 more EXT-X-KEY tags with different KEYFORMAT attributes MAY apply to 1113 the same Media Segment if they ultimately produce the same decryption 1114 key. The format is: 1116 #EXT-X-KEY:<attribute-list> 1117 The following attributes are defined: 1119 METHOD 1121 The value is an enumerated-string that specifies the encryption 1122 method. This attribute is REQUIRED. 1124 The methods defined are: NONE, AES-128, and SAMPLE-AES. 1126 An encryption method of NONE means that Media Segments are not 1127 encrypted. If the encryption method is NONE, other attributes 1128 MUST NOT be present. 1130 An encryption method of AES-128 signals that Media Segments are 1131 completely encrypted using the Advanced Encryption Standard (AES) 1132 [AES_128] with a 128-bit key, Cipher Block Chaining (CBC), and 1133 Public-Key Cryptography Standards #7 (PKCS7) padding [RFC5652]. 1134 CBC is restarted on each segment boundary, using either the 1135 Initialization Vector (IV) attribute value or the Media Sequence 1136 Number as the IV; see Section 5.2. 1138 An alternative to whole-segment encryption is Sample Encryption. 1139 With Sample Encryption, only media sample data - such as audio 1140 packets or video frames - is encrypted. The rest of the Media 1141 Segment is unencrypted. Sample Encryption allows parts of the 1142 Segment to be processed without (or before) decrypting the media 1143 itself. 1145 An encryption method of SAMPLE-AES means that the Media Segments 1146 are Sample Encrypted using the Advanced Encryption Standard 1147 [AES_128]. How these media streams are encrypted and encapsulated 1148 in a segment depends on the media encoding and the media format of 1149 the segment. fMP4 Media Segments are encrypted using the 'cbcs' 1150 scheme of Common Encryption [COMMON_ENC]. Encryption of other 1151 Media Segment formats containing H.264 [H_264], AAC [ISO_14496], 1152 AC-3 [AC_3], and Enhanced AC-3 [AC_3] media streams is described 1153 in the HTTP Live Streaming (HLS) Sample Encryption specification 1154 [SampleEnc]. The IV attribute MAY be present; see Section 5.2. 1156 URI 1158 The value is a quoted-string containing a URI that specifies how 1159 to obtain the key. This attribute is REQUIRED unless the METHOD 1160 is NONE. 1162 IV 1163 The value is a hexadecimal-sequence that specifies a 128-bit 1164 unsigned integer Initialization Vector to be used with the key. 1165 Use of the IV attribute REQUIRES a compatibility version number of 1166 2 or greater. See Section 5.2 for when the IV attribute is used. 1168 KEYFORMAT 1170 The value is a quoted-string that specifies how the key is 1171 represented in the resource identified by the URI; see Section 5 1172 for more detail. This attribute is OPTIONAL; its absence 1173 indicates an implicit value of "identity". Use of the KEYFORMAT 1174 attribute REQUIRES a compatibility version number of 5 or greater. 1176 KEYFORMATVERSIONS 1178 The value is a quoted-string containing one or more positive 1179 integers separated by the "/" character (for example, "1", "1/2", 1180 or "1/2/5"). If more than one version of a particular KEYFORMAT 1181 is defined, this attribute can be used to indicate which 1182 version(s) this instance complies with. This attribute is 1183 OPTIONAL; if it is not present, its value is considered to be "1". 1184 Use of the KEYFORMATVERSIONS attribute REQUIRES a compatibility 1185 version number of 5 or greater. 1187 If the Media Playlist file does not contain an EXT-X-KEY tag, then 1188 Media Segments are not encrypted. 1190 See Section 5 for the format of the Key file, and Section 5.2, 1191 Section 6.2.3, and Section 6.3.6 for additional information on Media 1192 Segment encryption. 1194 4.4.4.5. EXT-X-MAP 1196 The EXT-X-MAP tag specifies how to obtain the Media Initialization 1197 Section (Section 3) required to parse the applicable Media Segments. 1198 It applies to every Media Segment that appears after it in the 1199 Playlist until the next EXT-X-MAP tag or until the end of the 1200 Playlist. 1202 Its format is: 1204 #EXT-X-MAP:<attribute-list> 1206 The following attributes are defined: 1208 URI 1209 The value is a quoted-string containing a URI that identifies a 1210 resource that contains the Media Initialization Section. This 1211 attribute is REQUIRED. 1213 BYTERANGE 1215 The value is a quoted-string specifying a byte range into the 1216 resource identified by the URI attribute. This range SHOULD 1217 contain only the Media Initialization Section. The format of the 1218 byte range is described in Section 4.4.4.2. This attribute is 1219 OPTIONAL; if it is not present, the byte range is the entire 1220 resource indicated by the URI. 1222 An EXT-X-MAP tag SHOULD be supplied for Media Segments in Playlists 1223 with the EXT-X-I-FRAMES-ONLY tag when the first Media Segment (i.e., 1224 I-frame) in the Playlist (or the first segment following an EXT- 1225 X-DISCONTINUITY tag) does not immediately follow the Media 1226 Initialization Section at the beginning of its resource. 1228 Use of the EXT-X-MAP tag in a Media Playlist that contains the EXT- 1229 X-I-FRAMES-ONLY tag REQUIRES a compatibility version number of 5 or 1230 greater. Use of the EXT-X-MAP tag in a Media Playlist that DOES NOT 1231 contain the EXT-X-I-FRAMES-ONLY tag REQUIRES a compatibility version 1232 number of 6 or greater. 1234 If the Media Initialization Section declared by an EXT-X-MAP tag is 1235 encrypted with a METHOD of AES-128, the IV attribute of the EXT-X-KEY 1236 tag that applies to the EXT-X-MAP is REQUIRED. 1238 4.4.4.6. EXT-X-PROGRAM-DATE-TIME 1240 The EXT-X-PROGRAM-DATE-TIME tag associates the first sample of a 1241 Media Segment with an absolute date and/or time. It applies only to 1242 the next Media Segment. Its format is: 1244 #EXT-X-PROGRAM-DATE-TIME:<date-time-msec> 1246 where date-time-msec is an ISO/IEC 8601:2004 [ISO_8601] date/time 1247 representation, such as YYYY-MM-DDThh:mm:ss.SSSZ. It SHOULD indicate 1248 a time zone and fractional parts of seconds, to at least millisecond 1249 accuracy. 1251 For example: 1253 #EXT-X-PROGRAM-DATE-TIME:2010-02-19T14:54:23.031+08:00 1255 See Section 6.2.1 and Section 6.3.3 for more information on the EXT- 1256 X-PROGRAM-DATE-TIME tag. 1258 4.4.4.7. EXT-X-GAP 1260 The EXT-X-GAP tag indicates that the segment URI to which it applies 1261 does not contain media data and SHOULD NOT be loaded by clients. It 1262 applies only to the next Media Segment. 1264 Its format is: 1266 #EXT-X-GAP 1268 See Section 6.2.1 and Section 6.3.3 for more information on the EXT- 1269 X-GAP tag. 1271 4.4.4.8. EXT-X-BITRATE 1273 The EXT-X-BITRATE tag identifies the approximate segment bit rate of 1274 the Media Segment(s) to which it applies. It applies to every Media 1275 Segment between it and the next EXT-X-BITRATE tag in the Playlist 1276 file (or the end of the Playlist file) that does not have an EXT- 1277 X-BYTERANGE tag applied to it. Its format is: 1279 #EXT-X-BITRATE:<rate> 1281 where rate is a decimal-integer of kilobits per second. 1283 This tag is OPTIONAL. If it is present then its value MUST be no 1284 less than 90% of the segment bit rate of each Media Segment to which 1285 it is applied and no greater than 110% of the segment bit rate of 1286 each Media Segment to which it is applied. 1288 4.4.4.9. EXT-X-PART 1290 The EXT-X-PART tag identifies a Partial Segment. It is OPTIONAL. 1291 Its format is: 1293 #EXT-X-PART:<attribute-list> 1295 The following attributes are defined: 1297 URI 1299 The value is the URI for the Partial Segment. This attribute is 1300 REQUIRED. 1302 DURATION 1304 The value is the duration of the Partial Segment as a decimal- 1305 floating-point number of seconds. This attribute is REQUIRED. 1307 INDEPENDENT 1309 The value is an enumerated-string whose value is YES if the 1310 Partial Segment contains an independent frame. This attribute is 1311 OPTIONAL; however every Partial Segment containing an independent 1312 frame SHOULD carry it to increase the efficiency with which 1313 clients can join and switch Renditions. 1315 BYTERANGE 1317 Indicates that the Partial Segment is a subrange of the resource 1318 specified by the URI attribute. The value is a quoted-string 1319 whose contents have the same format as the EXT-X-BYTERANGE tag: 1320 "<n>[@<o>]". 1322 GAP 1324 The value is an enumerated-string whose value is YES if the 1325 Partial Segment is not available. It is REQUIRED for such Partial 1326 Segments. 1328 All Media Segment Tags (Section 4.4.4) except for EXT-X-BYTERANGE and 1329 EXT-X-GAP that are applied to a Parent Segment MUST appear before the 1330 first EXT-X-PART tag of that Parent Segment. 1332 The duration of a Partial Segment MUST be less than or equal to the 1333 Part Target Duration. The duration of each Partial Segment MUST be 1334 at least 85% of the Part Target Duration, with the exception of 1335 Partial Segments with the INDEPENDENT=YES attribute and the final 1336 Partial Segment of any Parent Segment. 1338 4.4.5. Media Metadata Tags 1340 Media Metadata tags provide information about the playlist that is 1341 not associated with specific Media Segments. There MAY be more than 1342 one Media Metadata tag of each type in any Media Playlist. The only 1343 exception to this rule is EXT-X-SKIP, which MUST NOT appear more than 1344 once. 1346 4.4.5.1. EXT-X-DATERANGE 1348 The EXT-X-DATERANGE tag associates a Date Range (i.e., a range of 1349 time defined by a starting and ending date) with a set of attribute/ 1350 value pairs. Its format is: 1352 #EXT-X-DATERANGE:<attribute-list> 1354 where the defined attributes are: 1356 ID 1358 A quoted-string that uniquely identifies a Date Range in the 1359 Playlist. This attribute is REQUIRED. 1361 CLASS 1363 A client-defined quoted-string that specifies some set of 1364 attributes and their associated value semantics. All Date Ranges 1365 with the same CLASS attribute value MUST adhere to these 1366 semantics. This attribute is OPTIONAL. 1368 START-DATE 1370 A quoted-string containing the [ISO_8601] date/time at which the 1371 Date Range begins. This attribute is REQUIRED. 1373 END-DATE 1375 A quoted-string containing the [ISO_8601] date/time at which the 1376 Date Range ends. It MUST be equal to or later than the value of 1377 the START-DATE attribute. This attribute is OPTIONAL. 1379 DURATION 1381 The duration of the Date Range expressed as a decimal-floating- 1382 point number of seconds. It MUST NOT be negative. A single 1383 instant in time (e.g., crossing a finish line) SHOULD be 1384 represented with a duration of 0. This attribute is OPTIONAL. 1386 PLANNED-DURATION 1388 The expected duration of the Date Range expressed as a decimal- 1389 floating-point number of seconds. It MUST NOT be negative. This 1390 attribute SHOULD be used to indicate the expected duration of a 1391 Date Range whose actual duration is not yet known. It is 1392 OPTIONAL. 1394 X-<client-attribute> 1396 The "X-" prefix defines a namespace reserved for client-defined 1397 attributes. The client-attribute MUST be a legal AttributeName. 1398 Clients SHOULD use a reverse-DNS syntax when defining their own 1399 attribute names to avoid collisions. The attribute value MUST be 1400 a quoted-string, a hexadecimal-sequence, or a decimal-floating- 1401 point. An example of a client-defined attribute is X-COM-EXAMPLE- 1402 AD-ID="XYZ123". These attributes are OPTIONAL. 1404 SCTE35-CMD, SCTE35-OUT, SCTE35-IN 1406 Used to carry SCTE-35 data; see Section 4.4.5.1.1 for more 1407 information. These attributes are OPTIONAL. 1409 END-ON-NEXT 1411 An enumerated-string whose value MUST be YES. This attribute 1412 indicates that the end of the range containing it is equal to the 1413 START-DATE of its Following Range. The Following Range is the 1414 Date Range of the same CLASS that has the earliest START-DATE 1415 after the START-DATE of the range in question. This attribute is 1416 OPTIONAL. 1418 An EXT-X-DATERANGE tag with an END-ON-NEXT=YES attribute MUST have a 1419 CLASS attribute. Other EXT-X-DATERANGE tags with the same CLASS 1420 attribute MUST NOT specify Date Ranges that overlap. 1422 An EXT-X-DATERANGE tag with an END-ON-NEXT=YES attribute MUST NOT 1423 contain DURATION or END-DATE attributes. 1425 A Date Range with neither a DURATION, an END-DATE, nor an END-ON- 1426 NEXT=YES attribute has an unknown duration, even if it has a PLANNED- 1427 DURATION. 1429 If a Playlist contains an EXT-X-DATERANGE tag, it MUST also contain 1430 at least one EXT-X-PROGRAM-DATE-TIME tag. 1432 If a Playlist contains two EXT-X-DATERANGE tags with the same ID 1433 attribute value, then any AttributeName that appears in both tags 1434 MUST have the same AttributeValue. 1436 If a Date Range contains both a DURATION attribute and an END-DATE 1437 attribute, the value of the END-DATE attribute MUST be equal to the 1438 value of the START-DATE attribute plus the value of the DURATION 1439 attribute. 1441 Clients SHOULD ignore EXT-X-DATERANGE tags with illegal syntax. 1443 4.4.5.1.1. Mapping SCTE-35 into EXT-X-DATERANGE 1445 Splice information carried in source media according to the SCTE-35 1446 specification [SCTE35] MAY be represented in a Media Playlist using 1447 EXT-X-DATERANGE tags. 1449 Each SCTE-35 splice_info_section() containing a splice_null(), 1450 splice_schedule(), bandwidth_reservation(), or private_cmd() SHOULD 1451 be represented by an EXT-X-DATERANGE tag with an SCTE35-CMD attribute 1452 whose value is the big-endian binary representation of the 1453 splice_info_section(), expressed as a hexadecimal-sequence. 1455 An SCTE-35 splice out/in pair signaled by a pair of splice_insert() 1456 commands SHOULD be represented by one or more EXT-X-DATERANGE tags 1457 carrying the same ID attribute, which MUST be unique to that splice 1458 out/in pair. The "out" splice_info_section() (with 1459 out_of_network_indicator set to 1) MUST be placed in an SCTE35-OUT 1460 attribute, with the same formatting as SCTE35-CMD. The "in" 1461 splice_info_section() (with out_of_network_indicator set to 0) MUST 1462 be placed in an SCTE35-IN attribute, with the same formatting as 1463 SCTE35-CMD. 1465 An SCTE-35 splice out/in pair signaled by a pair of time_signal() 1466 commands, each carrying a single segmentation_descriptor(), SHOULD be 1467 represented by one or more EXT-X-DATERANGE tags carrying the same ID 1468 attribute, which MUST be unique to that splice out/in pair. The 1469 "out" splice_info_section() MUST be placed in an SCTE35-OUT 1470 attribute; the "in" splice_info_section() MUST be placed in an 1471 SCTE35-IN attribute. 1473 Different types of segmentation, as indicated by the 1474 segmentation_type_id in the segmentation_descriptor(), SHOULD be 1475 represented by separate EXT-X-DATERANGE tags, even if two or more 1476 segmentation_descriptor()s arrive in the same splice_info_section(). 1477 In that case, each EXT-X-DATERANGE tag will have an SCTE35-OUT, 1478 SCTE35-IN, or SCTE35-CMD attribute whose value is the entire 1479 splice_info_section(). 1481 An SCTE-35 time_signal() command that does not signal a splice out or 1482 in point SHOULD be represented by an EXT-X-DATERANGE tag with an 1483 SCTE35-CMD attribute. 1485 The START-DATE of an EXT-X-DATERANGE tag containing an SCTE35-OUT 1486 attribute MUST be the date and time that corresponds to the program 1487 time of that splice. 1489 The START-DATE of an EXT-X-DATERANGE tag containing an SCTE35-CMD 1490 MUST be the date and time specified by the splice_time() in the 1491 command or the program time at which the command appeared in the 1492 source stream if the command does not specify a splice_time(). 1494 An EXT-X-DATERANGE tag containing an SCTE35-OUT attribute MAY contain 1495 a PLANNED-DURATION attribute. Its value MUST be the planned duration 1496 of the splice. 1498 The DURATION of an EXT-X-DATERANGE tag containing an SCTE35-IN 1499 attribute MUST be the actual (not planned) program duration between 1500 the corresponding out-point and that in-point. 1502 The END-DATE of an EXT-X-DATERANGE tag containing an SCTE35-IN 1503 attribute MUST be the actual (not planned) program date and time of 1504 that in-point. 1506 If the actual end date and time is not known when an SCTE35-OUT 1507 attribute is added to the Playlist, the DURATION attribute and the 1508 END-TIME attribute MUST NOT be present; the actual end date of the 1509 splice SHOULD be signaled by another EXT-X-DATERANGE tag once it has 1510 been established. 1512 A canceled splice SHOULD NOT appear in the Playlist as an EXT- 1513 X-DATERANGE tag. 1515 An EXT-X-DATERANGE tag announcing a splice SHOULD be added to a 1516 Playlist at the same time as the last pre-splice Media Segment, or 1517 earlier if possible. 1519 The ID attribute of an EXT-X-DATERANGE tag MAY contain a 1520 splice_event_id and/or a segmentation_event_id, but it MUST be unique 1521 in the Playlist. If there is a possibility that an SCTE-35 id will 1522 be reused, the ID attribute value MUST include disambiguation, such 1523 as a date or sequence number. 1525 4.4.5.2. EXT-X-SKIP 1527 A server produces a Playlist Delta Update (Section 6.2.5.1), by 1528 replacing tags earlier than the Skip Boundary with an EXT-X-SKIP tag. 1530 When replacing Media Segments, the EXT-X-SKIP tag replaces the 1531 segment URI lines and all Media Segment Tags tags that are applied to 1532 those segments. This tag MUST NOT appear more than once in a 1533 Playlist 1535 Its format is: 1537 #EXT-X-SKIP:<attribute-list> 1539 The following attributes are defined: 1541 SKIPPED-SEGMENTS 1543 The value is the count of Media Segments were replaced by the EXT- 1544 X-SKIP tag. This attribute is REQUIRED. 1546 RECENTLY-REMOVED-DATERANGES 1548 The value is a quoted-string consisting of a tab (0x9) delimited 1549 list of EXT-X-DATERANGE IDs that have been removed from the 1550 Playlist recently. See Section 6.2.5.1 for more information. 1551 This attribute is REQUIRED if the Client requested an update that 1552 skips EXT-X-DATERANGE tags. The quoted-string MAY be empty. 1554 4.4.5.3. EXT-X-PRELOAD-HINT 1556 The EXT-X-PRELOAD-HINT tag allows a Client loading media from a live 1557 stream to reduce the time to obtain a resource from the Server by 1558 issuing its request before the resource is available to be delivered. 1559 The server will hold onto the request ("block") until it can respond. 1561 Its format is: 1563 #EXT-X-PRELOAD-HINT:<attribute-list> 1565 The following attributes are defined: 1567 TYPE 1569 The value is an enumerated-string that specifies the type of the 1570 hinted resource. If the value is PART, the resource is a Partial 1571 Segment. If the value is MAP, the resource is a Media 1572 Initialization Section. This attribute is REQUIRED. 1574 URI 1576 The value is a URI identifying the hinted resource. It MUST match 1577 the URI that will be subsequently added to the Playlist as a non- 1578 hinted resource (for example, the URI of an EXT-X-PART tag). The 1579 URI MAY be relative to the URI of the Playlist or it MAY be 1580 absolute. The hostname MAY differ from the hostname of the 1581 Playlist URI. This attribute is REQUIRED. 1583 BYTERANGE-START 1585 The value is a decimal-integer specifying the byte offset of the 1586 first byte of the hinted resource, from the beginning of the 1587 resource identified by the URI attribute. This attribute is 1588 OPTIONAL. Its absence implies a value of 0. 1590 BYTERANGE-LENGTH 1592 The value is a decimal-integer specifying the length of the hinted 1593 resource. This attribute is OPTIONAL. Its absence indicates that 1594 the last byte of the hinted resource is the last byte of the 1595 resource identified by the URI attribute. In this case, you 1596 SHOULD use the recommended last-byte-pos [RFC8673] value of 1597 2^^53-1 (9007199254740991) in the HTTP Range request. 1599 Note that when a hinted Partial Segment eventually appears in the 1600 Playlist as an EXT-X-PART tag, it MAY have a different Discontinuity 1601 Sequence Number, Media Initialization Section, or encryption 1602 configuration. In other words, the Partial Segment can be preceded 1603 by an EXTINF tag indicating the end of the previous Parent Segment 1604 and an EXT-X-DISCONTINUITY, EXT-X-MAP, or EXT-X-KEY tag. 1606 A Playlist containing an EXT-X-ENDLIST tag MUST NOT contain an EXT-X- 1607 PRELOAD-HINT tag. 1609 4.4.5.4. EXT-X-RENDITION-REPORT 1611 The EXT-X-RENDITION-REPORT tag carries information about an 1612 associated Rendition that is as up-to-date as the Playlist that 1613 contains it. Its format is: 1615 #EXT-X-RENDITION-REPORT:<attribute-list> 1617 The following attributes are defined: 1619 URI 1621 The value is the URI for the Media Playlist of the specified 1622 Rendition. It MUST be relative to the URI of the Media Playlist 1623 containing the EXT-X-RENDITION-REPORT tag. This attribute is 1624 REQUIRED. 1626 LAST-MSN 1628 The value is a decimal-integer specifying the Media Sequence 1629 Number of the last Media Segment currently in the specified 1630 Rendition. If the Rendition contains Partial Segments then this 1631 value is the Media Sequence Number of the last Partial Segment. 1632 This attribute is REQUIRED. 1634 LAST-PART 1636 The value is a decimal-integer that indicates the Part Index of 1637 the last Partial Segment currently in the specified Rendition 1638 whose Media Sequence Number is equal to the LAST-MSN attribute 1639 value. This attribute is REQUIRED if the Rendition contains a 1640 Partial Segment. 1642 A server MAY omit adding an attribute to an EXT-X-RENDITION-REPORT 1643 tag - even a mandatory attribute - if its value is the same as that 1644 of the Rendition Report of the Media Playlist to which the EXT-X- 1645 RENDITION-REPORT tag is being added. Doing so reduces the size of 1646 the Rendition Report. 1648 4.4.6. Multivariant Playlist Tags 1650 Multivariant Playlist tags define the Variant Streams, Renditions, 1651 and other global parameters of the presentation. 1653 Multivariant Playlist tags MUST NOT appear in a Media Playlist; 1654 clients MUST fail to parse any Playlist that contains both a 1655 Multivariant Playlist tag and either a Media Playlist tag or a Media 1656 Segment tag. 1658 4.4.6.1. EXT-X-MEDIA 1660 The EXT-X-MEDIA tag is used to relate Media Playlists that contain 1661 alternative Renditions (Section 4.4.6.2.1) of the same content. For 1662 example, three EXT-X-MEDIA tags can be used to identify audio-only 1663 Media Playlists that contain English, French, and Spanish Renditions 1664 of the same presentation. Or, two EXT-X-MEDIA tags can be used to 1665 identify video-only Media Playlists that show two different camera 1666 angles. 1668 Its format is: 1670 #EXT-X-MEDIA:<attribute-list> 1672 The following attributes are defined: 1674 TYPE 1676 The value is an enumerated-string; valid strings are AUDIO, VIDEO, 1677 SUBTITLES, and CLOSED-CAPTIONS. This attribute is REQUIRED. 1679 Typically, closed-caption [CEA608] media is carried in the video 1680 stream. Therefore, an EXT-X-MEDIA tag with TYPE of CLOSED- 1681 CAPTIONS does not specify a Rendition; the closed-caption media is 1682 present in the Media Segments of every video Rendition. 1684 URI 1686 The value is a quoted-string containing a URI that identifies the 1687 Media Playlist file. This attribute is OPTIONAL; see 1688 Section 4.4.6.2.1. If the TYPE is CLOSED-CAPTIONS, the URI 1689 attribute MUST NOT be present. 1691 GROUP-ID 1693 The value is a quoted-string that specifies the group to which the 1694 Rendition belongs. See Section 4.4.6.1.1. This attribute is 1695 REQUIRED. 1697 LANGUAGE 1699 The value is a quoted-string containing one of the standard Tags 1700 for Identifying Languages [RFC5646], which identifies the primary 1701 language used in the Rendition. This attribute is OPTIONAL. 1703 ASSOC-LANGUAGE 1705 The value is a quoted-string containing a language tag [RFC5646] 1706 that identifies a language that is associated with the Rendition. 1707 An associated language is often used in a different role than the 1708 language specified by the LANGUAGE attribute (e.g., written versus 1709 spoken, or a fallback dialect). This attribute is OPTIONAL. 1711 NAME 1713 The value is a quoted-string containing a human-readable 1714 description of the Rendition. If the LANGUAGE attribute is 1715 present, then this description SHOULD be in that language. This 1716 attribute is REQUIRED. 1718 STABLE-RENDITION-ID 1720 The value is a quoted-string which is a stable identifier for the 1721 URI within the Multivariant Playlist. All characters in the 1722 quoted-string MUST be from the following set: [a..z], [A..Z], 1723 [0..9], '+', '/', '=', '.', '-', and '_'. This attribute is 1724 OPTIONAL. 1726 The STABLE-RENDITION-ID allows the URI of a Rendition to change 1727 between two distinct downloads of the Multivariant Playlist. IDs 1728 are matched using a byte-for-byte comparison. 1730 DEFAULT 1732 The value is an enumerated-string; valid strings are YES and NO. 1733 If the value is YES, then the client SHOULD play this Rendition of 1734 the content in the absence of information from the user indicating 1735 a different choice. This attribute is OPTIONAL. Its absence 1736 indicates an implicit value of NO. 1738 AUTOSELECT 1739 The value is an enumerated-string; valid strings are YES and NO. 1740 This attribute is OPTIONAL. Its absence indicates an implicit 1741 value of NO. If the value is YES, then the client MAY choose to 1742 play this Rendition in the absence of explicit user preference 1743 because it matches the current playback environment, such as 1744 chosen system language. 1746 If the AUTOSELECT attribute is present, its value MUST be YES if 1747 the value of the DEFAULT attribute is YES. 1749 FORCED 1751 The value is an enumerated-string; valid strings are YES and NO. 1752 This attribute is OPTIONAL. Its absence indicates an implicit 1753 value of NO. The FORCED attribute MUST NOT be present unless the 1754 TYPE is SUBTITLES. 1756 A value of YES indicates that the Rendition contains content that 1757 is considered essential to play. When selecting a FORCED 1758 Rendition, a client SHOULD choose the one that best matches the 1759 current playback environment (e.g., language). 1761 A value of NO indicates that the Rendition contains content that 1762 is intended to be played in response to explicit user request. 1764 INSTREAM-ID 1766 The value is a quoted-string that specifies a Rendition within the 1767 segments in the Media Playlist. This attribute is REQUIRED if the 1768 TYPE attribute is CLOSED-CAPTIONS, in which case it MUST have one 1769 of the values: "CC1", "CC2", "CC3", "CC4", or "SERVICEn" where n 1770 MUST be an integer between 1 and 63 (e.g., "SERVICE9" or 1771 "SERVICE42"). 1773 The values "CC1", "CC2", "CC3", and "CC4" identify a Line 21 Data 1774 Services channel [CEA608]. The "SERVICE" values identify a 1775 Digital Television Closed Captioning [CEA708] service block 1776 number. 1778 For all other TYPE values, the INSTREAM-ID MUST NOT be specified. 1780 CHARACTERISTICS 1782 The value is a quoted-string containing one or more Media 1783 Characteristic Tags (MCTs) separated by comma (,) characters. A 1784 Media Characteristic Tag has the same format as the payload of a 1785 media characteristic tag atom [MCT] This attribute is OPTIONAL. 1786 Each MCT indicates an individual characteristic of the Rendition. 1788 A SUBTITLES Rendition MAY include the following characteristics: 1789 "public.accessibility.transcribes-spoken-dialog", 1790 "public.accessibility.describes-music-and-sound", and 1791 "public.easy-to-read" (which indicates that the subtitles have 1792 been edited for ease of reading). 1794 An AUDIO Rendition MAY include the following characteristic: 1795 "public.accessibility.describes-video". 1797 The CHARACTERISTICS attribute MAY include private MCTs. 1799 CHANNELS 1801 The value is a quoted-string that specifies an ordered, slash- 1802 separated ("/") list of parameters. 1804 If the TYPE attribute is AUDIO, then the first parameter is a 1805 count of audio channels expressed as a decimal-integer, indicating 1806 the maximum number of independent, simultaneous audio channels 1807 present in any Media Segment in the Rendition. For example, an 1808 AC-3 5.1 Rendition would have a CHANNELS="6" attribute. 1810 If the TYPE attribute is AUDIO, then the second parameter 1811 identifies the encoding of object-based audio used by the 1812 Rendition. This parameter is a comma-separated list of Audio 1813 Object Coding Identifiers. It is optional. An Audio Object 1814 Coding Identifier is a string containing characters from the set 1815 [A..Z], [0..9], and '-'. They are codec-specific. A parameter 1816 value of consisting solely of the dash character (0x2D) indicates 1817 that the audio is not object-based. 1819 No other CHANNELS parameters are currently defined. 1821 All audio EXT-X-MEDIA tags SHOULD have a CHANNELS attribute. If a 1822 Multivariant Playlist contains two Renditions with the same NAME 1823 encoded with the same codec but a different number of channels, 1824 then the CHANNELS attribute is REQUIRED; otherwise, it is 1825 OPTIONAL. 1827 The LANGUAGE and ASSOC-LANGUAGE attributes can be used, for example, 1828 to link Norwegian Renditions that use different spoken and written 1829 languages: 1831 #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitles", 1832 NAME="Bokmael",AUTOSELECT=YES,LANGUAGE="nb", 1833 ASSOC-LANGUAGE="no",URI="nb-subtitles.m3u8" 1834 This allows automatic selection of the Bokmael subtitles in this 1835 Media Playlist when the user picks an audio variant in Norwegian. 1837 4.4.6.1.1. Rendition Groups 1839 A set of one or more EXT-X-MEDIA tags with the same GROUP-ID value 1840 and the same TYPE value defines a Group of Renditions. Each member 1841 of the Group MUST be an alternative Rendition of the same content; 1842 otherwise, playback errors can occur. 1844 All EXT-X-MEDIA tags in a Playlist MUST meet the following 1845 constraints: 1847 o All EXT-X-MEDIA tags in the same Group MUST have different NAME 1848 attributes. 1850 o A Group MUST NOT have more than one member with a DEFAULT 1851 attribute of YES. 1853 o Each EXT-X-MEDIA tag with an AUTOSELECT=YES attribute SHOULD have 1854 a combination of LANGUAGE [RFC5646], ASSOC-LANGUAGE, FORCED, and 1855 CHARACTERISTICS attributes that is distinct from those of other 1856 AUTOSELECT=YES members of its Group. 1858 A Playlist MAY contain multiple Groups of the same TYPE in order to 1859 provide multiple encodings of that media type. If it does so, each 1860 Group of the same TYPE MUST have the same set of members, and each 1861 corresponding member MUST have identical attributes with the 1862 exception of the URI and CHANNELS attributes. 1864 Each member in a Group of Renditions MAY have a different sample 1865 format. For example, an English Rendition can be encoded with AC-3 1866 5.1 while a Spanish Rendition is encoded with AAC stereo. However, 1867 any EXT-X-STREAM-INF tag (Section 4.4.6.2) or EXT-X-I-FRAME-STREAM- 1868 INF tag (Section 4.4.6.3) that references such a Group MUST have a 1869 CODECS attribute that lists every sample format present in any 1870 Rendition in the Group, or client playback failures can occur. In 1871 the example above, the CODECS attribute would include 1872 "ac-3,mp4a.40.2". 1874 4.4.6.2. EXT-X-STREAM-INF 1876 The EXT-X-STREAM-INF tag specifies a Variant Stream, which is a set 1877 of Renditions that can be combined to play the presentation. The 1878 attributes of the tag provide information about the Variant Stream. 1880 The URI line that follows the EXT-X-STREAM-INF tag specifies a Media 1881 Playlist that carries a Rendition of the Variant Stream. The URI 1882 line is REQUIRED. Clients that do not support multiple video 1883 Renditions SHOULD play this Rendition. 1885 Its format is: 1887 #EXT-X-STREAM-INF:<attribute-list> 1888 <URI> 1890 The following attributes are defined: 1892 BANDWIDTH 1894 The value is a decimal-integer of bits per second. It represents 1895 the peak segment bit rate of the Variant Stream. 1897 If all the Media Segments in a Variant Stream have already been 1898 created, the BANDWIDTH value MUST be the largest sum of peak 1899 segment bit rates that is produced by any playable combination of 1900 Renditions. (For a Variant Stream with a single Media Playlist, 1901 this is just the peak segment bit rate of that Media Playlist.) 1902 An inaccurate value can cause playback stalls or prevent clients 1903 from playing the variant. 1905 If the Multivariant Playlist is to be made available before all 1906 Media Segments in the presentation have been encoded, the 1907 BANDWIDTH value SHOULD be the BANDWIDTH value of a representative 1908 period of similar content, encoded using the same settings. 1910 Every EXT-X-STREAM-INF tag MUST include the BANDWIDTH attribute. 1912 AVERAGE-BANDWIDTH 1914 The value is a decimal-integer of bits per second. It represents 1915 the average segment bit rate of the Variant Stream. 1917 If all the Media Segments in a Variant Stream have already been 1918 created, the AVERAGE-BANDWIDTH value MUST be the largest sum of 1919 average segment bit rates that is produced by any playable 1920 combination of Renditions. (For a Variant Stream with a single 1921 Media Playlist, this is just the average segment bit rate of that 1922 Media Playlist.) An inaccurate value can cause playback stalls or 1923 prevent clients from playing the variant. 1925 If the Multivariant Playlist is to be made available before all 1926 Media Segments in the presentation have been encoded, the AVERAGE- 1927 BANDWIDTH value SHOULD be the AVERAGE-BANDWIDTH value of a 1928 representative period of similar content, encoded using the same 1929 settings. 1931 The AVERAGE-BANDWIDTH attribute is OPTIONAL. 1933 SCORE 1935 The value is a positive decimal-floating-point number. It is an 1936 abstract, relative measure of the playback quality-of-experience 1937 of the Variant Stream. 1939 The value can be based on any metric or combination of metrics 1940 that can be consistently applied to all Variant Streams. The 1941 value SHOULD consider all media in the Variant Stream, including 1942 video, audio and subtitles. A Variant Stream with a SCORE 1943 attribute MUST be considered by the Playlist author to be more 1944 desirable than any Variant Stream with a lower SCORE attribute in 1945 the same Multivariant Playlist. 1947 The SCORE attribute is OPTIONAL, but if any Variant Stream 1948 contains the SCORE attribute, then all Variant Streams in the 1949 Multivariant Playlist SHOULD have a SCORE attribute. See 1950 Section 6.3.1 for more information. 1952 CODECS 1954 The value is a quoted-string containing a comma-separated list of 1955 formats, where each format specifies a media sample type that is 1956 present in one or more Renditions specified by the Variant Stream. 1957 Valid format identifiers are those in the ISO Base Media File 1958 Format Name Space defined by "The 'Codecs' and 'Profiles' 1959 Parameters for "Bucket" Media Types" [RFC6381]. 1961 For example, a stream containing AAC low complexity (AAC-LC) audio 1962 and H.264 Main Profile Level 3.0 video would have a CODECS value 1963 of "mp4a.40.2,avc1.4d401e". 1965 Note that if a Variant Stream specifies one or more Renditions 1966 that include IMSC subtitles, the CODECS attribute MUST indicate 1967 this with a format identifier such as "stpp.ttml.im1t". 1969 Every EXT-X-STREAM-INF tag SHOULD include a CODECS attribute. 1971 RESOLUTION 1973 The value is a decimal-resolution describing the optimal pixel 1974 resolution at which to display all the video in the Variant 1975 Stream. 1977 The RESOLUTION attribute is OPTIONAL but is recommended if the 1978 Variant Stream includes video. 1980 FRAME-RATE 1982 The value is a decimal-floating-point describing the maximum frame 1983 rate for all the video in the Variant Stream, rounded to three 1984 decimal places. 1986 The FRAME-RATE attribute is OPTIONAL but is recommended if the 1987 Variant Stream includes video. The FRAME-RATE attribute SHOULD be 1988 included if any video in a Variant Stream exceeds 30 frames per 1989 second. 1991 HDCP-LEVEL 1993 The value is an enumerated-string; valid strings are TYPE-0, TYPE- 1994 1, and NONE. This attribute is advisory. A value of TYPE-0 1995 indicates that the Variant Stream could fail to play unless the 1996 output is protected by High-bandwidth Digital Content Protection 1997 (HDCP) Type 0 [HDCP] or equivalent. A value of TYPE-1 indicates 1998 that the Variant Stream could fail to play unless the output is 1999 protected by HDCP Type 1 or equivalent. A value of NONE indicates 2000 that the content does not require output copy protection. 2002 Encrypted Variant Streams with different HDCP levels SHOULD use 2003 different media encryption keys. 2005 The HDCP-LEVEL attribute is OPTIONAL. It SHOULD be present if any 2006 content in the Variant Stream will fail to play without HDCP. 2007 Clients without output copy protection SHOULD NOT load a Variant 2008 Stream with an HDCP-LEVEL attribute unless its value is NONE. 2010 ALLOWED-CPC 2012 The ALLOWED-CPC attribute allows a server to indicate that the 2013 playback of a Variant Stream containing encrypted Media Segments 2014 is to be restricted to devices that guarantee a certain level of 2015 content protection robustness. Its value is a quoted-string 2016 containing a comma-separated list of entries. Each entry consists 2017 of a KEYFORMAT attribute value followed by a colon character (:) 2018 followed by a sequence of Content Protection Configuration (CPC) 2019 Labels separated by slash (/) characters. Each CPC Label is a 2020 string containing characters from the set [A..Z], [0..9], and '-'. 2022 For example: ALLOWED-CPC="com.example.drm1:SMART-TV/PC, 2023 com.example.drm2:HW" 2025 A CPC Label identifies a class of playback device that implements 2026 the KEYFORMAT with a certain level of content protection 2027 robustness. Each KEYFORMAT can define its own set of CPC Labels. 2029 The "identity" KEYFORMAT does not define any labels. A KEYFORMAT 2030 that defines CPC Labels SHOULD also specify its robustness 2031 requirements in a secure manner in each key response. 2033 A client MAY play the Variant Stream if it implements one of the 2034 listed KEYFORMAT schemes with content protection robustness that 2035 matches one or more of the CPC Labels in the list. If it does not 2036 match any of the CPC Labels then it SHOULD NOT attempt to play the 2037 Variant Stream. 2039 The ALLOWED-CPC attribute is OPTIONAL. If it is not present or 2040 does not contain a particular KEYFORMAT then all clients that 2041 support that KEYFORMAT MAY play the Variant Stream. 2043 VIDEO-RANGE 2045 The value is an enumerated-string; valid strings are SDR, HLG and 2046 PQ. 2048 The value MUST be SDR if the video in the Variant Stream is 2049 encoded using one of the following reference opto-electronic 2050 transfer characteristic functions specified by the 2051 TransferCharacteristics code point: [CICP] 1, 6, 13, 14, 15. Note 2052 that different TransferCharacteristics code points can use the 2053 same transfer function. 2055 The value MUST be HLG if the video in the Variant Stream is 2056 encoded using a reference opto-electronic transfer characteristic 2057 function specified by the TransferCharacteristics code point 18, 2058 or consists of such video mixed with video qualifying as SDR (see 2059 above). 2061 The value MUST be PQ if the video in the Variant Stream is encoded 2062 using a reference opto-electronic transfer characteristic function 2063 specified by the TransferCharacteristics code point 16, or 2064 consists of such video mixed with video qualifying as SDR or HLG 2065 (see above). 2067 This attribute is OPTIONAL. Its absence implies a value of SDR. 2068 Clients that do not recognize the attribute value SHOULD NOT 2069 select the Variant Stream. 2071 STABLE-VARIANT-ID 2073 The value is a quoted-string which is a stable identifier for the 2074 URI within the Multivariant Playlist. All characters in the 2075 quoted-string MUST be from the following set: [a..z], [A..Z], 2077 [0..9], '+', '/', '=', '.', '-', and '_'. This attribute is 2078 OPTIONAL. 2080 The STABLE-VARIANT-ID allows the URI of the Variant Stream to 2081 change between two distinct downloads of the Multivariant 2082 Playlist. IDs are matched using a byte-for-byte comparison. 2084 AUDIO 2086 The value is a quoted-string. It MUST match the value of the 2087 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the 2088 Multivariant Playlist whose TYPE attribute is AUDIO. It indicates 2089 the set of audio Renditions that SHOULD be used when playing the 2090 presentation. See Section 4.4.6.2.1. 2092 The AUDIO attribute is OPTIONAL. 2094 VIDEO 2096 The value is a quoted-string. It MUST match the value of the 2097 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the 2098 Multivariant Playlist whose TYPE attribute is VIDEO. It indicates 2099 the set of video Renditions that SHOULD be used when playing the 2100 presentation. See Section 4.4.6.2.1. 2102 The VIDEO attribute is OPTIONAL. 2104 SUBTITLES 2106 The value is a quoted-string. It MUST match the value of the 2107 GROUP-ID attribute of an EXT-X-MEDIA tag elsewhere in the 2108 Multivariant Playlist whose TYPE attribute is SUBTITLES. It 2109 indicates the set of subtitle Renditions that can be used when 2110 playing the presentation. See Section 4.4.6.2.1. 2112 The SUBTITLES attribute is OPTIONAL. 2114 CLOSED-CAPTIONS 2116 The value can be either a quoted-string or an enumerated-string 2117 with the value NONE. If the value is a quoted-string, it MUST 2118 match the value of the GROUP-ID attribute of an EXT-X-MEDIA tag 2119 elsewhere in the Playlist whose TYPE attribute is CLOSED-CAPTIONS, 2120 and it indicates the set of closed-caption Renditions that can be 2121 used when playing the presentation. See Section 4.4.6.2.1. 2123 If the value is the enumerated-string value NONE, all EXT-X- 2124 STREAM-INF tags MUST have this attribute with a value of NONE, 2125 indicating that there are no closed captions in any Variant Stream 2126 in the Multivariant Playlist. Having closed captions in one 2127 Variant Stream but not another can trigger playback 2128 inconsistencies. 2130 The CLOSED-CAPTIONS attribute is OPTIONAL. 2132 PATHWAY-ID 2134 The value is a quoted-string. It indicates that the Variant 2135 Stream belongs to the identified Content Steering (Section 7) 2136 Pathway. This attribute is OPTIONAL. Its absence indicates that 2137 the Variant Stream belongs to the default Pathway ".", so every 2138 Variant Stream can be associated with a named Pathway. 2140 A Content Provider SHOULD provide all Rendition Groups on all 2141 Pathways. A Variant Stream belonging to a particular Pathway 2142 SHOULD use Rendition Group(s) on that Pathway. 2144 4.4.6.2.1. Alternative Renditions 2146 When an EXT-X-STREAM-INF tag contains an AUDIO, VIDEO, SUBTITLES, or 2147 CLOSED-CAPTIONS attribute, it indicates that alternative Renditions 2148 of the content are available for playback of that Variant Stream. 2150 When defining alternative Renditions, the following constraints MUST 2151 be met to prevent client playback errors: 2153 o All playable combinations of Renditions associated with an EXT-X- 2154 STREAM-INF tag MUST have an aggregate bandwidth less than or equal 2155 to the BANDWIDTH attribute of the EXT-X-STREAM-INF tag. 2157 o If an EXT-X-STREAM-INF tag contains a RESOLUTION attribute and a 2158 VIDEO attribute, then every alternative video Rendition MUST have 2159 an optimal display resolution matching the value of the RESOLUTION 2160 attribute. 2162 o Every alternative Rendition associated with an EXT-X-STREAM-INF 2163 tag MUST meet the constraints for a Variant Stream described in 2164 Section 6.2.4. 2166 The URI attribute of the EXT-X-MEDIA tag is REQUIRED if the media 2167 type is SUBTITLES, but OPTIONAL if the media type is VIDEO or AUDIO. 2168 If the media type is VIDEO or AUDIO, a missing URI attribute 2169 indicates that the media data for this Rendition is included in the 2170 Media Playlist of any EXT-X-STREAM-INF tag referencing this EXT- 2171 X-MEDIA tag. If the media TYPE is AUDIO and the URI attribute is 2172 missing, clients MUST assume that the audio data for this Rendition 2173 is present in every video Rendition specified by the EXT-X-STREAM-INF 2174 tag. 2176 The URI attribute of the EXT-X-MEDIA tag MUST NOT be included if the 2177 media type is CLOSED-CAPTIONS. 2179 4.4.6.3. EXT-X-I-FRAME-STREAM-INF 2181 The EXT-X-I-FRAME-STREAM-INF tag identifies a Media Playlist file 2182 containing the I-frames of a multimedia presentation. It stands 2183 alone, in that it does not apply to a particular URI in the 2184 Multivariant Playlist. Its format is: 2186 #EXT-X-I-FRAME-STREAM-INF:<attribute-list> 2188 All attributes defined for the EXT-X-STREAM-INF tag (Section 4.4.6.2) 2189 are also defined for the EXT-X-I-FRAME-STREAM-INF tag, except for the 2190 FRAME-RATE, AUDIO, SUBTITLES, and CLOSED-CAPTIONS attributes. In 2191 addition, the following attribute is defined: 2193 URI 2195 The value is a quoted-string containing a URI that identifies the 2196 I-frame Media Playlist file. That Playlist file MUST contain an 2197 EXT-X-I-FRAMES-ONLY tag. 2199 Every EXT-X-I-FRAME-STREAM-INF tag MUST include a BANDWIDTH attribute 2200 and a URI attribute. 2202 The provisions in Section 4.4.6.2.1 also apply to EXT-X-I-FRAME- 2203 STREAM-INF tags with a VIDEO attribute. 2205 A Multivariant Playlist that specifies alternative VIDEO Renditions 2206 and I-frame Playlists SHOULD include an alternative I-frame VIDEO 2207 Rendition for each regular VIDEO Rendition, with the same NAME and 2208 LANGUAGE attributes. 2210 4.4.6.4. EXT-X-SESSION-DATA 2212 The EXT-X-SESSION-DATA tag allows arbitrary session data to be 2213 carried in a Multivariant Playlist. 2215 Its format is: 2217 #EXT-X-SESSION-DATA:<attribute-list> 2219 The following attributes are defined: 2221 DATA-ID 2223 The value of DATA-ID is a quoted-string that identifies a 2224 particular data value. The DATA-ID SHOULD conform to a reverse 2225 DNS naming convention, such as "com.example.movie.title"; however, 2226 there is no central registration authority, so Playlist authors 2227 SHOULD take care to choose a value that is unlikely to collide 2228 with others. This attribute is REQUIRED. 2230 VALUE 2232 VALUE is a quoted-string. It contains the data identified by 2233 DATA-ID. If the LANGUAGE is specified, VALUE SHOULD contain a 2234 human-readable string written in the specified language. 2236 URI 2238 The value is a quoted-string containing a URI. The resource 2239 identified by the URI MUST be formatted as JSON [RFC8259]; 2240 otherwise, clients may fail to interpret the resource. 2242 LANGUAGE 2244 The value is a quoted-string containing a language tag [RFC5646] 2245 that identifies the language of the VALUE. This attribute is 2246 OPTIONAL. 2248 Each EXT-X-SESSION-DATA tag MUST contain either a VALUE or URI 2249 attribute, but not both. 2251 A Playlist MAY contain multiple EXT-X-SESSION-DATA tags with the same 2252 DATA-ID attribute. A Playlist MUST NOT contain more than one EXT-X- 2253 SESSION-DATA tag with the same DATA-ID attribute and the same 2254 LANGUAGE attribute. 2256 4.4.6.5. EXT-X-SESSION-KEY 2258 The EXT-X-SESSION-KEY tag allows encryption keys from Media Playlists 2259 to be specified in a Multivariant Playlist. This allows the client 2260 to preload these keys without having to read the Media Playlist(s) 2261 first. 2263 Its format is: 2265 #EXT-X-SESSION-KEY:<attribute-list> 2267 All attributes defined for the EXT-X-KEY tag (Section 4.4.4.4) are 2268 also defined for the EXT-X-SESSION-KEY, except that the value of the 2269 METHOD attribute MUST NOT be NONE. If an EXT-X-SESSION-KEY is used, 2270 the values of the METHOD, KEYFORMAT, and KEYFORMATVERSIONS attributes 2271 MUST match any EXT-X-KEY with the same URI value. 2273 EXT-X-SESSION-KEY tags SHOULD be added if multiple Variant Streams or 2274 Renditions use the same encryption keys and formats. An EXT-X- 2275 SESSION-KEY tag is not associated with any particular Media Playlist. 2277 A Multivariant Playlist MUST NOT contain more than one EXT-X-SESSION- 2278 KEY tag with the same METHOD, URI, IV, KEYFORMAT, and 2279 KEYFORMATVERSIONS attribute values. 2281 The EXT-X-SESSION-KEY tag is optional. 2283 4.4.6.6. EXT-X-CONTENT-STEERING 2285 The EXT-X-CONTENT-STEERING tag allows a server to provide a Content 2286 Steering (Section 7) Manifest. It is OPTIONAL. It MUST NOT appear 2287 more than once in a Multivariant Playlist. Its format is: 2289 #EXT-X-CONTENT-STEERING:<attribute-list> 2291 The following attributes are defined: 2293 SERVER-URI 2295 The value is a URI to a Steering Manifest (Section 7.1). It MAY 2296 contain an asset identifier if the Steering Server requires it to 2297 produce the Steering Manifest. It MAY use the "data" URI scheme 2298 to provide the manifest in-line in the Multivariant Playlist; in 2299 that case, subsequent manifest reloads MAY be redirected to a 2300 remote Steering Server using the RELOAD-URI parameter (see 2301 Section 7.1). This attribute is REQUIRED. 2303 PATHWAY-ID 2305 The value is a quoted-string that identifies the Pathway that MUST 2306 be applied by any client that supports Content Steering (see 2307 Section 7.3) until the initial Steering Manifest has been 2308 obtained. Its value MUST be a legal Pathway ID according to 2309 Section 7.1 that is specified by the PATHWAY-ID attribute of one 2310 or more Variant Streams in the Multivariant Playlist. This 2311 attribute is OPTIONAL. 2313 5. Key Files 2315 5.1. Structure of Key Files 2317 An EXT-X-KEY tag with a URI attribute identifies a Key file. A Key 2318 file contains a cipher key that can decrypt Media Segments in the 2319 Playlist. 2321 [AES_128] encryption uses 16-octet keys. If the KEYFORMAT of an EXT- 2322 X-KEY tag is "identity", the Key file is a single packed array of 16 2323 octets in binary format. 2325 5.2. IV for AES-128 2327 [AES_128] REQUIRES the same 16-octet IV to be supplied when 2328 encrypting and decrypting. Varying this IV increases the strength of 2329 the cipher. 2331 An IV attribute on an EXT-X-KEY tag with a KEYFORMAT of "identity" 2332 specifies an IV that can be used when decrypting Media Segments 2333 encrypted with that Key file. IV values for AES-128 are 128-bit 2334 numbers. 2336 An EXT-X-KEY tag with a KEYFORMAT of "identity" that does not have an 2337 IV attribute indicates that the Media Sequence Number is to be used 2338 as the IV when decrypting a Media Segment, by putting its big-endian 2339 binary representation into a 16-octet (128-bit) buffer and padding 2340 (on the left) with zeros. 2342 6. Client/Server Responsibilities 2344 6.1. Introduction 2346 This section describes how the server generates the Playlist and 2347 Media Segments and how the client should download them for playback. 2349 6.2. Server Responsibilities 2351 6.2.1. General Server Responsibilities 2353 The production of the source media is outside the scope of this 2354 document, which simply presumes a source of continuous encoded media 2355 containing the presentation. 2357 The server MUST divide the source media into individual Media 2358 Segments whose duration (when rounded to a whole second) is less than 2359 or equal to the Target Duration. Segments longer than that can 2360 trigger playback stalls and other errors. 2362 The server SHOULD attempt to divide the source media at points that 2363 support effective decode of individual Media Segments, such as on 2364 packet and key frame boundaries. 2366 The server MUST create a URI for every Media Segment that enables its 2367 clients to obtain the segment data. If a server supports partial 2368 loading of resources (e.g., via HTTP Range requests), it MAY specify 2369 segments as sub-ranges of larger resources using the EXT-X-BYTERANGE 2370 tag. 2372 The absence of media data (due to, for example, the temporary 2373 unavailability of an encoder) SHOULD be signaled by adding one or 2374 more Media Segments to the Playlist whose Segment durations add up to 2375 the duration of absent media; these Media Segments MUST have EXT- 2376 X-GAP tags applied to them. Similarly, such Partial Segments MUST 2377 have a GAP=YES attribute. Attempting to download these segments MAY 2378 produce an error, such as HTTP 404 or 410. 2380 A Media Segment MUST be available for immediate download at the full 2381 speed of the link to the Client when it is added to a Playlist unless 2382 it has been marked with an EXT-X-GAP tag; otherwise playback errors 2383 can occur. Once download starts, its transfer rate SHOULD NOT be 2384 constrained by the segment production process. 2386 A Partial Segment MUST be similarly available at the time it is added 2387 to a Playlist. 2389 HTTP servers SHOULD transfer text files -- such as Playlists and 2390 WebVTT segments -- using the "gzip" Content-Encoding if the client 2391 indicates that it is prepared to accept it. 2393 The server must create a Media Playlist file (Section 4) that 2394 contains a URI for each Media Segment that the server wishes to make 2395 available, in the order in which they are to be played. 2397 The value of the EXT-X-VERSION tag (Section 4.4.1.2) SHOULD NOT be 2398 greater than what is required for the tags and attributes in the 2399 Playlist (see Section 8). 2401 Changes to the Playlist file MUST be made atomically from the point 2402 of view of the clients, or playback errors MAY occur. 2404 The server MUST NOT change the Media Playlist file, except to: 2406 Append lines to it (Section 6.2.1). 2408 Remove Media Segment URIs from the Playlist in the order that they 2409 appear, along with any tags that apply only to those segments 2410 (Section 6.2.2). 2412 Remove Media Metadata tags that no longer apply to the 2413 presentation (Section 6.2.1). 2415 Remove EXT-X-PART tags no longer at the live edge (Section 6.2.2). 2417 Increment the value of the EXT-X-MEDIA-SEQUENCE or EXT-X- 2418 DISCONTINUITY-SEQUENCE tags (Section 6.2.2). 2420 Add an EXT-X-ENDLIST tag to the Playlist (Section 6.2.1). 2422 A Media Playlist has further constraints on its updates if it 2423 contains an EXT-X-PLAYLIST-TYPE tag. An EXT-X-PLAYLIST-TYPE tag with 2424 a value of VOD indicates that the Playlist file MUST NOT change. An 2425 EXT-X-PLAYLIST-TYPE tag with a value of EVENT indicates that the 2426 Server MUST NOT change or remove any part of the Playlist file, with 2427 the exception of EXT-X-PART tags and Media Metadata tags as described 2428 above; the Server MAY append lines to the Playlist. 2430 The value of the EXT-X-TARGETDURATION tag in the Media Playlist MUST 2431 NOT change. A typical Target Duration is 6 seconds. 2433 Playlist changes other than those allowed here can trigger playback 2434 errors and inconsistent client behavior. 2436 Each Media Segment in a Media Playlist has an integer Discontinuity 2437 Sequence Number. The Discontinuity Sequence Number can be used in 2438 addition to the timestamps within the media to synchronize Media 2439 Segments across different Renditions. 2441 A segment's Discontinuity Sequence Number is the value of the EXT-X- 2442 DISCONTINUITY-SEQUENCE tag (or zero if none) plus the number of EXT- 2443 X-DISCONTINUITY tags in the Playlist preceding the URI line of the 2444 segment. 2446 The server MAY associate an absolute date and time with a Media 2447 Segment by applying an EXT-X-PROGRAM-DATE-TIME tag to it. This 2448 defines an informative mapping of the (wall-clock) date and time 2449 specified by the tag to the first media timestamp in the segment, 2450 which may be used as a basis for seeking, for display, or for other 2451 purposes. If a server provides this mapping, it SHOULD apply an EXT- 2452 X-PROGRAM-DATE-TIME tag to every segment that has an EXT- 2453 X-DISCONTINUITY tag applied to it. 2455 The Server MUST NOT add any EXT-X-PROGRAM-DATE-TIME tag to a Playlist 2456 that would cause the mapping between program date and Media Segment 2457 to become ambiguous. 2459 When applied to live content, a reasonable default for the EXT-X- 2460 PROGRAM-DATE-TIME tag is the date and time that the content was 2461 captured (recorded). 2463 The server MUST NOT remove an EXT-X-DATERANGE tag from a Playlist if 2464 any date in the range maps to a Media Segment in the Playlist. 2466 The server MUST NOT reuse the ID attribute value of an EXT- 2467 X-DATERANGE tag for any new Date Range in the same Playlist. 2469 Once the Following Range of a Date Range with an END-ON-NEXT=YES 2470 attribute is added to a Playlist, the Server MUST NOT subsequently 2471 add a Date Range with the same CLASS attribute whose START-DATE is 2472 between that of the END-ON-NEXT=YES range and its Following Range. 2474 For Date Ranges with a PLANNED-DURATION attribute, the Server SHOULD 2475 signal the actual end of the range once it has been established. It 2476 can do so by adding another EXT-X-DATERANGE tag with the same ID 2477 attribute value and either a DURATION or an END-DATE attribute or, if 2478 the Date Range has an END-ON-NEXT=YES attribute, by adding a 2479 Following Range. 2481 If the Media Playlist contains the final Media Segment of the 2482 presentation, then the Playlist file MUST contain the EXT-X-ENDLIST 2483 tag; this allows clients to minimize unproductive Playlist reloads. 2485 If a Media Playlist does not contain the EXT-X-ENDLIST tag, the 2486 server MUST make a new version of the Playlist file available that 2487 contains at least one new Media Segment. It MUST be made available 2488 no later than 1.5 times the Target Duration after the previous time 2489 the Playlist was updated with a Media Segment. This allows clients 2490 to utilize the network efficiently. 2492 If a Media Playlist without an EXT-X-ENDLIST tag contains Partial 2493 Segments, the Server MUST add a new Partial Segment to the Playlist 2494 within one Part Target Duration after it added the previous Partial 2495 Segment. 2497 If the server wishes to remove an entire presentation, it SHOULD 2498 provide a clear indication to clients that the Playlist file is no 2499 longer available (e.g., with an HTTP 404 or 410 response). It MUST 2500 ensure that all Media Segments in the Playlist file remain available 2501 to clients for at least the duration of the Playlist file at the time 2502 of removal to prevent interruption of in-progress playback. 2504 6.2.2. Live Playlists 2506 The server MAY limit the availability of Media Segments by removing 2507 Media Segments from the Playlist file (Section 6.2.1). If Media 2508 Segments are to be removed, the Playlist file MUST contain an EXT-X- 2509 MEDIA-SEQUENCE tag. Its value MUST be incremented by 1 for every 2510 Media Segment that is removed from the Playlist file; it MUST NOT 2511 decrease or wrap. Clients can malfunction if each Media Segment does 2512 not have a consistent, unique Media Sequence Number. 2514 EXT-X-PART tags SHOULD be removed from the Playlist after they are 2515 greater than three Target Durations from the end of the Playlist. 2517 Media Segments and EXT-X-PART tags MUST be removed from the Playlist 2518 in the order that they appear in the Playlist; otherwise, client 2519 playback can malfunction. 2521 The server MUST NOT remove a Media Segment from a Playlist file 2522 without an EXT-X-ENDLIST tag if that would produce a Playlist whose 2523 duration is less than three times the Target Duration. Doing so can 2524 trigger playback stalls. 2526 The Availability Duration of a Media Segment is the duration of the 2527 segment plus the duration of the longest-duration Playlist 2528 distributed by the server containing that segment. If the server 2529 removes a Media Segment URI from a Playlist that contains an EXT- 2530 X-ENDLIST tag, clients MUST be able to download the corresponding 2531 Media Segment until the time of removal plus the segment's 2532 Availability Duration. If the server removes a Media Segment URI 2533 from a Playlist that does not contain an EXT-X-ENDLIST tag, clients 2534 MUST be able to download the segment until the time at which it first 2535 appeared in the Playlist plus the segment's Availability Duration. 2537 If the server wishes to remove segments from a Media Playlist 2538 containing an EXT-X-DISCONTINUITY tag, the Media Playlist MUST 2539 contain an EXT-X-DISCONTINUITY-SEQUENCE tag. Without the EXT-X- 2540 DISCONTINUITY-SEQUENCE tag, it can be impossible for a client to 2541 locate corresponding segments between Renditions. 2543 If the server removes an EXT-X-DISCONTINUITY tag from the Media 2544 Playlist, it MUST increment the value of the EXT-X-DISCONTINUITY- 2545 SEQUENCE tag so that the Discontinuity Sequence Numbers of the 2546 segments still in the Media Playlist remain unchanged. The value of 2547 the EXT-X-DISCONTINUITY-SEQUENCE tag MUST NOT decrease or wrap. 2548 Clients can malfunction if each Media Segment does not have a 2549 consistent Discontinuity Sequence Number. 2551 If a server plans to remove a Media Segment after it is delivered to 2552 clients over HTTP, it SHOULD ensure that the HTTP response contains 2553 an Expires header that reflects the planned time-to-live. 2555 A Live Playlist MUST NOT contain the EXT-X-PLAYLIST-TYPE tag, as no 2556 value of that tag allows Media Segments to be removed. 2558 6.2.3. Encrypting Media Segments 2560 Media Segments MAY be encrypted. Every encrypted Media Segment MUST 2561 have an EXT-X-KEY tag (Section 4.4.4.4) applied to it with a URI that 2562 the client can use to obtain a Key file (Section 5) containing the 2563 decryption key. 2565 A Media Segment can only be encrypted with one encryption METHOD, 2566 using one encryption key and IV. However, a server MAY offer 2567 multiple ways to retrieve that key by providing multiple EXT-X-KEY 2568 tags, each with a different KEYFORMAT attribute value. 2570 The server MAY set the HTTP Expires header in the key response to 2571 indicate the duration for which the key can be cached. 2573 Any unencrypted Media Segment in a Playlist MUST be in the scope of 2574 an EXT-X-KEY tag that specifies an encryption METHOD of NONE or 2575 precedes the first EXT-X-KEY tag. Otherwise, the client will 2576 misinterpret those segments as encrypted. 2578 If the encryption METHOD is AES-128 and the Playlist does not contain 2579 the EXT-X-I-FRAMES-ONLY tag, AES encryption as described in 2580 Section 4.4.4.4 SHALL be applied to individual Media Segments. 2582 If the encryption METHOD is AES-128 and the Playlist contains an EXT- 2583 X-I-FRAMES-ONLY tag, the entire resource MUST be encrypted using 2584 AES-128 CBC with PKCS7 padding [RFC5652]. Encryption MAY be 2585 restarted on 16-byte block boundaries, unless the first block 2586 contains an I-frame. The IV used for encryption MUST be either the 2587 Media Sequence Number of the Media Segment or the value of the IV 2588 attribute of the EXT-X-KEY tag, as described in Section 5.2. These 2589 constraints allow a client to load and decrypt individual I-frames 2590 specified as sub-ranges of regular encrypted Media Segments, and 2591 their Media Initialization Sections. 2593 If the encryption METHOD indicates Sample Encryption, media samples 2594 MAY be encrypted prior to encapsulation in a Media Segment. 2596 The server MUST NOT remove an EXT-X-KEY tag from the Playlist file if 2597 it applies to any Media Segment in the Playlist file, or clients who 2598 subsequently load that Playlist will be unable to decrypt those Media 2599 Segments. 2601 6.2.4. Providing Variant Streams 2603 A server MAY offer multiple Media Playlist files to provide different 2604 encodings of the same presentation. If it does so, it SHOULD provide 2605 a Multivariant Playlist file that lists each Variant Stream to allow 2606 clients to switch between encodings dynamically. 2608 Multivariant Playlists describe regular Variant Streams with EXT-X- 2609 STREAM-INF tags and I-frame Variant Streams with EXT-X-I-FRAME- 2610 STREAM-INF tags. 2612 If an EXT-X-STREAM-INF tag or EXT-X-I-FRAME-STREAM-INF tag contains 2613 the CODECS attribute, the attribute value MUST include every media 2614 format [RFC6381] present in any Media Segment in any of the 2615 Renditions specified by the Variant Stream. 2617 The server MUST meet the following constraints when producing Variant 2618 Streams in order to allow clients to switch between them seamlessly: 2620 Each Variant Stream MUST present the same content. 2622 Matching content in Variant Streams MUST have matching timestamps. 2623 This allows clients to synchronize the media. 2625 Matching content in Variant Streams MUST have matching 2626 Discontinuity Sequence Numbers (see Section 4.4.3.3). 2628 Each Media Playlist in each Variant Stream MUST have the same 2629 Target Duration. The only exceptions are SUBTITLES Renditions and 2630 Media Playlists containing an EXT-X-I-FRAMES-ONLY tag, which MAY 2631 have different Target Durations if they have an EXT-X-PLAYLIST- 2632 TYPE of VOD. 2634 Content that appears in a Media Playlist of one Variant Stream but 2635 not in another MUST appear either at the beginning or at the end 2636 of the Media Playlist file and MUST NOT be longer than the 2637 smallest Target Duration declared in any Media Playlist in the 2638 Multivariant Playlist. 2640 If any Media Playlists have an EXT-X-PLAYLIST-TYPE tag, all Media 2641 Playlists MUST have an EXT-X-PLAYLIST-TYPE tag with the same 2642 value. 2644 If the Playlist contains an EXT-X-PLAYLIST-TYPE tag with the value 2645 of VOD, the first segment of every Media Playlist in every Variant 2646 Stream MUST start at the same media timestamp. 2648 If any Media Playlist in a Multivariant Playlist contains an EXT- 2649 X-PROGRAM-DATE-TIME tag, then all Media Playlists in that 2650 Multivariant Playlist MUST contain EXT-X-PROGRAM-DATE-TIME tags 2651 with consistent mappings of date and time to media timestamps. 2653 Each Variant Stream MUST contain the same set of Date Ranges. The 2654 EXT-X-DATERANGE tags of corresponding Date Ranges MUST have the 2655 same ID attribute value and contain the same set of attribute/ 2656 value pairs. 2658 If any Media Playlist in a Multivariant Playlist contains an EXT- 2659 X-SERVER-CONTROL tag, then all Media Playlists in that 2660 Multivariant Playlist MUST contain that tag, with the same 2661 attributes and values. 2663 In addition, for broadest compatibility, Variant Streams SHOULD 2664 contain the same encoded audio bitstream. This allows clients to 2665 switch between Variant Streams without audible glitching. 2667 The rules for Variant Streams also apply to alternative Renditions 2668 (see Section 4.4.6.2.1). 2670 6.2.5. Delivery Directives Interface 2672 A server MAY provide a set of services to its clients by implementing 2673 support for Delivery Directives. Delivery Directives are transmitted 2674 by the Client to the Server as Query Parameters in Playlist request 2675 URIs. 2677 Servers advertise the availability of Delivery Directives using the 2678 EXT-X-SERVER-CONTROL tag (Section 4.4.3.8). 2680 Currently-defined Delivery Directives are _HLS_skip, _HLS_msn and 2681 _HLS_part. 2683 6.2.5.1. Playlist Delta Updates 2685 Live presentations involve frequent Playlist downloads. When 2686 Playlists are large and a Client already has the previous version, 2687 the transfer cost can be reduced considerably by sending only the 2688 newest information in response to a Playlist update request. 2690 A Server advertises support for Playlist Delta Updates that skip 2691 older Media Segments by adding the CAN-SKIP-UNTIL attribute to the 2692 EXT-X-SERVER-CONTROL tag. A Server can also offer support for 2693 Playlist Delta Updates that skip older EXT-X-DATERANGE tags by adding 2694 the CAN-SKIP-DATERANGES attribute to the EXT-X-SERVER-CONTROL tag. 2696 When a Server receives a request for a Playlist containing the CAN- 2697 SKIP-UNTIL attribute but no EXT-X-ENDLIST tag, and the requested URI 2698 contains an _HLS_skip directive whose value is YES or v2, it MUST 2699 respond with a Playlist Delta Update. 2701 The Playlist Delta Update is a version of the Playlist in which Media 2702 Segments that are further from the end of the Playlist than the Skip 2703 Boundary (Section 4.4.3.8), as well as their associated tags, are 2704 replaced by an EXT-X-SKIP tag (Section 4.4.5.2). 2706 When the _HLS_skip directive has a value of v2, the Playlist Delta 2707 Update additionally MUST NOT contain EXT-X-DATERANGE tags that were 2708 added to the Playlist more than CAN-SKIP-UNTIL seconds before the 2709 Playlist request. The RECENTLY-REMOVED-DATERANGES attribute of the 2710 EXT-X-SKIP tag MUST list the date ranges that were removed from the 2711 Playlist within CAN-SKIP-UNTIL seconds of the Playlist request. 2713 All tags that were not skipped MUST remain in the Playlist Delta 2714 Update. 2716 A Server MUST ignore the _HLS_skip directive if the Playlist does not 2717 contain the CAN-SKIP-UNTIL attribute, or if it contains an EXT- 2718 X-ENDLIST tag. 2720 6.2.5.2. Blocking Playlist Reload 2722 A Server MAY offer Blocking Playlist Reloads, which enable immediate 2723 client discovery of Playlist updates as an alternative to polling. 2725 A Server advertises support for Blocking Playlist Reload by adding 2726 the CAN-BLOCK-RELOAD=YES attribute to the EXT-X-SERVER-CONTROL tag. 2728 A Client requests a Blocking Playlist Reload using an _HLS_msn 2729 directive with a decimal-integer value M. When the Playlist URI 2730 contains an _HLS_msn directive and no _HLS_part directive, the Server 2731 MUST defer responding to the request until the Playlist contains a 2732 Media Segment with a Media Sequence Number of M or later or it 2733 responds with an error. 2735 The Playlist URI MAY also contain an _HLS_part directive with a 2736 decimal-integer value N. When the Playlist URI contains both an 2737 _HLS_msn directive and an _HLS_part directive, the Server MUST defer 2738 responding to the request until the Playlist contains the Partial 2739 Segment with Part Index N and with a Media Sequence Number of M or 2740 later or it responds with an error. 2742 If the Client requests a Part Index greater than that of the final 2743 Partial Segment of the Parent Segment, the Server MUST treat the 2744 request as one for Part Index 0 of the following Parent Segment. 2746 The Server MUST deliver the entire Playlist, even if the requested 2747 Media Segment is not the last one in the Playlist, and even if it is 2748 no longer in the Playlist. 2750 A Server MUST ignore _HLS_msn and _HLS_part if the Playlist contains 2751 an EXT-X-ENDLIST tag. 2753 If the _HLS_msn is greater than the Media Sequence Number of the last 2754 Media Segment in the current Playlist plus two, or if the _HLS_part 2755 exceeds the last Partial Segment in the current Playlist by the 2756 Advance Part Limit, then the server SHOULD immediately return Bad 2757 Request, such as HTTP 400. The Advance Part Limit is three divided 2758 by the Part Target Duration if the Part Target Duration is less than 2759 one second, or three otherwise. 2761 If the Playlist URI contains an _HLS_part directive but no _HLS_msn 2762 directive, the Server MUST return Bad Request, such as HTTP 400. 2764 A Server that cannot provide the requested Playlist after blocking 2765 for more than three Target Durations SHOULD return Service 2766 Unavailable, such as HTTP 503. 2768 6.2.6. Providing Preload Hints 2770 The Server MAY add EXT-X-PRELOAD-HINT tags (Section 4.4.5.3) to the 2771 Playlist to allow Clients playing the stream to request upcoming 2772 resources in advance. 2774 A hinted resource MUST be available for request when its EXT-X- 2775 PRELOAD-HINT tag is added to the Playlist. 2777 When processing requests for a URI or a byte range of a URI that 2778 includes one or more Partial Segments that are not yet completely 2779 available to be sent - such as requests made in response to an EXT-X- 2780 PRELOAD-HINT tag - the server MUST refrain from transmitting any 2781 bytes belonging to a Partial Segment until all bytes of that Partial 2782 Segment can be transmitted at the full speed of the link to the 2783 client. If the requested range includes more than one Partial 2784 Segment then the server MUST enforce this delivery guarantee for each 2785 Partial Segment in turn. This enables the client to perform accurate 2786 Adaptive Bit Rate (ABR) measurements. 2788 The Server SHOULD NOT hint a byte range that it does not expect its 2789 clients to require in the near term. 2791 The server SHOULD respond with "Not Found" (such as HTTP 404) to a 2792 request for a resource that it cannot find and that is not specified 2793 by an EXT-X-PRELOAD-HINT tag in an active Media Playlist. 2795 A server MAY choose not to publish previously-hinted resources if the 2796 planned segmentation changes, such as the case of early return from 2797 an ad. The server SHOULD respond to client requests for those 2798 resources with "Not Found" (such as HTTP 404). 2800 If a Partial Segment is created as a subrange of a larger resource 2801 and its length is not known at the time that its hint is added to the 2802 Playlist, the BYTERANGE-LENGTH attribute SHOULD be omitted. The 2803 BYTERANGE-OFFSET SHOULD indicate the Partial Segment's starting 2804 offset into the larger resource. 2806 The Server SHOULD NOT add more than one EXT-X-PRELOAD-HINT tag with 2807 the same TYPE to a Playlist. 2809 6.3. Client Responsibilities 2811 6.3.1. General Client Responsibilities 2813 How the client obtains the URI to the Playlist file is outside the 2814 scope of this document; it is presumed to have done so. 2816 The client obtains the Playlist file from the URI. If the Playlist 2817 file so obtained is a Multivariant Playlist, the client can select a 2818 Variant Stream to load from the Multivariant Playlist. 2820 Clients MUST ensure that loaded Playlists comply with Section 4 and 2821 that the EXT-X-VERSION tag, if present, specifies a protocol version 2822 supported by the client; if either check fails, the client MUST NOT 2823 attempt to use the Playlist, or unintended behavior could occur. 2825 When parsing Playlist elements that are subject to variable 2826 substitution, a Variable Reference whose Variable Name has been 2827 provided by an EXT-X-DEFINE tag that precedes the Variable Reference 2828 MUST be replaced by the corresponding Variable Value. Such 2829 replacements themselves are NOT subject to variable substitution. 2831 When parsing Playlist elements that are subject to variable 2832 substitution, a Variable Reference whose Variable Name has NOT been 2833 provided by an EXT-X-DEFINE tag preceding the Variable Reference MUST 2834 trigger a parsing error. 2836 If any URI element in a Playlist contains an URI scheme that the 2837 client cannot handle, the client MUST stop playback. All clients 2838 MUST support HTTP schemes. 2840 To support forward compatibility, when parsing Playlists, clients 2841 MUST: 2843 o ignore any unrecognized tags. 2845 o ignore any attribute/value pair with an unrecognized 2846 AttributeName. 2848 o ignore any tag containing an attribute/value pair of type 2849 enumerated-string whose AttributeName is recognized but whose 2850 AttributeValue is not recognized, unless the definition of the 2851 attribute says otherwise. 2853 When identifying playable Renditions, Clients SHOULD consider an 2854 audio Rendition having unrecognized CHANNELS parameters to be 2855 playable if its associated CODECS attribute is supported. However, 2856 an equivalent Rendition with the same audio codec and recognized 2857 CHANNELS parameters SHOULD be preferred if it is present in the 2858 Multivariant Playlist. 2860 When all Variant Streams have a SCORE attribute, the client SHOULD 2861 use the SCORE value to choose a Variant Stream after all other 2862 playability constraints have been applied. If several Variant 2863 Streams have the highest SCORE value then other criteria MAY be used 2864 to chose among them. 2866 Algorithms used by the client to switch between Variant Streams are 2867 beyond the scope of this document. 2869 6.3.2. Loading the Media Playlist File 2871 Every time a Media Playlist is loaded or reloaded from a Playlist 2872 URI, the client MUST determine the next Media Segment to load, as 2873 described in Section 6.3.5, if it intends to play the presentation 2874 normally (i.e., in Playlist order at the nominal playback rate). 2876 If the Media Playlist contains the EXT-X-MEDIA-SEQUENCE tag, the 2877 client SHOULD assume that each Media Segment in it will become 2878 unavailable at the time that the Playlist file was loaded plus the 2879 duration of the Playlist file. 2881 A client MAY use the segment Media Sequence Number to track the 2882 location of a Media Segment within a Playlist when the Playlist is 2883 reloaded. 2885 A client MUST NOT assume that segments with the same Media Sequence 2886 Number in different Variant Streams or Renditions have the same 2887 position in the presentation; Playlists MAY have independent Media 2888 Sequence Numbers. Instead, a client MUST use the relative position 2889 of each segment on the Playlist timeline and its Discontinuity 2890 Sequence Number to locate corresponding segments. 2892 Clients using Delivery Directives (Section 6.2.5) MUST ensure that 2893 all query parameters appear in UTF-8 order within the URI. This 2894 improves Server cache utilization. 2896 A client MUST load the Media Playlist file of every Rendition 2897 selected for playback in order to locate the media specific to that 2898 Rendition. But, to prevent unnecessary load on the server, it SHOULD 2899 NOT load the Playlist file of any other Rendition. 2901 For some Variant Streams, it is possible to select Renditions that do 2902 not include the Rendition specified by the EXT-X-STREAM-INF tag. As 2903 noted above, the client SHOULD NOT load that Rendition in those 2904 cases. 2906 6.3.3. Playing the Media Playlist File 2908 The client SHALL choose which Media Segment to play first from the 2909 Media Playlist when playback starts. If the EXT-X-ENDLIST tag is not 2910 present and the client intends to play the media normally, the client 2911 SHOULD NOT choose a segment closer to the end of the Playlist than 2912 described by the HOLD-BACK and PART-HOLD-BACK attributes. Doing so 2913 can trigger playback stalls. 2915 Normal playback can be achieved by playing Media Segments or Partial 2916 Segments in the order that they appear in the Playlist. The client 2917 MAY present the available media in any way it wishes, including 2918 normal playback, random access, and trick modes. 2920 The client SHOULD NOT attempt to load Media Segments that have been 2921 marked with an EXT-X-GAP tag, or to load Partial Segments with a 2922 GAP=YES attribute. Instead, clients are encouraged to look for 2923 another Variant Stream of the same Rendition which does not have the 2924 same gap, and play that instead. 2926 The encoding parameters for samples in a Media Segment and across 2927 multiple Media Segments in a Media Playlist SHOULD remain consistent. 2928 However, clients SHOULD deal with encoding changes as they are 2929 encountered, for example, by scaling video content to accommodate a 2930 resolution change. If the Variant Stream includes a RESOLUTION 2931 attribute, clients SHOULD display all video within a rectangle with 2932 the same proportions as that resolution. 2934 Clients SHOULD be prepared to handle multiple tracks of a particular 2935 type (e.g., audio or video). A client with no other preference 2936 SHOULD choose the track with the lowest numerical track identifier 2937 that it can play. 2939 Clients SHOULD ignore private streams inside Transport Streams that 2940 they do not recognize. Private streams can be used to support 2941 different devices with the same stream, although stream authors 2942 SHOULD be sensitive to the additional network load that this imposes. 2944 The client MUST be prepared to reset its parser(s) and decoder(s) 2945 before playing a Media Segment that has an EXT-X-DISCONTINUITY tag 2946 applied to it; otherwise, playback errors can occur. 2948 The client SHOULD attempt to load Media Segments in advance of when 2949 they will be required for uninterrupted playback to compensate for 2950 temporary variations in latency and throughput. 2952 The client MAY use the value of the EXT-X-PROGRAM-DATE-TIME tag to 2953 display the program origination time to the user. If the value 2954 includes time zone information, the client SHALL take it into 2955 account; if it does not, the client MAY assume the time to be local. 2957 Note that dates in Playlists can refer to when the content was 2958 produced (or to other times), which have no relation to the time of 2959 playback. 2961 If the first EXT-X-PROGRAM-DATE-TIME tag in a Playlist appears after 2962 one or more Media Segment URIs, the client SHOULD extrapolate 2963 backward from that tag (using EXTINF durations and/or media 2964 timestamps) to associate dates with those segments. To associate a 2965 date with any other Media Segment that does not have an EXT-X- 2966 PROGRAM-DATE-TIME tag applied to it directly, the client SHOULD 2967 extrapolate forward from the last EXT-X-PROGRAM-DATE-TIME tag 2968 appearing before that segment in the Playlist. 2970 6.3.4. Reloading the Media Playlist File 2972 The client MUST periodically reload a Media Playlist file to learn 2973 what media is currently available, unless it contains an EXT-X- 2974 PLAYLIST-TYPE tag with a value of VOD, or a value of EVENT and the 2975 EXT-X-ENDLIST tag is also present. 2977 However, the client MUST NOT attempt to reload the Playlist file more 2978 frequently than specified by this section, in order to limit the 2979 collective load on the server. 2981 When a client loads a Playlist file for the first time or reloads a 2982 Playlist file and finds that it has changed since the last time it 2983 was loaded, the client MUST wait for at least the duration of the 2984 last segment in the Playlist before attempting to reload the Playlist 2985 file again, measured from the last time the client began loading the 2986 Playlist file. 2988 If the client reloads a Playlist file and finds that it has not 2989 changed, then it MUST wait for a period of one-half the Target 2990 Duration before retrying. If the Playlist file remains unchanged 2991 when reloaded and it has been at least 1.5 times the Target Duration 2992 since the last time the client loaded a changed Playlist then the 2993 client MAY conclude that the server is not behaving properly and 2994 switch to a different Variant Stream or trigger a playback error. 2996 After reloading a Media Playlist, the client SHOULD verify that each 2997 Media Segment in it has the same URI (and byte range, if specified) 2998 as the Media Segment with the same Media Sequence Number in the 2999 previous Media Playlist. It SHOULD halt playback if it does not, as 3000 this normally indicates a server error. 3002 In order to reduce server load, the client SHOULD NOT reload the 3003 Playlist files of Variant Streams or alternate Renditions that are 3004 not currently being played. If it decides to switch playback to a 3005 different Variant Stream, it SHOULD stop reloading the Playlist of 3006 the old Variant Stream and begin loading the Playlist of the new 3007 Variant Stream. It can use the EXTINF durations and the constraints 3008 in Section 6.2.4 to determine the approximate location of 3009 corresponding media. Once media from the new Variant Stream has been 3010 loaded, the timestamps in the Media Segments can be used to 3011 synchronize the old and new timelines precisely. 3013 A client MUST NOT attempt to use the Media Sequence Number to 3014 synchronize between streams (see Section 6.3.2). 3016 6.3.5. Determining the Next Segment to Load 3018 The client MUST examine the Media Playlist file every time it is 3019 loaded or reloaded to determine the next Media Segment to load, as 3020 the set of available media MAY have changed. 3022 The first segment to load is generally the segment that the client 3023 has chosen to play first (see Section 6.3.3). 3025 In order to play the presentation normally, the next Media Segment to 3026 load is the one with the lowest Media Sequence Number that is greater 3027 than the Media Sequence Number of the last Media Segment loaded. 3029 6.3.6. Decrypting Encrypted Media Segments 3031 If a Media Playlist file contains an EXT-X-KEY tag that specifies a 3032 Key file URI, the client can obtain that Key file and use the key 3033 inside it to decrypt all Media Segments to which that EXT-X-KEY tag 3034 applies. 3036 A client MUST ignore any EXT-X-KEY tag with an unsupported or 3037 unrecognized KEYFORMAT attribute, to allow for cross-device 3038 addressability. If the Playlist contains a Media Segment to which 3039 only EXT-X-KEY tags with unrecognized or unsupported KEYFORMAT 3040 attributes are applied, playback SHOULD fail. 3042 A client MUST NOT attempt to decrypt any segments whose EXT-X-KEY tag 3043 has a METHOD attribute that it does not recognize. 3045 If the encryption METHOD is AES-128, AES-128 CBC decryption SHALL be 3046 applied to individual Media Segments, whose encryption format is 3047 described in Section 4.4.4.4. 3049 If the encryption METHOD is AES-128 and the Media Segment is part of 3050 an I-frame Playlist (Section 4.4.3.6) and it has an EXT-X-BYTERANGE 3051 tag applied to it, special care needs to be taken in loading and 3052 decrypting the segment, because the resource identified by the URI is 3053 encrypted in 16-byte blocks from the start of the resource. 3055 The decrypted I-frame can be recovered by first widening its byte 3056 range, as specified by the EXT-X-BYTERANGE tag, so that it starts and 3057 ends on 16-byte boundaries from the start of the resource. 3059 Next, the byte range is widened further to include a 16-byte block at 3060 the beginning of the range. This 16-byte block allows the correct IV 3061 for the following block to be calculated. 3063 The widened byte range can then be loaded and decrypted with AES-128 3064 CBC using an arbitrary IV. The number of bytes added to the 3065 beginning and the end of the original byte range are discarded from 3066 the decrypted bytes; what remains is the decrypted I-frame. 3068 If the encryption METHOD indicates Sample Encryption, decryption 3069 SHALL be applied to encrypted media samples within the Media Segment. 3071 An EXT-X-KEY tag with a METHOD of NONE indicates that the Media 3072 Segments it applies to are not encrypted. 3074 6.3.7. Requesting Playlist Delta Updates 3076 If a Media Playlist file contains an EXT-X-SERVER-CONTROL tag with a 3077 CAN-SKIP-UNTIL attribute and no EXT-X-ENDLIST tag, a Client MAY use 3078 the _HLS_skip Delivery Directive to request Playlist Delta Updates. 3080 A Client SHOULD NOT request a Playlist Delta Update unless it already 3081 has a version of the Playlist that is no older than one-half of the 3082 Skip Boundary. 3084 The client can request a Playlist Delta Update that skips older Media 3085 Segments by adding an "_HLS_skip=YES" directive to the Media Playlist 3086 URI when it requests the Playlist. 3088 Alternately, if the EXT-X-SERVER-CONTROL tag contains a CAN-SKIP- 3089 DATERANGES=YES attribute, the client can request a Playlist Delta 3090 Update that skips both older Segments and older EXT-X-DATERANGE tags 3091 by adding an "_HLS_skip=v2" directive to the Media Playlist URI when 3092 it requests the Playlist. 3094 A Client MUST merge the contents of a Playlist Delta Update with its 3095 previous version of the Playlist to form an up-to-date version of the 3096 Playlist. If a Client receives a Playlist containing an EXT-X-SKIP 3097 tag and finds that it does not already have all of the information 3098 that was skipped, it MUST obtain a complete copy of the Playlist by 3099 reissuing its Playlist request without the _HLS_skip directive. 3101 6.3.8. Issuing Blocking Requests 3103 Clients MUST NOT request Blocking Playlist Reloads unless the 3104 Playlist contains an EXT-X-SERVER-CONTROL tag with a CAN-BLOCK- 3105 RELOAD=YES attribute. 3107 If Blocking Playlist Reloads are supported, Clients SHOULD use the 3108 _HLS_msn Delivery Directive (and _HLS_part, if the Playlist contains 3109 Partial Segments) to obtain Playlist updates in preference to the 3110 polling regime described in Section 6.3.4. 3112 If up-to-date information on the next expected Media Sequence Number 3113 of a Rendition is not available, a Client SHOULD use a tune-in 3114 algorithm such as the one described in Appendix C to obtain a recent 3115 version of the Playlist. 3117 Clients MUST ignore EXT-X-PRELOAD-HINT tags with unrecognized TYPE 3118 attributes. Clients SHOULD ignore all but the first EXT-X-PRELOAD- 3119 HINT tag in a Playlist with a particular TYPE attribute. 3121 When processing a Playlist containing an EXT-X-PRELOAD-HINT tag with 3122 TYPE=PART, a Client with sufficient space in its download pipeline 3123 that is not already loading the hinted resource SHOULD request it. 3124 This will typically happen at the same time as its blocking request 3125 for the next Playlist update. 3127 When processing a Playlist containing an EXT-X-PRELOAD-HINT tag with 3128 TYPE=MAP, a Client with sufficient space in its download pipeline 3129 that has not already cached the hinted Media Initialization 3130 Section SHOULD request it. 3132 A Client SHOULD cancel a request for a hinted resource if it is not 3133 present in a subsequent Playlist update, such as in an EXT-X-PRELOAD- 3134 HINT tag or as part of another tag such as EXT-X-PART. The client 3135 SHOULD ignore the results of such requests. 3137 A Client SHOULD recognize when a Partial Segment indicated by an EXT- 3138 X-PART tag is a subrange of a hint download and obtain the Partial 3139 Segment from the hint download. Clients SHOULD recognize contiguous 3140 ranges between existing Partial Segments and Partial Segment hints 3141 and avoid duplicate downloads. 3143 7. Content Steering 3145 Content Steering allows content providers to group redundant Variant 3146 Streams into "Pathways" and to dynamically prioritize access to 3147 different Pathways. Provision of Pathways by servers is OPTIONAL. 3148 Client support for Content Steering is OPTIONAL. Clients that 3149 support Content Steering MUST follow the rules in this section. 3151 Enabling Content Steering of downloadable (offline) content requires 3152 that each downloadable Rendition have a STABLE-VARIANT-ID or STABLE- 3153 RENDITION-ID, that each Pathway offer Renditions with the same stable 3154 IDs, and that Renditions with the same stable ID have bit-for-bit 3155 identical Media Segments. 3157 7.1. Steering Manifest 3159 Content Steering is accomplished by having clients periodically read 3160 a Steering Manifest from a Steering Server. The Steering Manifest 3161 identifies the available Pathways and their priority order. 3163 The Steering Manifest response is a JSON object: 3165 { 3166 "VERSION": number, // REQUIRED, must be an integer 3167 "TTL": number, // REQUIRED, number of seconds 3168 "RELOAD-URI": string, // OPTIONAL, URI 3169 "PATHWAY-PRIORITY": [ // REQUIRED, array of Pathway IDs 3170 One or more Pathway IDs in order of preference 3171 ] 3172 } 3174 A client MUST ignore any key of the Steering Manifest that it does 3175 not recognize. Note that manifest keys are case-sensitive. 3177 This specification defines Steering Manifest VERSION 1. A client 3178 MUST refuse to use a Steering Manifest with an unrecognized VERSION 3179 number. 3181 The TTL specifies how many seconds the client MUST wait before 3182 reloading the Steering Manifest. The recommended value is 300 3183 seconds (5 minutes). The Steering Server MAY vary the TTL by client 3184 to distribute server load. 3186 The RELOAD-URI, if present, specifies the URI the client MUST use the 3187 next time it obtains the Steering Manifest. The RELOAD-URI MAY be 3188 relative to the current Steering Manifest URI. 3190 PATHWAY-PRIORITY is an array of Pathway IDs. A Pathway ID is a non- 3191 empty string containing characters from the set [a..z], [A..Z], 3192 [0..9], '.', '-', and '_'. 3194 Elements in the PATHWAY-PRIORITY array are ordered by Pathway 3195 preference, with the first being most preferred. A Steering Manifest 3196 MUST contain at least one Pathway. A Pathway ID in the PATHWAY- 3197 PRIORITY array MUST NOT appear more than once. Clients MUST ignore 3198 unrecognized Pathway IDs in the PATHWAY-PRIORITY array. 3200 Note that it is important for the most-preferred Pathway of the 3201 initial Steering Manifest to agree with the Multivariant Playlist. 3202 Immediately redirecting a player to a different Pathway on startup 3203 will delay playback and increase network utilization. 3205 7.2. Steering Query Parameters 3207 The client sends a request with the Steering Manifest URI to obtain 3208 the Steering Manifest. It SHOULD add the following query parameters 3209 to the URI: 3211 _HLS_pathway="<CURRENT-PATHWAY-ID>" 3213 _HLS_throughput=<THROUGHPUT> 3215 CURRENT-PATHWAY-ID is the ID of the Pathway currently applied by the 3216 client. 3218 THROUGHPUT is an integer number of bits per second. It represents a 3219 current prediction of media download throughput made by the client 3220 for the applied Pathway. The exact method of bit rate estimation 3221 will vary by client. 3223 HTTP proxy caches SHOULD be configured to exclude highly variable 3224 query parameters such as _HLS_throughput from their cache keys, or 3225 treat the Steering Manifest response as non-cacheable. 3227 7.3. Steering Client Responsibilities 3229 A Pathway is applied by first choosing a particular Pathway ID. The 3230 set of Variant Streams to which the client is allowed to switch is 3231 then restricted to those belonging to that Pathway. If a client is 3232 currently playing a Variant Stream that does not belong to the 3233 applied Pathway, it MUST switch to one that does. 3235 A client that supports Content Steering MUST implement the following 3236 algorithm: 3238 1. When playing a Multivariant Playlist with an EXT-X-CONTENT- 3239 STEERING tag, load the Steering Manifest. A client that wishes 3240 to play before it obtains the Steering Manifest SHOULD apply the 3241 Pathway specified by the PATHWAY-ID of the EXT-X-CONTENT-STEERING 3242 tag. If the EXT-X-CONTENT-STEERING tag does not contain a 3243 PATHWAY-ID attribute, the client MAY use any Pathway until it 3244 obtains the Steering Manifest. 3246 2. When a Steering Manifest is received, perform a Content Steering 3247 evaluation (step 5). 3249 3. If all the Variant Streams from the current Pathway fail with a 3250 network error, mark the current Pathway as penalized, and perform 3251 a Content Steering evaluation (step 5). 3253 4. If the client decides that the Pathway has been penalized long 3254 enough that it may have recovered, it SHOULD un-penalize the 3255 Pathway and perform a Content Steering evaluation (step 5). 3257 5. Content Steering evaluation: If no Pathway is currently applied, 3258 or the current Pathway is not the first in the PATHWAY-PRIORITY 3259 list, or is no longer on the list, or is being penalized, then 3260 apply the first non-penalized Pathway on the list. If no such 3261 Pathway is available, the client SHOULD remain on the current 3262 Pathway. 3264 6. When the current Steering Manifest expires, as defined by the TTL 3265 attribute, issue a new Steering Manifest request for the URI 3266 specified by RELOAD-URI or the previous server URI if none. The 3267 RELOAD-URI may be absolute or relative to the previous server 3268 URI. If the client receives HTTP 410 Gone in response to a 3269 manifest request, it MUST NOT issue another request for that URI 3270 for the remainder of the playback session. It MAY continue to 3271 use the most-recently obtained set of Pathways. If the client 3272 receives HTTP 429 Too Many Requests with a Retry-After header in 3273 response to a manifest request, it SHOULD wait until the time 3274 specified by the Retry-After header to reissue the request. 3276 7. If the Steering Manifest cannot be loaded and parsed correctly, 3277 the client SHOULD continue to use the previous values and attempt 3278 to reload it after waiting for the previously-specified TTL (or 5 3279 minutes if none). 3281 8. Protocol Version Compatibility 3283 Protocol compatibility is specified by the EXT-X-VERSION tag. A 3284 Playlist that contains tags or attributes that are not compatible 3285 with protocol version 1 MUST include an EXT-X-VERSION tag. 3287 A client MUST NOT attempt playback if it does not support the 3288 protocol version specified by the EXT-X-VERSION tag, or unintended 3289 behavior could occur. 3291 A Media Playlist MUST indicate an EXT-X-VERSION of 2 or higher if it 3292 contains: 3294 o The IV attribute of the EXT-X-KEY tag. 3296 A Media Playlist MUST indicate an EXT-X-VERSION of 3 or higher if it 3297 contains: 3299 o Floating-point EXTINF duration values. 3301 A Media Playlist MUST indicate an EXT-X-VERSION of 4 or higher if it 3302 contains: 3304 o The EXT-X-BYTERANGE tag. 3306 o The EXT-X-I-FRAMES-ONLY tag. 3308 A Media Playlist MUST indicate an EXT-X-VERSION of 5 or higher if it 3309 contains: 3311 o An EXT-X-KEY tag with a METHOD of SAMPLE-AES. 3313 o The KEYFORMAT and KEYFORMATVERSIONS attributes of the EXT-X-KEY 3314 tag. 3316 o The EXT-X-MAP tag. 3318 A Media Playlist MUST indicate an EXT-X-VERSION of 6 or higher if it 3319 contains: 3321 o The EXT-X-MAP tag in a Media Playlist that does not contain EXT- 3322 X-I-FRAMES-ONLY. 3324 Note that in protocol version 6, the semantics of the EXT- 3325 X-TARGETDURATION tag changed slightly. In protocol version 5 and 3326 earlier it indicated the maximum segment duration; in protocol 3327 version 6 and later it indicates the the maximum segment duration 3328 rounded to the nearest integer number of seconds. 3330 A Multivariant Playlist MUST indicate an EXT-X-VERSION of 7 or higher 3331 if it contains: 3333 o "SERVICE" values for the INSTREAM-ID attribute of the EXT-X-MEDIA 3334 tag. 3336 A Playlist MUST indicate an EXT-X-VERSION of 8 or higher if it 3337 contains: 3339 o Variable substitution. 3341 A Playlist MUST indicate an EXT-X-VERSION of 9 or higher if it 3342 contains: 3344 o The EXT-X-SKIP tag. 3346 A Playlist MUST indicate an EXT-X-VERSION of 10 or higher if it 3347 contains: 3349 o An EXT-X-SKIP tag that replaces EXT-X-DATERANGE tags in a Playlist 3350 Delta Update. 3352 The EXT-X-MEDIA tag and the AUDIO, VIDEO, and SUBTITLES attributes of 3353 the EXT-X-STREAM-INF tag are backward compatible to protocol version 3354 1, but playback on older clients may not be desirable. A server MAY 3355 consider indicating an EXT-X-VERSION of 4 or higher in the 3356 Multivariant Playlist but is not required to do so. 3358 The PROGRAM-ID attribute of the EXT-X-STREAM-INF and the EXT-X-I- 3359 FRAME-STREAM-INF tags was removed in protocol version 6. 3361 The EXT-X-ALLOW-CACHE tag was removed in protocol version 7. 3363 9. Playlist Examples 3365 In some examples a '\' is used to indicate that the tag continues on 3366 the following line with whitespace removed. 3368 9.1. Simple Media Playlist 3370 #EXTM3U 3371 #EXT-X-TARGETDURATION:10 3372 #EXT-X-VERSION:3 3373 #EXTINF:9.009, 3374 http://media.example.com/first.ts 3375 #EXTINF:9.009, 3376 http://media.example.com/second.ts 3377 #EXTINF:3.003, 3378 http://media.example.com/third.ts 3379 #EXT-X-ENDLIST 3381 9.2. Live Media Playlist Using HTTPS 3383 #EXTM3U 3384 #EXT-X-VERSION:3 3385 #EXT-X-TARGETDURATION:8 3386 #EXT-X-MEDIA-SEQUENCE:2680 3388 #EXTINF:7.975, 3389 https://priv.example.com/fileSequence2680.ts 3390 #EXTINF:7.941, 3391 https://priv.example.com/fileSequence2681.ts 3392 #EXTINF:7.975, 3393 https://priv.example.com/fileSequence2682.ts 3395 9.3. Playlist with Encrypted Media Segments 3396 #EXTM3U 3397 #EXT-X-VERSION:3 3398 #EXT-X-MEDIA-SEQUENCE:7794 3399 #EXT-X-TARGETDURATION:15 3401 #EXT-X-KEY:METHOD=AES-128,URI="https://priv.example.com/key.php?r=52" 3403 #EXTINF:2.833, 3404 http://media.example.com/fileSequence52-A.ts 3405 #EXTINF:15.0, 3406 http://media.example.com/fileSequence52-B.ts 3407 #EXTINF:13.333, 3408 http://media.example.com/fileSequence52-C.ts 3410 #EXT-X-KEY:METHOD=AES-128,URI="https://priv.example.com/key.php?r=53" 3412 #EXTINF:15.0, 3413 http://media.example.com/fileSequence53-A.ts 3415 9.4. Multivariant Playlist 3417 #EXTM3U 3418 #EXT-X-STREAM-INF:BANDWIDTH=1280000,AVERAGE-BANDWIDTH=1000000 3419 http://example.com/low.m3u8 3420 #EXT-X-STREAM-INF:BANDWIDTH=2560000,AVERAGE-BANDWIDTH=2000000 3421 http://example.com/mid.m3u8 3422 #EXT-X-STREAM-INF:BANDWIDTH=7680000,AVERAGE-BANDWIDTH=6000000 3423 http://example.com/hi.m3u8 3424 #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5" 3425 http://example.com/audio-only.m3u8 3427 9.5. Multivariant Playlist with I-Frames 3429 #EXTM3U 3430 #EXT-X-STREAM-INF:BANDWIDTH=1280000 3431 low/audio-video.m3u8 3432 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=86000,URI="low/iframe.m3u8" 3433 #EXT-X-STREAM-INF:BANDWIDTH=2560000 3434 mid/audio-video.m3u8 3435 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=150000,URI="mid/iframe.m3u8" 3436 #EXT-X-STREAM-INF:BANDWIDTH=7680000 3437 hi/audio-video.m3u8 3438 #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=550000,URI="hi/iframe.m3u8" 3439 #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5" 3440 audio-only.m3u8 3442 9.6. Multivariant Playlist with Alternative Audio 3444 In this example, the CODECS attributes have been condensed for space. 3446 #EXTM3U 3447 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="English", \ 3448 DEFAULT=YES,AUTOSELECT=YES,LANGUAGE="en", \ 3449 URI="main/english-audio.m3u8" 3450 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="Deutsch", \ 3451 DEFAULT=NO,AUTOSELECT=YES,LANGUAGE="de", \ 3452 URI="main/german-audio.m3u8" 3453 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="Commentary", \ 3454 DEFAULT=NO,AUTOSELECT=NO,LANGUAGE="en", \ 3455 URI="commentary/audio-only.m3u8" 3456 #EXT-X-STREAM-INF:BANDWIDTH=1280000,CODECS="...",AUDIO="aac" 3457 low/video-only.m3u8 3458 #EXT-X-STREAM-INF:BANDWIDTH=2560000,CODECS="...",AUDIO="aac" 3459 mid/video-only.m3u8 3460 #EXT-X-STREAM-INF:BANDWIDTH=7680000,CODECS="...",AUDIO="aac" 3461 hi/video-only.m3u8 3462 #EXT-X-STREAM-INF:BANDWIDTH=65000,CODECS="mp4a.40.5",AUDIO="aac" 3463 main/english-audio.m3u8 3465 9.7. Multivariant Playlist with Alternative Video 3467 This example shows three different video Renditions (Main, 3468 Centerfield, and Dugout) and three different Variant Streams (low, 3469 mid, and high). In this example, clients that did not support the 3470 EXT-X-MEDIA tag and the VIDEO attribute of the EXT-X-STREAM-INF tag 3471 would only be able to play the video Rendition "Main". 3473 Since the EXT-X-STREAM-INF tag has no AUDIO attribute, all video 3474 Renditions would be required to contain the audio. 3476 In this example, the CODECS attributes have been condensed for space. 3478 #EXTM3U 3479 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Main", \ 3480 DEFAULT=YES,URI="low/main/audio-video.m3u8" 3481 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Centerfield", \ 3482 DEFAULT=NO,URI="low/centerfield/audio-video.m3u8" 3483 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="low",NAME="Dugout", \ 3484 DEFAULT=NO,URI="low/dugout/audio-video.m3u8" 3486 #EXT-X-STREAM-INF:BANDWIDTH=1280000,CODECS="...",VIDEO="low" 3487 low/main/audio-video.m3u8 3489 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Main", \ 3490 DEFAULT=YES,URI="mid/main/audio-video.m3u8" 3491 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Centerfield", \ 3492 DEFAULT=NO,URI="mid/centerfield/audio-video.m3u8" 3493 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="mid",NAME="Dugout", \ 3494 DEFAULT=NO,URI="mid/dugout/audio-video.m3u8" 3496 #EXT-X-STREAM-INF:BANDWIDTH=2560000,CODECS="...",VIDEO="mid" 3497 mid/main/audio-video.m3u8 3499 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Main", \ 3500 DEFAULT=YES,URI="hi/main/audio-video.m3u8" 3501 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Centerfield", \ 3502 DEFAULT=NO,URI="hi/centerfield/audio-video.m3u8" 3503 #EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="hi",NAME="Dugout", \ 3504 DEFAULT=NO,URI="hi/dugout/audio-video.m3u8" 3506 #EXT-X-STREAM-INF:BANDWIDTH=7680000,CODECS="...",VIDEO="hi" 3507 hi/main/audio-video.m3u8 3509 9.8. Session Data in a Multivariant Playlist 3511 In this example, only the EXT-X-SESSION-DATA is shown: 3513 #EXT-X-SESSION-DATA:DATA-ID="com.example.lyrics",URI="lyrics.json" 3515 #EXT-X-SESSION-DATA:DATA-ID="com.example.title",LANGUAGE="en", \ 3516 VALUE="This is an example" 3517 #EXT-X-SESSION-DATA:DATA-ID="com.example.title",LANGUAGE="es", \ 3518 VALUE="Este es un ejemplo" 3520 9.9. CHARACTERISTICS Attribute Containing Multiple Characteristics 3522 Certain characteristics are valid in combination, as in: 3524 CHARACTERISTICS= 3525 "public.accessibility.transcribes-spoken-dialog,public.easy-to-read" 3527 9.10. EXT-X-DATERANGE Carrying SCTE-35 Tags 3529 This example shows two EXT-X-DATERANGE tags that describe a single 3530 Date Range, with an SCTE-35 "out" splice_insert() command that is 3531 subsequently updated with an SCTE-35 "in" splice_insert() command. 3533 #EXTM3U 3534 ... 3535 #EXT-X-DATERANGE:ID="splice-6FFFFFF0", \ 3536 START-DATE="2014-03-05T11:15:00Z",PLANNED-DURATION=59.993, \ 3537 SCTE35-OUT=0xFC002F0000000000FF000014056FFFFFF000E011622DCAFF0 \ 3538 00052636200000000000A0008029896F50000008700000000 3540 ... Media Segment declarations for 60s worth of media 3542 #EXT-X-DATERANGE:ID="splice-6FFFFFF0",DURATION=59.993, \ 3543 SCTE35-IN=0xFC002A0000000000FF00000F056FFFFFF000401162802E610 \ 3544 0000000000A0008029896F50000008700000000 3545 ... 3547 9.11. Low-Latency Playlist 3549 This example shows the end of a Playlist that contains Partial 3550 Segments. Note that EXT-X-PART tags have been removed from earlier 3551 Parent Segments. The Playlist also includes a Preload Hint, a 3552 Rendition Report, and a mid-roll advertisement. 3554 #EXTM3U 3555 #EXT-X-TARGETDURATION:4 3556 ... 3557 #EXTINF:4.00008, 3558 fileSequence268.mp4 3559 #EXTINF:4.00008, 3560 fileSequence269.mp4 3561 #EXTINF:4.00008, 3562 fileSequence270.mp4 3563 #EXT-X-PART:DURATION=2.00004,INDEPENDENT=YES,URI="filePart271.0.mp4" 3564 #EXT-X-PART:DURATION=2.00004,URI="filePart271.1.mp4" 3565 #EXTINF:4.00008, 3566 fileSequence271.mp4 3567 #EXT-X-PART:DURATION=2.00004,INDEPENDENT=YES,URI="filePart272.0.mp4" 3568 #EXT-X-PART:DURATION=0.50001,URI="filePart272.1.mp4" 3569 #EXTINF:2.50005, 3570 fileSequence272.mp4 3571 #EXT-X-DISCONTINUITY 3572 #EXT-X-PART:DURATION=2.00004,INDEPENDENT=YES,URI="midRoll273.0.mp4" 3573 #EXT-X-PART:DURATION=2.00004,URI="midRoll273.1.mp4" 3574 #EXTINF:4.00008, 3575 midRoll273.mp4 3576 #EXT-X-PART:DURATION=2.00004,INDEPENDENT=YES,URI="midRoll274.0.mp4" 3577 #EXT-X-PRELOAD-HINT:TYPE=PART,URI="midRoll274.1.mp4" 3578 #EXT-X-RENDITION-REPORT:URI="/1M/LL-HLS.m3u8",LAST-MSN=274,LAST-PART=1 3580 9.12. Content Steering Playlist and Manifest 3582 This example shows a Multivariant Playlist and a corresponding 3583 Steering Manifest. The Multivariant Playlist URI is 3584 https://example.com/videos/video12/mv.m3u8. Line breaks have been 3585 added for legibility. 3587 #EXTM3U 3588 #EXT-X-CONTENT-STEERING:SERVER-URI="/steering?video=00012", \ 3589 PATHWAY-ID="CDN-A" 3590 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="A",NAME="English",DEFAULT=YES, \ 3591 URI="eng.m3u8",LANGUAGE="en",STABLE-RENDITION-ID="Audio-37262" 3592 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="B",NAME="ENGLISH",DEFAULT=YES, \ 3593 URI="https://b.example.com/content/videos/video12/eng.m3u8", \ 3594 LANGUAGE="en",STABLE-RENDITION-ID="Audio-37262" 3595 #EXT-X-STREAM-INF:BANDWIDTH=1280000,AUDIO="A",PATHWAY-ID="CDN-A", \ 3596 STABLE-VARIANT-ID="Video-128" 3597 low/video.m3u8 3598 #EXT-X-STREAM-INF:BANDWIDTH=7680000,AUDIO="A",PATHWAY-ID="CDN-A", \ 3599 STABLE-VARIANT-ID="Video-768" 3600 hi/video.m3u8 3601 #EXT-X-STREAM-INF:BANDWIDTH=1280000,AUDIO="B",PATHWAY-ID="CDN-B", \ 3602 STABLE-VARIANT-ID="Video-128" 3603 https://backup.example.com/content/videos/video12/low/video.m3u8 3604 #EXT-X-STREAM-INF:BANDWIDTH=7680000,AUDIO="B",PATHWAY-ID="CDN-B", \ 3605 STABLE-VARIANT-ID="Video-768" 3606 https://backup.example.com/content/videos/video12/hi/video.m3u8 3608 { 3609 "VERSION": 1, 3610 "TTL": 300, 3611 "RELOAD-URI": "https://example.com/steering?video=00012&session=123", 3612 "PATHWAY-PRIORITY": [ 3613 "CDN-A", 3614 "CDN-B" 3615 ] 3616 } 3618 10. Contributors 3620 Significant contributions to the design of this protocol were made by 3621 Jim Batson, David Biderman, Bill May, Roger Pantos, Alan Tseng, and 3622 Eryk Vershen. Stuart Cheshire helped edit the specification. 3624 Significant contributions to the update of this protocol were made by 3625 Bill May, Eryk Vershen, and Peng Zhou. 3627 In particular, Bill May co-authored the first edition of HTTP Live 3628 Streaming, [RFC8216], and continues to provide valuable guidance and 3629 input. 3631 11. IANA Considerations 3633 11.1. vnd.apple.mpegurl 3635 IANA has registered the following media type [RFC2046]: 3637 Type name: application 3639 Subtype name: vnd.apple.mpegurl 3641 Required parameters: none 3643 Optional parameters: none 3645 Encoding considerations: encoded as UTF-8, which is 8-bit text. This 3646 media type may require encoding on transports not capable of handling 3647 8-bit text. See Section 4 for more information. 3649 Security considerations: See Section 12. 3651 Compression: this media type does not employ compression. 3653 Interoperability considerations: There are no byte-ordering issues 3654 since files are 8-bit text. Applications could encounter 3655 unrecognized tags, which SHOULD be ignored. 3657 Published specification: see Section 4. 3659 Applications that use this media type: Multimedia applications such 3660 as the iPhone media player in iOS 3.0 and later and QuickTime Player 3661 in Mac OS X version 10.6 and later. 3663 Fragment identifier considerations: no Fragment Identifiers are 3664 defined for this media type. 3666 Query parameter considerations: the definition of all query 3667 parameters for resources of this media type which begin with the 3668 string "_HLS_" are reserved by this specification. Currently-defined 3669 query parameters are specified in Section 6.2.5 and Appendix D.3. 3671 Additional information: 3673 Deprecated alias names for this type: none 3674 Magic number(s): #EXTM3U 3675 File extension(s): .m3u8, .m3u (see Section 4) 3676 Macintosh file type code(s): none 3678 Person & email address to contact for further information: David 3679 Singer, singer AT apple.com. 3681 Intended usage: LIMITED USE 3683 Restrictions on usage: none 3685 Author: Roger Pantos 3687 Change Controller: David Singer 3689 11.2. vnd.apple.steering-list 3691 IANA has registered the following media type [RFC2046]: 3693 Type name: application 3695 Subtype name: vnd.apple.steering-list 3697 Required parameters: none 3699 Optional parameters: none 3701 Encoding considerations: encoded as JSON (UTF-8), which is 8-bit 3702 text. This media type may require encoding on transports not capable 3703 of handling 8-bit text. See Section 7.1 for more information. 3705 Security considerations: See Section 12. 3707 Compression: this media type does not employ compression. 3709 Interoperability considerations: There are no byte-ordering issues 3710 since files are 8-bit text. Applications could encounter 3711 unrecognized keys, which SHOULD be ignored. 3713 Published specification: see Section 7.1. 3715 Applications that use this media type: Multimedia applications such 3716 as the iPhone media player in iOS 15.0 and later and QuickTime Player 3717 in macOS Monterey and later. 3719 Fragment identifier considerations: no Fragment Identifiers are 3720 defined for this media type. 3722 Query parameter considerations: the definition of all query 3723 parameters for resources of this media type which begin with the 3724 string "_HLS_" are reserved by this specification. Currently-defined 3725 query parameters are specified in Section 7.2. 3727 Additional information: 3729 Deprecated alias names for this type: none 3730 Magic number(s): none 3731 File extension(s): .json (see Section 7.1) 3732 Macintosh file type code(s): none 3734 Person & email address to contact for further information: David 3735 Singer, singer AT apple.com. 3737 Intended usage: LIMITED USE 3739 Restrictions on usage: none 3741 Author: Roger Pantos 3743 Change Controller: David Singer 3745 12. Security Considerations 3747 Since the protocol generally uses HTTP to transfer data, most of the 3748 same security considerations apply. See Section 15 of HTTP 3749 [RFC7230]. 3751 Media file parsers are typically subject to "fuzzing" attacks. 3752 Implementors SHOULD pay particular attention to code that will parse 3753 data received from a server and ensure that all possible inputs are 3754 handled correctly. 3756 Playlist files contain URIs, which clients will use to make network 3757 requests of arbitrary entities. Clients SHOULD range-check responses 3758 to prevent buffer overflows. See also the Security Considerations 3759 section of "Uniform Resource Identifier (URI): Generic Syntax" 3760 [RFC3986]. 3762 Apart from URI resolution, this format does not employ any form of 3763 active content. 3765 Clients SHOULD limit each playback session to a reasonable number of 3766 concurrent downloads (for example, four) to avoid contributing to 3767 denial-of-service attacks. 3769 HTTP requests often include session state ("cookies"), which may 3770 contain private user data. Implementations MUST follow cookie 3771 restriction and expiry rules specified by "HTTP State Management 3772 Mechanism" [RFC6265] to protect themselves from attack. See also the 3773 Security Considerations section of that document, and "Use of HTTP 3774 State Management" [RFC2964]. 3776 Encryption keys are specified by URI. The delivery of these keys 3777 SHOULD be secured by a mechanism such as HTTP Over TLS [RFC2818] 3778 (formerly SSL) in conjunction with a secure realm or a session token. 3780 13. References 3782 13.1. Normative References 3784 [AC_3] Advanced Television Systems Committee, "Digital Audio 3785 Compression (AC-3) (E-AC-3)", ATSC Standard A/52:2010, 3786 November 2010, <http://atsc.org/wp- 3787 content/uploads/2015/03/A52-201212-17.pdf>. 3789 [AES_128] National Institute of Standards and Technology, "Advanced 3790 Encryption Standard (AES)", FIPS PUB 197, DOI 3791 10.6028/NIST.FIPS.197, November 2001, 3792 <http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197.pdf>. 3794 [CEA608] Consumer Technology Association, "Line 21 Data Services", 3795 ANSI/CTA Standard 608-E, April 2008, 3796 <https://standards.cta.tech/kwspub/published_docs/ANSI- 3797 CTA-608-E-R-2014-Preview.pdf>. 3799 [CEA708] Consumer Technology Association, "Digital Television (DTV) 3800 Closed Captioning", ANSI/CTA Standard CEA-708-E, August 3801 2013, <https://standards.cta.tech/kwspub/published_docs/ 3802 ANSI-CTA-708-E-Preview.pdf>. 3804 [CICP] International Organization for Standardization, 3805 "Information technology - MPEG systems technologies - Part 3806 8: Coding-independent code points", ISO/IEC International 3807 Standard 23001-8:2016, 2016, <https://www.iso.org/obp/ 3808 ui/#iso:std:iso-iec:23001:-8:ed-2:v1:en>. 3810 [CMAF] International Organization for Standardization, 3811 "Information technology -- Multimedia application format 3812 (MPEG-A) -- Part 19: Common media application format 3813 (CMAF) for segmented media", ISO/IEC International 3814 Standard 23000-19:2017, December 2017, 3815 <https://www.iso.org/standard/71975.html>. 3817 [COMMON_ENC] 3818 International Organization for Standardization, 3819 "Information technology -- MPEG systems technologies -- 3820 Part 7: Common encryption in ISO base media file format 3821 files", ISO/IEC International Standard 23001-7:2016, 3822 February 2016, <http://www.iso.org/iso/ 3823 catalogue_detail.htm?csnumber=68042>. 3825 [H_264] International Telecommunications Union, "Advanced video 3826 coding for generic audiovisual services", January 2012, 3827 <http://www.itu.int/rec/T-REC-H.264>. 3829 [HDCP] Digital Content Protection LLC, "High-bandwidth Digital 3830 Content Protection System - Mapping HDCP to HDMI", 3831 February 2013, <http://www.digital- 3832 cp.com/sites/default/files/specifications/ 3833 HDCP%20on%20HDMI%20Specification%20Rev2_2_Final1.pdf>. 3835 [IMSC1] W3C, "TTML Profiles for Internet Media Subtitles and 3836 Captions 1.0 (IMSC1)", April 2016, 3837 <https://www.w3.org/TR/ttml-imsc1/>. 3839 [ISO_13818] 3840 International Organization for Standardization, "Generic 3841 coding of moving pictures and associated audio 3842 information", ISO/IEC International Standard 13818:2007, 3843 October 2007, 3844 <http://www.iso.org/iso/catalogue_detail?csnumber=44169>. 3846 [ISO_13818_3] 3847 International Organization for Standardization, "Generic 3848 coding of moving pictures and associated audio information 3849 -- Part 3: Audio", ISO/IEC International 3850 Standard 13818-3:1998, April 1998, 3851 <http://www.iso.org/iso/home/store/catalogue_tc/ 3852 catalogue_detail.htm?csnumber=26797>. 3854 [ISO_13818_7] 3855 International Organization for Standardization, "Generic 3856 coding of moving pictures and associated audio information 3857 -- Part 7: Advanced Audio Coding (AAC)", ISO/IEC 3858 International Standard 13818-7:2006, January 2006, 3859 <http://www.iso.org/iso/home/store/catalogue_tc/ 3860 catalogue_detail.htm?csnumber=43345>. 3862 [ISO_14496] 3863 International Organization for Standardization, 3864 "Information technology -- Coding of audio-visual objects 3865 -- Part 3: Audio", ISO/IEC International 3866 Standard 14496-3:2009, 2009, 3867 <http://www.iso.org/iso/catalogue_detail?csnumber=53943>. 3869 [ISO_8601] 3870 International Organization for Standardization, "Data 3871 elements and interchange formats -- Information 3872 interchange -- Representation of dates and times", ISO/IEC 3873 International Standard 8601:2004, December 2004, 3874 <http://www.iso.org/iso/catalogue_detail?csnumber=40874>. 3876 [ISOBMFF] International Organization for Standardization, 3877 "Information technology -- Coding of audio-visual objects 3878 -- Part 12: ISO base media file format", ISO/IEC 3879 International Standard 14496-12:2015, December 2015, 3880 <http://www.iso.org/iso/ 3881 catalogue_detail.htm?csnumber=68960>. 3883 [MP4_TIMED_TEXT] 3884 International Organization for Standardization, 3885 "Information technology -- Coding of audio-visual objects 3886 -- Part 30: Timed text and other visual overlays in ISO 3887 base media file format", ISO/IEC International 3888 Standard 14496-30:2014, March 2014, 3889 <https://www.iso.org/standard/63107.html>. 3891 [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 3892 Extensions (MIME) Part Two: Media Types", RFC 2046, 3893 DOI 10.17487/RFC2046, November 1996, 3894 <https://www.rfc-editor.org/info/rfc2046>. 3896 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 3897 Requirement Levels", BCP 14, RFC 2119, 3898 DOI 10.17487/RFC2119, March 1997, 3899 <https://www.rfc-editor.org/info/rfc2119>. 3901 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, 3902 DOI 10.17487/RFC2818, May 2000, 3903 <https://www.rfc-editor.org/info/rfc2818>. 3905 [RFC2964] Moore, K. and N. Freed, "Use of HTTP State Management", 3906 BCP 44, RFC 2964, DOI 10.17487/RFC2964, October 2000, 3907 <https://www.rfc-editor.org/info/rfc2964>. 3909 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 3910 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November 3911 2003, <https://www.rfc-editor.org/info/rfc3629>. 3913 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 3914 Resource Identifier (URI): Generic Syntax", STD 66, 3915 RFC 3986, DOI 10.17487/RFC3986, January 2005, 3916 <https://www.rfc-editor.org/info/rfc3986>. 3918 [RFC5646] Phillips, A., Ed. and M. Davis, Ed., "Tags for Identifying 3919 Languages", BCP 47, RFC 5646, DOI 10.17487/RFC5646, 3920 September 2009, <https://www.rfc-editor.org/info/rfc5646>. 3922 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 3923 RFC 5652, DOI 10.17487/RFC5652, September 2009, 3924 <https://www.rfc-editor.org/info/rfc5652>. 3926 [RFC6265] Barth, A., "HTTP State Management Mechanism", RFC 6265, 3927 DOI 10.17487/RFC6265, April 2011, 3928 <https://www.rfc-editor.org/info/rfc6265>. 3930 [RFC6381] Gellens, R., Singer, D., and P. Frojdh, "The 'Codecs' and 3931 'Profiles' Parameters for "Bucket" Media Types", RFC 6381, 3932 DOI 10.17487/RFC6381, August 2011, 3933 <https://www.rfc-editor.org/info/rfc6381>. 3935 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 3936 Protocol (HTTP/1.1): Message Syntax and Routing", 3937 RFC 7230, DOI 10.17487/RFC7230, June 2014, 3938 <https://www.rfc-editor.org/info/rfc7230>. 3940 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 3941 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 3942 May 2017, <https://www.rfc-editor.org/info/rfc8174>. 3944 [RFC8216] Pantos, R., Ed. and W. May, "HTTP Live Streaming", 3945 RFC 8216, DOI 10.17487/RFC8216, August 2017, 3946 <https://www.rfc-editor.org/info/rfc8216>. 3948 [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 3949 Interchange Format", STD 90, RFC 8259, 3950 DOI 10.17487/RFC8259, December 2017, 3951 <https://www.rfc-editor.org/info/rfc8259>. 3953 [RFC8673] Pratt, C., Thakore, D., and B. Stark, "HTTP Random Access 3954 and Live Content", RFC 8673, DOI 10.17487/RFC8673, 3955 November 2019, <https://www.rfc-editor.org/info/rfc8673>. 3957 [SCTE35] Society of Cable Telecommunications Engineers, "Digital 3958 Program Insertion Cueing Message for Cable", ANSI/SCTE 35, 3959 August 2014, <http://www.scte.org/documents/pdf/Standards/ 3960 ANSI_SCTE%2035%202014.pdf>. 3962 [US_ASCII] 3963 American National Standards Institute, "Coded Character 3964 Sets - 7-Bit American National Standard Code for 3965 Information Interchange (7-Bit ASCII)", ANSI X3.4, 3966 December 1986. 3968 [WebVTT] World Wide Web Consortium (W3C), ""WebVTT: The Web Video 3969 Text Tracks Format", Draft Community Group Report", July 3970 2013, <http://dev.w3.org/html5/webvtt/>. 3972 13.2. Informative References 3974 [ID3] ID3.org, "The ID3 audio file data tagging format", 3975 <http://www.id3.org/Developer_Information>. 3977 [M3U] "M3U (MP3 URL)", <http://wikipedia.org/wiki/M3U>. 3979 [MCT] Apple Inc., "QuickTime File Format Specification - Media 3980 Characteristic Tags", <https://developer.apple.com/library 3981 /archive/documentation/QuickTime/QTFF/QTFFChap2/ 3982 qtff2.html>. 3984 [SampleEnc] 3985 Apple Inc., "MPEG-2 Stream Encryption Format for HTTP Live 3986 Streaming", 3987 <https://developer.apple.com/library/ios/documentation/ 3988 AudioVideo/Conceptual/HLS_Sample_Encryption/>. 3990 [UNICODE] The Unicode Consortium, "The Unicode Standard", 3991 <https://www.unicode.org/versions/latest/>. 3993 Appendix A. Changes from RFC 8216 3995 Several changes have been made since the publication of RFC 8216 3996 [RFC8216]. 3998 A "Multivariant Playlist" was formerly called a "Master Playlist". 4000 The following tags have been added: EXT-X-GAP, EXT-X-BITRATE, EXT-X- 4001 SERVER-CONTROL, EXT-X-SKIP, EXT-X-PART-INF, EXT-X-PART, EXT-X- 4002 PRELOAD-HINT, EXT-X-RENDITION-REPORT, and EXT-X-CONTENT-STEERING. 4004 The EXT-X-DEFINE tag was introduced to support variable substitution. 4006 IMSC has been added to the set of recognized subtitle formats. 4008 The VIDEO-RANGE, ALLOWED-CPC, STABLE-VARIANT-ID, and PATHWAY-ID 4009 attributes have been added to the EXT-X-STREAM-INF and EXT-X-I-FRAME- 4010 STREAM-INF tags. 4012 The STABLE-RENDITION-ID attribute has been added to the EXT-X-MEDIA 4013 tag. 4015 TYPE-1 has been added as a defined value for the HDCP-LEVEL 4016 attribute. 4018 Redefined the CHANNELS attribute value. 4020 The minimum new segment publication latency has been removed from 4021 server timing model. 4023 The Availability Duration of a Media Segment now depends on the 4024 presence of an EXT-X-ENDLIST tag. 4026 The recommended playlist offset to join a live stream has changed. 4028 The minimum delay before reloading a Playlist file has changed. 4030 The definition of peak segment bit rate was changed to ensure every 4031 segment is included in at least one contiguous set. 4033 Media Metadata tags such as EXT-X-DATERANGE may be removed from 4034 playlists. 4036 Partial Segments were defined as a means to reduce publishing 4037 latency. 4039 Delivery Directives were introduced, including support for Playlist 4040 Delta Updates and Blocking Playlist Reload. 4042 A Low-Latency Server Configuration Profile was added to Appendix B. 4044 Correct the reference for the semantics of the CHARACTERISTICS 4045 attribute. 4047 Appendix C was added. 4049 Content Steering (Section 7) was defined to allow alternate Pathways 4050 to the presentation. 4052 The IANA media type vnd.apple.steering-list (Section 11.2) was added. 4054 Interstitials (Appendix D) were defined to simplify inserting bumpers 4055 or advertising content. 4057 The type enumerated-string-list was added to the possible 4058 AttributeValues. 4060 There have been a number of minor editorial changes. 4062 Appendix B. Server Configuration Profiles 4064 Server Configuration Profiles specify additional requirements that 4065 optimize delivery of HTTP Live Streaming for certain use cases. 4067 B.1. Low-Latency Server Configuration Profile 4069 Playing at a reduced delay from live requires certain stream and 4070 transport features to support the timely delivery of media. Clients 4071 SHOULD verify that the server meets these requirements before playing 4072 at a delay-from-live of less than two Target Durations. Because the 4073 Low-Latency extensions are additions rather than replacements, 4074 clients can and SHOULD fall back to regular-latency playback if they 4075 discover that the server does not meet the requirements of this 4076 configuration profile. 4078 This profile places the following requirements on stream production: 4080 All Media Playlists have EXT-X-PROGRAM-DATE-TIME tags. This 4081 allows more-precise mapping between Segments across Renditions. 4082 Note that real-time clocks are NOT required to be synchronized 4083 between client and server. 4085 Each (non-Partial) Media Segment in a Media Playlist will contain 4086 at least one independent frame. 4088 A Playlist that contains an EXT-X-PART tag but no EXT-X-ENDLIST 4089 tag will also contain an EXT-X-PRELOAD-HINT tag that specifies the 4090 next Partial Segment that is expected to be added to the Playlist. 4092 If the Partial Segment specified by an EXT-X-PRELOAD-HINT tag has 4093 a different Media Initialization Section than the last Partial 4094 Segment in the Playlist, the Playlist will also contain an EXT-X- 4095 PRELOAD-HINT tag with TYPE=MAP that hints the Media Initialization 4096 Section of the hinted Partial Segment. 4098 Each Media Playlist contains one EXT-X-RENDITION-REPORT tag for 4099 each Media Playlist (Rendition) in the Multivariant Playlist, 4100 except for the Media Playlist to which the EXT-X-RENDITION-REPORT 4101 tag is being added, and Playlists that contain the EXT-X-I-FRAMES- 4102 ONLY tag. 4104 This profile places the following requirements on stream delivery: 4106 HTTP-delivered Playlists and Segments are served via HTTP/2. 4107 Efficient delivery requires HTTP/2 priority control (dependencies 4108 and weights) and support for Ping frames. 4110 Each server offers the entire set of Variant Streams in the 4111 Multivariant Playlist. This allows rapid bit rate switching 4112 without connection reestablishment. 4114 Servers support HTTP Range requests if Media Playlists contain the 4115 BYTERANGE, BYTERANGE-START, or BYTERANGE-LENGTH attributes. 4117 TCP connections support Selective Acknowledgment (SACK) across the 4118 entire route from client to server. This improves the performance 4119 of TCP loss recovery 4121 Playlist requests are idempotent. 4123 Playlists are delivered in GZIP format. This speeds up Media 4124 Playlist reload and Rendition switching. 4126 All Renditions in a Multivariant Playlist are updated in sync, 4127 within an accuracy of one Part Target Duration. 4129 CDNs and other proxy caches recognize blocking requests for 4130 Playlists and Media Segments whose cache fill is already pending, 4131 and hold the duplicate requests until they can be delivered from 4132 that cache fill. This minimizes the load on the active origin. 4134 HTTP caches used to deliver Playlists or Segments will set the Age 4135 HTTP Response header. 4137 In addition, the following configurations are recommended: 4139 TCP connections should set Explicit Congestion Notification (ECN) 4140 during congestion. They should also use TCP timestamps, TAIL LOSS 4141 probe, and TCP RACK. These configurations improve the performance 4142 of TCP loss recovery. See RFC 2018, RFC 3168, RFC 7323, and IETF 4143 draft-ietf-tcpm-rack for more information about these TCP options. 4145 Servers should support TLS 1.3 or higher. This reduces time to 4146 connect. Servers should also support TLS 1.3 0-RTT connections 4147 for Media Playlists and Media Segments. 4149 Blocking Playlist Reload allows longer caching of Playlists 4150 without detriment to Clients. Successful responses to blocking 4151 Playlist requests should be cached for six Target Durations. 4152 Unsuccessful responses (such as 404s) should be cached for four 4153 Target Durations. Successful responses to non-blocking Playlist 4154 requests should be cached for half the Target Duration. 4155 Unsuccessful responses to non-blocking Playlist requests should be 4156 cached for for one Target Duration. 4158 Successful responses to blocking Media segment requests should be 4159 cached for six Target Durations. Unsuccessful responses should be 4160 cached for one Target Duration. 4162 Origin servers should use Cache-Control headers to communicate the 4163 desired cache lifetime. 4165 The recommended Target Duration is six seconds. 4167 The recommended GOP size is between one and two seconds. Smaller 4168 GOPs allow faster switching between Renditions. 4170 Appendix C. Low-Latency CDN Tune-in 4172 Clients SHOULD support delivery of low-latency streams through CDNs 4173 and other HTTP caches. Correctly implementing PART-HOLD-BACK, the 4174 server-recommended playback delay from live, requires that the client 4175 first obtain a reasonably up-to-date version of the Media Playlist. 4177 There are various approaches that a client may take to obtain a 4178 recent version of a Media Playlist. The following algorithm 4179 typically requires two Playlist requests to obtain a Playlist that is 4180 within one Part Target Duration of the current Playlist: 4182 1. Send a request for the Media Playlist that does not include an 4183 _HLS_msn or _HLS_part directive. 4185 2. Record the first Playlist response, including its received time 4186 and Age header. If there's no Age header in the first Playlist 4187 response, consider the Playlist to be up to date. (No Age header 4188 means that the response came directly from the origin, rather 4189 than being held for a period of time in an intervening HTTP 4190 cache.) 4192 3. If there is an Age header in the first Playlist response, set the 4193 goalDuration to match the Age value. Increase the goalDuration 4194 by one second if the Part Target Duration is less than 1.0. 4196 4. While the Age value is greater than or equal to the floor of the 4197 Part Target Duration: 4199 A. Set currentGoal to be the goalDuration plus the amount of 4200 time since the first Playlist response. 4202 B. If the current version of the Playlist has at least 4203 currentGoal more media in it than the first Playlist, 4204 consider the current Playlist to be up to date. 4206 C. Use the Target Duration and the Part Target Duration to 4207 estimate how many more segments and parts the server will add 4208 to the Playlist to contribute at least currentGoal more media 4209 to it. 4211 D. Request the Media Playlist again, using the _HLS_msn and 4212 _HLS_part directives to obtain the Playlist that has the 4213 estimated additional duration of media since the first 4214 Playlist. 4216 E. Update the current Playlist and the Age value from the 4217 Playlist response. 4219 Appendix D. Interstitials 4221 Content vendors can insert separate interstitial content into their 4222 primary presentations in order to display advertising, branding, or 4223 other information to viewers. 4225 D.1. Overview 4227 Servers can schedule interstitials by placing EXT-X-DATERANGE tags 4228 into the Media Playlists of the primary asset. 4230 Interstitials themselves are self-contained media assets. They can 4231 be scheduled anywhere on the timeline of a primary media asset. 4232 While interstitials MUST be VOD assets, they can be scheduled against 4233 either VOD or live primary content (including Low-Latency HLS streams 4234 (Appendix B.1)). 4236 Interstitials are specified by URI. The client SHOULD load the 4237 resource specified by the URI after it buffers the primary asset to 4238 the scheduled interstitial playback time. This allows for late 4239 binding to interstitial content. Since an interstitial is described 4240 by a single URI, a server can respond to it with a limited number of 4241 HTTP redirects without a major impact on performance. 4243 An interstitial request can either be for a single interstitial asset 4244 or a list of assets. In the second case, the composition of the list 4245 MAY be determined when the server responds to the interstitial 4246 request. 4248 Each interstitial asset is a Playlist, usually a Multivariant 4249 Playlist. The primary media asset and the interstitial asset both 4250 provide sets of Variant Streams. The two sets MAY have different 4251 characteristics. The bit rates of the Variant Streams of the 4252 interstital asset may not exactly match those of the primary asset, 4253 but they SHOULD allow for effective bit rate adaptation in similar 4254 network conditions. It is RECOMMENDED that the set of languages in 4255 Rendition Groups of a specific type within the interstitial asset 4256 match those used in the primary media asset. Interstitials MAY use 4257 the different codecs from the primary content, although using 4258 different codecs will cause transition delays on certain devices. 4260 Devices that do not implement HLS interstitial support SHOULD ignore 4261 server-generated interstitial events when playing a primary asset. 4263 Interstitials scheduled inside other interstitials MUST be ignored by 4264 clients. 4266 D.2. EXT-X-DATERANGE Schema for Interstitials 4268 The server MAY insert EXT-X-DATERANGE tags according to the rules in 4269 this section to tell the client to schedule interstitial playback. 4271 An Interstitial EXT-X-DATERANGE tag MUST have a CLASS attribute whose 4272 value is "com.apple.hls.interstitial". This class defines the 4273 following attributes: 4275 X-ASSET-URI 4277 The value of the X-ASSET-URI is a quoted-string absolute URI for a 4278 single interstitial asset. An Interstitial EXT-X-DATERANGE tag 4279 MUST have either the X-ASSET-URI attribute or the X-ASSET-LIST 4280 attribute. It MUST NOT have both. 4282 X-ASSET-LIST 4284 The value of the X-ASSET-LIST is a quoted-string URI to a JSON 4285 object. 4287 The JSON object MUST contain a key/value pair whose key is 4288 "ASSETS" and whose value is a JSON array of Asset-Description JSON 4289 objects. (Note that keys in a JSON object are case-sensitive.) 4291 Each Asset-Description JSON object MUST have a "URI" member whose 4292 value is a quoted-string absolute URI for a single interstitial 4293 asset, and a "DURATION" member whose value is a decimal-floating- 4294 point indicating the duration of the interstitial asset in 4295 seconds. 4297 The client SHOULD play the interstitial assets back-to-back in the 4298 order that they appear in the ASSETS array. 4300 X-RESUME-OFFSET 4302 The value of X-RESUME-OFFSET is a decimal-floating-point of 4303 seconds that specifies where primary playback is to resume 4304 following the playback of the interstitial. It is expressed as a 4305 time offset from where the interstitial playback was scheduled on 4306 the primary player timeline. A typical value for X-RESUME-OFFSET 4307 is zero. This attribute is OPTIONAL. 4309 If the X-RESUME-OFFSET is not present, its value is considered to 4310 be the duration of the interstitial. This is appropriate for live 4311 content, where playback is to be kept at a constant delay from the 4312 live edge, or for VOD playback where the HLS interstitial is 4313 intended to exactly replace content in the primary asset. 4315 X-PLAYOUT-LIMIT 4317 The value of X-PLAYOUT-LIMIT is a decimal-floating-point of 4318 seconds that specifies a limit for the playout time of the entire 4319 interstitial. If it is present, the client SHOULD end the 4320 interstitial if playback reaches that offset from its start. 4321 Otherwise the interstitial MUST end upon reaching the end of the 4322 interstitial asset(s). This attribute is OPTIONAL. 4324 X-SNAP 4326 The value of the X-SNAP attribute is an enumerated-string-list of 4327 Snap Identifiers. The defined Snap Identifiers are: OUT and IN. 4328 This attribute is OPTIONAL. 4330 If the list contains OUT then the client SHOULD locate the segment 4331 boundary closest to the START-DATE of the interstitial in the 4332 Media Playlist of the primary content and transition to the 4333 interstitial at that boundary. If more than one Media Playlist is 4334 contributing to playback (audio plus video for example), the 4335 client SHOULD transition at the earliest segment boundary. 4337 If the list contains IN then the client SHOULD locate the segment 4338 boundary closest to the scheduled resumption point from the 4339 interstitial in the Media Playlist of the primary content and 4340 resume playback of primary content at that boundary. If more than 4341 one Media Playlist is contributing to playback, the client SHOULD 4342 transition at the latest segment boundary. 4344 X-RESTRICT 4345 The value of the X-RESTRICT attribute is an enumerated-string-list 4346 of Navigation Restriction Identifiers. The defined Navigation 4347 Restriction Identifiers are: SKIP and JUMP. These restrictions 4348 are enforced at the player UI level. This attribute is OPTIONAL. 4350 If the list contains SKIP then while the interstitial is being 4351 played, the client MUST NOT allow the user to seek forward from 4352 the current playhead position or set the rate to greater than the 4353 regular playback rate until playback reaches the end of the 4354 interstitial. 4356 If the list contains JUMP then the client MUST NOT allow the user 4357 to seek from a position in the primary asset earlier than the 4358 START-DATE attribute to a position after it without first playing 4359 the interstitial asset, even if the interstitial at START-DATE was 4360 played through earlier. If the user attempts to seek across more 4361 than one interstitial, the client SHOULD choose at least one 4362 interstitial to play before allowing the seek to complete. 4364 X-<client-attribute> 4366 Client-defined attributes are allowed. See the discussion under 4367 EXT-X-DATERANGE (Section 4.4.5.1). 4369 A client with specific knowledge of the presentation rules for an 4370 asset MAY override restrictions specified by the X-RESTRICT attribute 4371 if such an action is consistent with those rules. 4373 Two or more interstitials scheduled at the same START-DATE SHOULD be 4374 played in the order that their EXT-X-DATERANGE tags appear in the 4375 playlist. In that case, X-RESUME-OFFSET values are cumulative. 4377 D.3. Interstitial query parameters 4379 Packagers producing Interstitial EXT-X-DATERANGE tags SHOULD ensure 4380 that X-ASSET-URI and X-ASSET-LIST requests contain an 4381 _HLS_interstitial_id query parameter whose value is the (quoted) ID 4382 attribute value of the EXT-X-DATERANGE tag. This supports 4383 interoperability between content vendors and decisioning servers. 4385 Certain clients support setting the X-PLAYBACK-SESSION-ID request 4386 header with a common, globally-unique value on every HTTP request 4387 associated with a particular playback session. Such clients SHOULD 4388 add an _HLS_primary_id query parameter to X-ASSET-URI and X-ASSET- 4389 LIST requests whose value matches the X-PLAYBACK-SESSION-ID of the 4390 primary playback session. This provides useful context for 4391 decisioning servers. 4393 Clients that cannot set the the X-PLAYBACK-SESSION-ID request header 4394 SHOULD create a globally-unique value for every primary playback 4395 session, and provide this value as an _HLS_primary_id query parameter 4396 on both the request for the primary asset and the X-ASSET-URI and X- 4397 ASSET-LIST requests made on behalf of that asset. 4399 D.4. Client Behavior 4401 If an interstitial specifies a non-zero resume offset and the user 4402 tries to seek to a time between the start of the interstitial and its 4403 resumption point on the primary asset timeline, the client SHOULD 4404 begin playback from the start of the interstitial. 4406 If a request for either an interstitial asset URI or an asset list 4407 URI returns an error, the client SHOULD cancel playback of the 4408 interstitial with a resume offset of 0. 4410 If the JSON object returned by the asset list URI has an empty array 4411 as the value of the "ASSETS" key, the client SHOULD apply the resume 4412 offset without playing any interstitial content. 4414 Clients SHOULD allow a generous amount of time (up to a minute) for a 4415 server to respond to requests for interstitial assets or asset lists, 4416 to enable the server to perform back-end decisioning. Servers MUST 4417 respond quickly enough to avoid playback disruptions on the client. 4419 D.5. Example: Interstitial EXT-X-DATERANGE 4421 In this playlist an EXT-X-DATERANGE tag schedules a 15-second ad to 4422 play four seconds into a six-second primary asset. The client will 4423 play the interstitial and then resume playback of the primary asset 4424 where it left off. Seeking and scanning forward will be disabled 4425 during interstitial playback. The EXT-X-DATERANGE tag includes a 4426 vendor-defined beacon attribute that can be processed by the client. 4428 #EXTM3U 4429 #EXT-X-TARGETDURATION:6 4430 #EXT-X-PROGRAM-DATE-TIME:2020-01-02T21:55:40.000Z 4431 #EXTINF:6, 4432 main1.0.ts 4433 #EXT-X-ENDLIST 4434 #EXT-X-DATERANGE:ID="ad1",CLASS="com.apple.hls.interstitial", 4435 START-DATE="2020-01-02T21:55:44.000Z",DURATION=15.0, 4436 X-ASSET-URI="http://example.com/ad1.m3u8",X-RESUME-OFFSET=0, 4437 X-RESTRICT="SKIP,JUMP",X-COM-EXAMPLE-BEACON=123 4439 Author's Address 4441 Roger Pantos (editor) 4442 Apple Inc. 4443 Cupertino, California 4444 United States 4446 Email: http-live-streaming-review@group.apple.com