Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlayReady+Widevine MultiDRM error cases #6947

Open
5 tasks done
cjpillsbury opened this issue Jan 6, 2025 · 1 comment · May be fixed by #6946 or #6948
Open
5 tasks done

PlayReady+Widevine MultiDRM error cases #6947

cjpillsbury opened this issue Jan 6, 2025 · 1 comment · May be fixed by #6946 or #6948

Comments

@cjpillsbury
Copy link
Collaborator

cjpillsbury commented Jan 6, 2025

What version of Hls.js are you using?

1.5.18, latest master#HEAD (Commit SHA: e346300dc, which comes after tag: v1.6.0-beta.2 commit)

What browser (including version) are you using?

Edge 131.1.0.2903.112

What OS (including version) are you using?

Windows 11 Home 24H2

Test stream

Available on request

Configuration

Available on request

Additional player setup steps

No response

Checklist

Steps to reproduce

  1. Disable Widevine on Edge via flags (See, e.g. https://learn.microsoft.com/en-us/legal/microsoft-edge/privacy#digital-rights-management-and-media-licenses)
  2. Attempt to play a multi-drm stream that has both widevine and playready where the widevine PSSH is first
  3. Note the error in playback

(NOTE: There look to be a few other places where bugs would occur, such as not providing a widevine license URL that should also be resolved.)

Expected behaviour

Playback works with MultiDRM when PlayReady is the only available DRM key system, regardless of order or other details on the media (in media playlist tags or in PSSH container boxes).

What actually happened?

Playback fails with a key system failure error.

Console output

main.js:350 Using Hls.js config: {debug: true, enableWorker: true, lowLatencyMode: true, backBufferLength: 30, capLevelToPlayerSize: true, …}
logger.ts:74 [log] > Debug logs enabled for "Hls instance" in hls.js version 1.5.18
hls.ts:446 [log] > stopLoad
hls.ts:410 [log] > loadSource:https://stream.mux.com/REDACTED_PLAYBACK_ID.m3u8?token=REDACTED_PLAYBACK_TOKEN
stream-controller.ts:579 [log] > [stream-controller]: Trigger BUFFER_RESET
hls.ts:460 [log] > resume buffering
hls.ts:380 [log] > attachMedia
buffer-controller.ts:198 [log] > [buffer-controller] created media source: MediaSource
buffer-controller.ts:995 [log] > [buffer-controller] Media source opened
level-controller.ts:337 [log] > [level-controller]: manifest loaded, 4 level(s) found, first bitrate: 2352900
abr-controller.ts:58 [log] > setting initial bwe to 2352900
buffer-controller.ts:186 [log] > [buffer-controller] 2 bufferCodec event(s) expected
cap-level-controller.ts:155 [log] > Setting autoLevelCapping to 2: 720p@2352900 for media 962.3906707763672x481.18751525878906
hls.ts:696 [log] > set autoLevelCapping:2
abr-controller.ts:701 [log] > [abr] picked start tier {"codecSet":"avc1,mp4a","videoRanges":["SDR"],"preferHDR":false,"minFramerate":0,"minBitrate":489500}
abr-controller.ts:855 [info] > [abr] switch candidate:2->2 adjustedbw(2352900)-bitrate=0 ttfb:0.1 avgDuration:0.0 maxFetchDuration:4.0 fetchDuration:0.1 firstSelection:true codecSet:avc1,mp4a videoRange:SDR hls.loadLevel:-1
hls.ts:431 [log] > startLoad(-1)
hls.ts:460 [log] > resume buffering
level-controller.ts:432 [log] > [level-controller]: Switching to level 2 (720p SDR avc1,mp4a @2352900) from level -1
audio-track-controller.ts:186 [log] > [audio-track-controller]: Updating audio tracks, 1 track(s) found in group(s): audio-hi-0
audio-track-controller.ts:332 [log] > [audio-track-controller]: Switching to audio-track 0 "German (Deutsch)" lang:de group:audio-hi-0 channels:2
base-stream-controller.ts:1668 [log] > [audio-stream-controller]: Reset loading state
base-stream-controller.ts:1810 [log] > [audio-stream-controller]: STOPPED->IDLE
base-stream-controller.ts:1810 [log] > [audio-stream-controller]: IDLE->WAITING_TRACK
subtitle-track-controller.ts:276 [log] > [subtitle-track-controller]: Updating subtitle tracks, 1 track(s) found in "sub1" group-id
level-controller.ts:600 [log] > [level-controller]: Loading level index 2 with https://manifest-gcp-us-east1-vop1.cfcdn.mux.com/REDACTED_UID/rendition.m3u8?cdn=cloudflare&expires=1763718000&skid=default&signature=REDACTED_SIGNATURE&vsid=REDACTED_VSID
base-stream-controller.ts:1810 [log] > [stream-controller]: STOPPED->IDLE
audio-track-controller.ts:422 [log] > [audio-track-controller]: loading audio-track playlist 0 "German (Deutsch)" lang:de group:audio-hi-0
base-stream-controller.ts:1810 [log] > [audio-stream-controller]: WAITING_TRACK->STOPPED
base-stream-controller.ts:1810 [log] > [audio-stream-controller]: STOPPED->WAITING_TRACK
base-stream-controller.ts:1810 [log] > [subtitle-stream-controller]: STOPPED->IDLE
audio-track-controller.ts:100 [log] > [audio-track-controller]: Audio track 0 "German (Deutsch)" lang:de group:audio-hi-0 loaded [0-20]
timeline-chart.ts:754  Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently
drawLineX @ timeline-chart.ts:754
drawCurrentTime @ timeline-chart.ts:728
afterRender @ timeline-chart.ts:73
notify @ Chart.js:8032
onComplete @ Chart.js:9785
render @ Chart.js:9811
update @ Chart.js:9681
update @ timeline-chart.ts:252
(anonymous) @ timeline-chart.ts:263
requestAnimationFrame
updateOnRepaint @ timeline-chart.ts:263
updateLevelOrTrack @ timeline-chart.ts:464
updateLevelOrTrack @ main.js:1601
emit @ index.js:203
emit @ hls.ts:310
trigger @ hls.ts:318
handlePlaylistLoaded @ playlist-loader.ts:693
handleTrackOrLevelPlaylist @ playlist-loader.ts:505
onSuccess @ playlist-loader.ts:319
readystatechange @ xhr-loader.ts:238
XMLHttpRequest.send
openAndSendXhr @ xhr-loader.ts:165
loadInternal @ xhr-loader.ts:124
load @ xhr-loader.ts:82
load @ playlist-loader.ts:352
onAudioTrackLoading @ playlist-loader.ts:182
emit @ index.js:182
emit @ hls.ts:310
trigger @ hls.ts:318
loadPlaylist @ audio-track-controller.ts:426
startLoad @ base-playlist-controller.ts:47
startLoad @ hls.ts:435
filterAndSortMediaOptions @ level-controller.ts:376
onManifestLoaded @ level-controller.ts:200
emit @ index.js:203
emit @ hls.ts:310
trigger @ hls.ts:318
handleMasterPlaylist @ playlist-loader.ts:429
onSuccess @ playlist-loader.ts:327
readystatechange @ xhr-loader.ts:238
XMLHttpRequest.send
openAndSendXhr @ xhr-loader.ts:165
loadInternal @ xhr-loader.ts:124
load @ xhr-loader.ts:82
load @ playlist-loader.ts:352
onManifestLoading @ playlist-loader.ts:154
emit @ index.js:203
emit @ hls.ts:310
trigger @ hls.ts:318
loadSource @ hls.ts:420
loadSelectedStream @ main.js:383
(anonymous) @ main.js:225
j @ jquery.min.js:2
fireWith @ jquery.min.js:2
ready @ jquery.min.js:2
I @ jquery.min.js:2
[NEW] Explain Console errors by using Copilot in Edge: click
         
         to explain an error. 
        Learn more
        Don't show again
stream-controller.ts:642 [log] > [stream-controller]: Level 2 loaded [0,20][part-20--1], cc [0, 0] duration:103.64
buffer-controller.ts:862 [log] > [buffer-controller] Updating Media Source duration to 103.640
base-stream-controller.ts:669 [log] > [stream-controller]: Loading key for initSegment of [0-20], level 2
base-stream-controller.ts:1810 [log] > [stream-controller]: IDLE->KEY_LOADING
eme-controller.ts:392 [log] > [eme] Selecting key-system from fragment (sn: initSegment main: 2) key formats urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed, com.microsoft.playready, com.apple.streamingkeydelivery
eme-controller.ts:260 [log] > [eme] Requesting encrypted media "com.widevine.alpha" key-system access with config: [{"initDataTypes":["cenc"],"persistentState":"optional","distinctiveIdentifier":"optional","sessionTypes":["temporary"],"audioCapabilities":[{"contentType":"audio/mp4; codecs=\"mp4a.40.2\"","robustness":"","encryptionScheme":null}],"videoCapabilities":[{"contentType":"video/mp4; codecs=\"avc1.64001e\"","robustness":"","encryptionScheme":null},{"contentType":"video/mp4; codecs=\"avc1.64001f\"","robustness":"","encryptionScheme":null},{"contentType":"video/mp4; codecs=\"avc1.640020\"","robustness":"","encryptionScheme":null},{"contentType":"video/mp4; codecs=\"avc1.64002a\"","robustness":"","encryptionScheme":null}]}]
eme-controller.ts:241  It is recommended that a robustness level be specified. Not specifying the robustness level could result in unexpected behavior.
requestMediaKeySystemAccess$1 @ eme-controller.ts:241
getMediaKeysPromise @ eme-controller.ts:265
attempt @ eme-controller.ts:198
(anonymous) @ eme-controller.ts:220
attemptKeySystemAccess @ eme-controller.ts:188
getKeySystemSelectionPromise @ eme-controller.ts:527
(anonymous) @ eme-controller.ts:412
getKeyFormatPromise @ eme-controller.ts:405
selectKeySystemFormat @ eme-controller.ts:397
load @ key-loader.ts:118
_doFragLoad @ base-stream-controller.ts:676
_loadInitSegment @ base-stream-controller.ts:489
loadFragment @ stream-controller.ts:375
doTickIdle @ stream-controller.ts:359
doTick @ stream-controller.ts:211
tick @ task-loop.ts:106
onLevelLoaded @ stream-controller.ts:699
emit @ index.js:203
emit @ hls.ts:310
trigger @ hls.ts:318
handlePlaylistLoaded @ playlist-loader.ts:683
handleTrackOrLevelPlaylist @ playlist-loader.ts:505
onSuccess @ playlist-loader.ts:319
readystatechange @ xhr-loader.ts:238
XMLHttpRequest.send
openAndSendXhr @ xhr-loader.ts:165
loadInternal @ xhr-loader.ts:124
load @ xhr-loader.ts:82
load @ playlist-loader.ts:352
onLevelLoading @ playlist-loader.ts:166
emit @ index.js:203
emit @ hls.ts:310
trigger @ hls.ts:318
loadPlaylist @ level-controller.ts:614
set @ level-controller.ts:481
set @ level-controller.ts:633
set @ hls.ts:581
startLoad @ stream-controller.ts:143
startLoad @ hls.ts:435
filterAndSortMediaOptions @ level-controller.ts:376
onManifestLoaded @ level-controller.ts:200
emit @ index.js:203
emit @ hls.ts:310
trigger @ hls.ts:318
handleMasterPlaylist @ playlist-loader.ts:429
onSuccess @ playlist-loader.ts:327
readystatechange @ xhr-loader.ts:238
XMLHttpRequest.send
openAndSendXhr @ xhr-loader.ts:165
loadInternal @ xhr-loader.ts:124
load @ xhr-loader.ts:82
load @ playlist-loader.ts:352
onManifestLoading @ playlist-loader.ts:154
emit @ index.js:203
emit @ hls.ts:310
trigger @ hls.ts:318
loadSource @ hls.ts:420
loadSelectedStream @ main.js:383
(anonymous) @ main.js:225
j @ jquery.min.js:2
fireWith @ jquery.min.js:2
ready @ jquery.min.js:2
I @ jquery.min.js:2
base-stream-controller.ts:767 [log] > [stream-controller]: Loading fragment initSegment cc: 0 of [0-20] level: 2, target: 0
base-stream-controller.ts:1810 [log] > [stream-controller]: KEY_LOADING->FRAG_LOADING
audio-track-controller.ts:100 [log] > [audio-track-controller]: Audio track 0 "German (Deutsch)" lang:de group:audio-hi-0 loaded [0-20]
audio-stream-controller.ts:520 [log] > [audio-stream-controller]: Audio track 0 loaded [0,20][part-20--1],duration:103.64
base-stream-controller.ts:1810 [log] > [audio-stream-controller]: WAITING_TRACK->IDLE
base-stream-controller.ts:767 [log] > [audio-stream-controller]: Loading fragment initSegment cc: 0 of [0-20] track: 0, target: 0
base-stream-controller.ts:1810 [log] > [audio-stream-controller]: IDLE->FRAG_LOADING
eme-controller.ts:274 [log] > [eme] Failed to obtain access to key-system "com.widevine.alpha": NotSupportedError: Unsupported keySystem or supportedConfigurations.
eme-controller.ts:260 [log] > [eme] Requesting encrypted media "com.microsoft.playready" key-system access with config: [{"initDataTypes":["cenc"],"persistentState":"optional","distinctiveIdentifier":"optional","sessionTypes":["temporary"],"audioCapabilities":[{"contentType":"audio/mp4; codecs=\"mp4a.40.2\"","robustness":"","encryptionScheme":null}],"videoCapabilities":[{"contentType":"video/mp4; codecs=\"avc1.64001e\"","robustness":"","encryptionScheme":null},{"contentType":"video/mp4; codecs=\"avc1.64001f\"","robustness":"","encryptionScheme":null},{"contentType":"video/mp4; codecs=\"avc1.640020\"","robustness":"","encryptionScheme":null},{"contentType":"video/mp4; codecs=\"avc1.64002a\"","robustness":"","encryptionScheme":null}]}]
eme-controller.ts:279 [log] > [eme] Access for key-system "com.microsoft.playready" obtained
eme-controller.ts:285 [log] > [eme] Create media-keys for "com.microsoft.playready"
eme-controller.ts:289 [log] > [eme] Media-keys created for "com.microsoft.playready"
eme-controller.ts:433 [log] > [eme] Starting session for key (keyId: REDACTED format: "com.microsoft.playready" method: SAMPLE-AES uri: data:text/plain;charset=UTF-16;base64,REDACTED)
eme-controller.ts:441 [log] > [eme] Handle encrypted media sn: initSegment main: 2 using key (keyId: REDACTED format: "com.microsoft.playready" method: SAMPLE-AES uri: data:text/plain;charset=UTF-16;base64,REDACTED)
eme-controller.ts:674 [log] > [eme] Setting media-keys for "com.microsoft.playready"
eme-controller.ts:687 [log] > [eme] Media-keys set for "com.microsoft.playready"
eme-controller.ts:323 [log] > [eme] Creating key-system session "com.microsoft.playready" keyId: REDACTED
eme-controller.ts:734 [log] > [eme] Generating key-session request for "playlist-key": REDACTED (init data type: cenc length: 478)
base-stream-controller.ts:1810 [log] > [audio-stream-controller]: FRAG_LOADING->IDLE
base-stream-controller.ts:767 [log] > [audio-stream-controller]: Loading fragment 0 cc: 0 of [0-20] track: 0, target: 0
base-stream-controller.ts:1810 [log] > [audio-stream-controller]: IDLE->FRAG_LOADING
eme-controller.ts:834 [log] > [eme] Request generated for key-session "R591REnBR8hZlwrPPnnonQ==" keyId: REDACTED
eme-controller.ts:749 [log] > [eme] "license-request" message event for session "R591REnBR8hZlwrPPnnonQ==" message size: 26414
eme-controller.ts:1115 [log] > [eme] Sending license request to URL: https://license.mux.com/license/playready/REDACTED_PLAYBACK_ID?token=REDACTED_DRM_TOKEN
transmuxer-interface.ts:88 [log] > injecting Web Worker for "audio"
audio-stream-controller.ts:639 [log] > [audio-stream-controller]: Unknown video PTS for cc 0, waiting for video PTS before demuxing audio frag 0 of [0 ,20],track 0
base-stream-controller.ts:1810 [log] > [audio-stream-controller]: FRAG_LOADING->WAITING_INIT_PTS
base-stream-controller.ts:398 [log] > [audio-stream-controller]: Loaded fragment 0 of level 0
5bfbef50-df37-4755-8d8c-803bd1b81513:555 [log] > Debug logs enabled for "audio" in hls.js version 1.5.18
eme-controller.ts:1126 [log] > [eme] License received 3437
eme-controller.ts:380 [log] > [eme] Updating key-session "R591REnBR8hZlwrPPnnonQ==" for keyID REDACTED
      } (data length: 3437)
