In DRM-protected files, usually there's a Clear Lead -- the first few seconds are clear. It allows playback to start without having to wait for license response, improving video start time (and user experience).
The question is, therefore: if a stream has clear lead, will AVPlayer start playing without waiting for response from the DRM server?
**EDIT - the #EXT-X-DISCONTINUITY tag is not required, so long as the timestamp sequence, GOP etc. are continuous.
Hi Noam,
achibana's answer is mostly correct, but the one change is the potential need to insert an #EXT-X-DISCONTINUITY tag ahead of the #EXT-X-KEY tag to indicate the significant change at that point, as follows:
#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:1
#EXTINF:10,
01.ts
#EXT-X-DISCONTINUITY
#EXT-X-KEY:METHOD=SAMPLE-AES,KEYFORMAT="com.apple.streamingkeydelivery",KEYFORMATVERSIONS="1",URI="skd://1"
#EXTINF:10,
02.ts
#EXTINF:10,
03.ts
AVPlayer will start playing without waiting for the response. Would recommend the inclusion of at least one target duration, if not more.
Note that you can cause the key request to be completely asynchronous from playback using the AVContentKeySession approach, which would allow you to prefetch the keys separate from the actual playback session, which is the pattern that many developers are now taking in order to reduce complexity and dependencies at playback time.