HLS AES-128 fMP4 broken after latest update

In Safari 13.1 / MacOS 10.15.4, Safari and tvOS (and likely iOS) no longer play our fMP4 AES-128 encrypted HLS streams. They still work in JavaScript players like Bitmovin and hls.js, and older versions of Safari. The same streams without encryption also still work fine.


It seems like our segments actually do get decrypted just fine - Safari will play the first segment (i.e. display video frames) before stopping. Seek also works, except again only one segment plays. If I manually decrypt everything using openssl, and remove the key URI from the manifest, then the playback works fine (as expected, since it's the same as a clear stream).


I suspect that something broke the combination of fMP4/CMAF + AES-128, because fMP4/CMAF + SAMPLE-AES using Common Encryption with cbcs seems to work.


Can you please fix fMP4 encrypted with AES-128?

I had a similar problem then found a message on the hls.js project indicating the spec had changed. If the #EXT-X-MAP tag follows #EXT-X-KEY tag, the initialization segment must also be encrypted.


See draft-pantos-hls-rfc8216bis-06:

The EXT-X-KEY tag specifies how to
decrypt them. It applies to every Media Segment and to every Media
Initialization Section declared by an EXT-X-MAP tag that appears
between it and the next EXT-X-KEY tag in the Playlist file with the
same KEYFORMAT attribute (or the end of the Playlist file).

Haha, that was me.


Does it work for you now on iOS 13.4 or macOS 10.15.4? If so, are you using MPEG-TS or fMP4?

It seemed like there was a stealth update (I have automatic updates turned off) that fixed it for a short time. But it is still broken on MacOS 10.15.4 (19E287) Darwin, Safari 19.4.0 13.1 (15609.1.20.111.8)


Test stream

Also seems broken on MacOS 10.15.5 Safari Version 13.1.1 (15609.2.9.1.2) and iOS 13.5.1 Safari. First segment plays, remaining ones do not.
You should file a bug and include a sample of the content you're trying to use.
Is this issue fixed? I am facing the same issue with Safari v.13.1 and above.
Same stream is working fine on Safari v.13.0.2
HLS AES-128 fMP4 broken after latest update
 
 
Q