eme-controller.ts:864 [log] > [eme] key status change "usable" for keyStatuses keyId: REDACTED session keyId: REDACTED uri: data:text/plain;charset=UTF-16;base64,REDACTED
base-stream-controller.ts:1810 [log] > [stream-controller]: FRAG_LOADING->IDLE
base-stream-controller.ts:669 [log] > [stream-controller]: Loading key for 0 of [0-20], level 2
base-stream-controller.ts:1810 [log] > [stream-controller]: IDLE->KEY_LOADING
base-stream-controller.ts:767 [log] > [stream-controller]: Loading fragment 0 cc: 0 of [0-20] level: 2, target: 0
base-stream-controller.ts:1810 [log] > [stream-controller]: KEY_LOADING->FRAG_LOADING
eme-controller.ts:864 [log] > [eme] key status change "usable" for keyStatuses keyId: REDACTED session keyId: REDACTED uri: data:text/plain;charset=UTF-16;base64,REDACTED
eme-controller.ts:864 [log] > [eme] key status change "usable" for keyStatuses keyId: REDACTED session keyId: REDACTED uri: data:text/plain;charset=UTF-16;base64,REDACTED
transmuxer-interface.ts:88 [log] > injecting Web Worker for "main"
transmuxer-interface.ts:230 [log] > [transmuxer-interface, main]: Starting new transmux session for sn: 0 p: -1 level: 2 id: 1
        discontinuity: true
        trackSwitch: true
        contiguous: false
        accurateTimeOffset: true
        timeOffset: 0
        initSegmentChange: true
