Unsupported HLS KEYFORMAT com.apple.streamkingkeydelivery
See original GitHub issueHave you read the FAQ and checked for duplicate open issues?: YES
What version of Shaka Player are you using?: 2.5.4
Can you reproduce the issue with our latest release version?: YES
Can you reproduce the issue with the latest code from master?: YES
Are you using the demo app or your own custom app?: NO
If custom app, can you reproduce the issue using our demo app?:
What browser and OS are you using?: Safari 12.1.2 on macOS 10.14.6
What are the manifest and license server URIs?:
manifest: https://.../manifests/hls/master.m3u8
license: ${this.baseUrl}/items${id}/drm/fairplay
What did you do? Tried to play normal HLS
What did you expect to happen? Video should be played
What actually happened? The documentation seems pretty minimal as the support was just added, but this is what I have thus far
Configuration
player.configure({
drm: {
servers: {
'com.widevine.alpha': `${this.baseUrl}/items/${id}/drm/widevine`,
'com.microsoft.playready': `${this.baseUrl}/items/${id}/drm/playready`,
'com.apple.fps.1_0': `${this.baseUrl}/items${id}/drm/fairplay`,
},
advanced: {
'com.apple.fps.1_0': {
serverCertificate: fairplayUtils.fetchCertificate(),
},
},
},
});
...
load(streamUrl) {
const url = 'https://.../manifests/hls/master.m3u8'
player
.load(url, null, shaka.hls.HlsParser)
.then(() => { ... }
.catch((e) => { ... }
I am passing in the master.m3u8 into the load function and get the following error
Error from Shaka Player
Error {
category: 4
code: 4026
data: [] (0)
handled: false
message: "Shaka Error MANIFEST.HLS_KEYFORMATS_NOT_SUPPORTED ()"
severity: 2
stack: ...
}
Looking at shaka player’s errors (honestly the best error codes I have seen from a third party)
it says HLS_KEYFORMATS_NOT_SUPPORTED | 4026 | The HLS parser has encountered encrypted content with unsupported KEYFORMAT attributes.
I then modified my webpack to use the debug version of shaka-player (config.resolve.alias = { 'shaka-player': require.resolve('shaka-player/dist/shaka-player.compiled.debug.js'), }) and modify the imports (import { shaka } from 'shaka-player';) and get the additional errors
[Warning] Unsupported HLS KEYFORMAT – "com.apple.streamingkeydelivery" (0fd27489a42d02c11796.js, line 209516)
[Warning] The walker saw an error: (0fd27489a42d02c11796.js, line 209812)
[Warning] Error Code: – 4026 (0fd27489a42d02c11796.js, line 209813)
The master.m3u8 returns a few prog_index.m3u8 endpoints and the highest resolution of them gets called. The response from: manifests/hls/...stuff.../prog_index.m3u8 endpoint is where the com.apple.streamingkeydelivery is coming from with #EXT-X-KEY
#EXTM3U
#EXT-X-VERSION:7
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-KEY:KEYFORMAT="com.apple.streamingkeydelivery",METHOD=SAMPLE-AES,URI="..."
#EXT-X-MEDIA-SEQUENCE:1
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-TARGETDURATION:10
#EXT-X-MAP:BYTERANGE="857@0",URI=".../...mp4"
#EXTINF:9.57867,
#EXT-X-BYTERANGE:160142@...//...mp4
#EXT-X-ENDLIST
Questions
- Is the
KEYFORMATwrong in this response? - In Issue #896, one response was that
SAMPLE-AESwas not supported with widevine, is it supported with HLS? - Is there any additional configuration that needs to be done to support this
KEYFORMAT? - Is this perhaps related to #1625 and/or #850 ? Though it says it is
AES, notAES-128, but I haven’t looked up the difference yet
Relates to #382 ?
Any help is appreciated! Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (7 by maintainers)

Top Related StackOverflow Question
Your
fetchCertificatemethod returns aPromise. You need to wait for it to complete. For example:We only support FairPlay through native
src=playback, we don’t support it through MSE playback. If you don’t pass the third argument toload, we’ll default to usingsrc=and it should work fine. You should also look at the new FairPlay tutorial if you are having any trouble setting upsrc=playback.