base-stream-controller.ts:398 [log] > [stream-controller]: Loaded fragment 0 of level 2
c4f54fec-9aff-4254-aa7c-38f6c70c91c3:555 [log] > Debug logs enabled for "main" in hls.js version 1.5.18
base-stream-controller.ts:1810 [log] > [stream-controller]: FRAG_LOADING->PARSING
stream-controller.ts:1317 [log] > [stream-controller]: Init video buffer, container:video/mp4, codecs[level/parsed]=[avc1.640020/avc1.640020]
buffer-controller.ts:394 [log] > [buffer-controller] 1 bufferCodec event(s) expected video
audio-stream-controller.ts:134 [log] > [audio-stream-controller]: InitPTS for cc: 0 found from main: 0.04
base-stream-controller.ts:1810 [log] > [audio-stream-controller]: WAITING_INIT_PTS->FRAG_LOADING
transmuxer-interface.ts:230 [log] > [transmuxer-interface, audio]: Starting new transmux session for sn: 0 p: -1 level: 0 id: 1
        discontinuity: true
        trackSwitch: true
        contiguous: false
        accurateTimeOffset: false
        timeOffset: 0
        initSegmentChange: true
transmuxer-interface.ts:394 [log] > [transmuxer.ts]: Flushed fragment 0 of level 2
base-stream-controller.ts:1810 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:1810 [log] > [audio-stream-controller]: FRAG_LOADING->PARSING
audio-stream-controller.ts:902 [log] > [audio-stream-controller]: Init audio buffer, container:audio/mp4, codecs[level/parsed]=[mp4a.40.2/mp4a.40.2]
buffer-controller.ts:394 [log] > [buffer-controller] 0 bufferCodec event(s) expected audio
buffer-controller.ts:944 [log] > [buffer-controller] creating sourceBuffer(video/mp4;codecs=avc1.640020)
buffer-controller.ts:944 [log] > [buffer-controller] creating sourceBuffer(audio/mp4;codecs=mp4a.40.2)
stream-controller.ts:853 [log] > [stream-controller]: Alternate track found, use video.buffered to schedule main fragment loading
transmuxer-interface.ts:394 [log] > [transmuxer.ts]: Flushed fragment 0 of level 0
base-stream-controller.ts:1810 [log] > [audio-stream-controller]: PARSING->PARSED
eme-controller.ts:479  [error] > [eme] Unsupported keySystem or supportedConfigurations.
handleError @ eme-controller.ts:479
(anonymous) @ eme-controller.ts:661
Promise.catch
_onMediaEncrypted @ eme-controller.ts:661
base-stream-controller.ts:1810 [log] > [stream-controller]: PARSED->ERROR
base-stream-controller.ts:1810 [log] > [audio-stream-controller]: PARSED->ERROR
hls.ts:446 [log] > stopLoad
base-stream-controller.ts:1810 [log] > [stream-controller]: ERROR->STOPPED
base-stream-controller.ts:1810 [log] > [audio-stream-controller]: ERROR->STOPPED
base-stream-controller.ts:1810 [log] > [subtitle-stream-controller]: IDLE->STOPPED
main.js:745  Error event: {type: 'keySystemError', details: 'keySystemNoAccess', error: NotSupportedError: Unsupported keySystem or supportedConfigurations., fatal: true, err: NotSupportedError: Unsupported keySystem or supportedConfigurations.}
(anonymous) @ main.js:745
emit @ index.js:203
emit @ hls.ts:310
trigger @ hls.ts:318
handleError @ eme-controller.ts:481
(anonymous) @ eme-controller.ts:661
Promise.catch
_onMediaEncrypted @ eme-controller.ts:661
main.js:858  Fatal error : keySystemNoAccess
(anonymous) @ main.js:858
emit @ index.js:203
emit @ hls.ts:310
trigger @ hls.ts:318
handleError @ eme-controller.ts:481
(anonymous) @ eme-controller.ts:661
Promise.catch
_onMediaEncrypted @ eme-controller.ts:661
hls.ts:357 [log] > destroy
hls.ts:389 [log] > detachMedia
buffer-controller.ts:246 [log] > [buffer-controller] media source detaching
buffer-controller.ts:255  [warn] > [buffer-controller] onMediaDetaching: Failed to execute 'endOfStream' on 'MediaSource': The 'updating' attribute is true on one or more of this MediaSource's SourceBuffers. while calling endOfStream
onMediaDetaching @ buffer-controller.ts:255
emit @ index.js:203
emit @ hls.ts:310
trigger @ hls.ts:318
detachMedia @ hls.ts:390
destroy @ hls.ts:359
(anonymous) @ main.js:869
emit @ index.js:203
emit @ hls.ts:310
trigger @ hls.ts:318
handleError @ eme-controller.ts:481
(anonymous) @ eme-controller.ts:661
Promise.catch
_onMediaEncrypted @ eme-controller.ts:661
hls.ts:460 [log] > resume buffering
eme-controller.ts:1297 [log] > [eme] Remove licenses and keys and close session R591REnBR8hZlwrPPnnonQ==
eme-controller.ts:1329 [log] > [eme] Could not remove session: InvalidStateError: Failed to execute 'remove' on 'MediaKeySession': Remove failed (2154823695)
eme-controller.ts:1253 [log] > [eme] finished closing key sessions and clearing media keys

Chrome media internals output

No response

@cjpillsbury cjpillsbury added Bug Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels Jan 6, 2025
@robwalch robwalch added the DRM label Jan 6, 2025
robwalch added a commit that referenced this issue Jan 8, 2025
@robwalch robwalch added Confirmed and removed Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels Jan 8, 2025
@robwalch robwalch added this to the 1.6.0 milestone Jan 8, 2025
@robwalch
Copy link
Collaborator

robwalch commented Jan 8, 2025

Marking as 1.6.0 for now. Let me know if you need this in a patch as 1.6 is slated for end of Feb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment