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

Unable to play some streams in Edge browser on RxPlayer v3.30.0 #1289

Open
jakubjereczek opened this issue Sep 26, 2023 · 13 comments
Open

Unable to play some streams in Edge browser on RxPlayer v3.30.0 #1289

jakubjereczek opened this issue Sep 26, 2023 · 13 comments

Comments

@jakubjereczek
Copy link

Issue observed on Micosoft Edge browser, when running on Windows 11.

After updating the RxPlayer form v3.2.9 to v3.3.0 there seems to be an issue with streaming using Flussonic or VSPP platform.

The stream does not play and the following errors appear:
rx-player.js:5263 Compat: error while calling 'generateRequest' with an empty initialization data type. Retrying with a default "cenc" value. TypeError: Failed to execute 'generateRequest' on 'MediaKeySession': The initDataType parameter is empty.

rx-player.js:53355 API: The player stopped because of an error EncryptedMediaError: EncryptedMediaError (KEY_GENERATE_REQUEST_ERROR) InvalidStateError: Failed to execute 'generateRequest' on 'MediaKeySession': The session is already initialized.

I noticed that similar error message has been already reported (but different case): #1259

@wioletta-dreszler
Copy link

We have collected logs for this issue:

Init: Creating ContentDecryptor
DRM: Starting ContentDecryptor logic.
DRM: Searching for compatible MediaKeySystemAccess
DRM: Request keysystem access com.microsoft.playready.recommendation,1 of 4
DRM: Found compatible keysystem com.microsoft.playready.recommendation 1
DRM: Calling createMediaKeys on the MediaKeySystemAccess
DRM: MediaKeys created with success
Init: Creating MediaSource
Init: Attaching MediaSource URL to the media element blob:http://localhost:3000/be9aae42-1ff1-4ef2-921d-89f4a38c4e29
DRM: Attaching current MediaKeys
DRM: Attaching MediaKeys to the media element
DRM: MediaKeys attached with success
DASH: WASM MPD Parser not initialized. Running JS one.
MF: Manifest parsed in 1.2999999523162842ms
Init: Calculating initial time
Init: clock offset found for a live content, checking if we can start close to it
Init: 2259865.000699997 defined as the live time, applying a live gap of 13
Init: Initial time calculated: 2259852.000699997
Init: Resume playback speed 1
Init: Updating duration 4294967296
Stream: Creating new Stream for video 0
Stream: Updating video adaptation A: 2 P: 0
SB: Adding native SegmentBuffer with codec video/mp4;codecs="avc1.4d0015"
Stream: Creating new Stream for audio 0
Stream: Updating audio adaptation A: 1 P: 0
SB: Adding native SegmentBuffer with codec audio/mp4;codecs="mp4a.40.2"
Stream: Creating new Stream for text 0
Stream: Set no text Adaptation. P: 0
Stream: Creating new Stream for image 0
Stream: Set no image Adaptation. P: 0
ABR: Creating new BandwidthEstimator for  video
ABR: Steps for buffer based chooser. bufferLevel: 0, bitrate: 201000 ,bufferLevel: 7.249197180425938, bitrate: 401000 ,bufferLevel: 12.3310975460084, bitrate: 801000 ,bufferLevel: 16.549464579103773, bitrate: 1199000 ,bufferLevel: 20.388200714368345, bitrate: 2398000 ,bufferLevel: 24.95380713822056, bitrate: 4005000
ABR: enter starvation mode.
ABR: Choosing representation with bandwidth estimation. 1199000 tracks-v3
Stream: changing representation video tracks-v3 1199000
Stream: Media segments now need to be requested. Starting queue. video 3
SF: Beginning request video P: 1693476723 A: 2 R: tracks-v3 S: 2259847.855-6
SF: Beginning request video P: 1693476723 A: 2 R: tracks-v3 S: init
ABR: Creating new BandwidthEstimator for  audio
Stream: changing representation audio tracks-a1 99000
Stream: Media segments now need to be requested. Starting queue. audio 3
SF: Beginning request audio P: 1693476723 A: 1 R: tracks-a1 S: 2259847.855-6
SF: Beginning request audio P: 1693476723 A: 1 R: tracks-a1 S: init
DRM: Creating a new temporary session
DRM-LSS: Add MediaKeySession temporary
DRM: Binding session events 
DRM: Init data already processed. Skipping it.
Compat: Calling generateRequest on the MediaKeySession
Compat: Trying to move CENC PSSH from init data at the end of it.
AVSB: receiving order to push data to the SourceBuffer video 
AVSB: updating codec video/mp4;codecs="avc1.4d001e"
AVSB: pushing segment video 
Stream: no more init segment to request. Cancelling queue. video
SF: Segment request cancelled video P: 1693476723 A: 2 R: tracks-v3 S: init
SF: Segment request ended with success video P: 1693476723 A: 2 R: tracks-v3 S: init
AVSB: receiving order for validating end of segment video video P: 1693476723 A: 2 R: tracks-v3 S: init
AVSB: Acknowledging complete segment video P: 1693476723 A: 2 R: tracks-v3 S: init
ABR: Choosing representation with bandwidth estimation. 1199000 tracks-v3
AVSB: receiving order to push data to the SourceBuffer audio 
AVSB: pushing segment audio 
Stream: no more init segment to request. Cancelling queue. audio
SF: Segment request cancelled audio P: 1693476723 A: 1 R: tracks-a1 S: init
SF: Segment request ended with success audio P: 1693476723 A: 1 R: tracks-a1 S: init
AVSB: receiving order for validating end of segment audio audio P: 1693476723 A: 1 R: tracks-a1 S: init
AVSB: Acknowledging complete segment audio P: 1693476723 A: 1 R: tracks-a1 S: init
API: current media element state tick event loadedmetadata position 0 seeking false internalSeek null rebuffering false freezing false ended false paused true playbackRate 1 readyState 1
API: current playback timeline:

^0 
loadedmetadata
ABR: Choosing representation with bandwidth estimation. 1199000 tracks-v3
Init: Set initial time 2259852.000699997
Init: Can begin to play content
API: current media element state tick event internal-seeking position 2259852.000699 seeking true internalSeek 2259852.000699997 rebuffering true freezing false ended false paused false playbackRate 1 readyState 1
API: current playback timeline:

^2259852.000699 
seeking
ABR: Choosing representation with bandwidth estimation. 1199000 tracks-v3
Init: Pause playback to build buffer
API: current media element state tick event play position 2259852.000699 seeking true internalSeek 2259852.000699997 rebuffering true freezing false ended false paused false playbackRate 0 readyState 1
API: current playback timeline:

^2259852.000699 
play
ABR: Choosing representation with bandwidth estimation. 1199000 tracks-v3
API: current media element state tick event ratechange position 2259852.000699 seeking true internalSeek 2259852.000699997 rebuffering true freezing false ended false paused false playbackRate 0 readyState 1
API: current playback timeline:

^2259852.000699 
ratechange
ABR: Choosing representation with bandwidth estimation. 1199000 tracks-v3
AVSB: receiving order to push data to the SourceBuffer audio audio P: 1693476723 A: 1 R: tracks-a1 S: 2259847.855-6
AVSB: pushing segment audio audio P: 1693476723 A: 1 R: tracks-a1 S: 2259847.855-6
SF: Segment request ended with success audio P: 1693476723 A: 1 R: tracks-a1 S: 2259847.855-6
AVSB: receiving order for validating end of segment audio audio P: 1693476723 A: 1 R: tracks-a1 S: 2259847.855-6
ABR: New last stable representation 99000
SF: Beginning request audio P: 1693476723 A: 1 R: tracks-a1 S: 2259853.855-6
SI: first segment pushed audio 2259847.8763333336 2259853.8710000003
AVSB: Acknowledging complete segment audio P: 1693476723 A: 1 R: tracks-a1 S: 2259847.855-6
SI: found true buffered start audio 2259847.876333 2259847.8763333336
SI: found true buffered end audio 2259853.870999 2259853.8710000003
DRM: Encrypted event received from media element.
DRM: Creating a new temporary session
DRM-LSS: Add MediaKeySession temporary
DRM: Binding session events 
Compat: Calling generateRequest on the MediaKeySession
Compat: Trying to move CENC PSSH from init data at the end of it.
Compat: error while calling `generateRequest` with an empty initialization data type. Retrying with a default "cenc" value. TypeError: Failed to execute 'generateRequest' on 'MediaKeySession': The initDataType parameter is empty.
SF: Segment request cancelled audio P: 1693476723 A: 1 R: tracks-a1 S: 2259853.855-6
SF: Segment request cancelled video P: 1693476723 A: 2 R: tracks-v3 S: 2259847.855-6
SB: Aborting SegmentBuffer audio
SB: Aborting SegmentBuffer video
Init: Removing SourceBuffer from mediaSource
Init: Removing SourceBuffer from mediaSource
Init: Revoking previous URL
Locking `contentLock` to clean-up the current content.
DRM: Clearing-up DRM session.
DRM: Nothing to clear. Returning right away. No state = false
API: The player stopped because of an error EncryptedMediaError: EncryptedMediaError (KEY_GENERATE_REQUEST_ERROR) InvalidStateError: Failed to execute 'generateRequest' on 'MediaKeySession': The session is already initialized.
API: playerStateChange event STOPPED
API: DRM session cleaned-up with success!
Unlocking `contentLock`. Next content can begin.
Locking `contentLock` to clean-up the current content.
DRM: Clearing-up DRM session.
DRM: Nothing to clear. Returning right away. No state = false
API: DRM session cleaned-up with success!
Unlocking `contentLock`. Next content can begin.
SF: Segment request aborted audio P: 1693476723 A: 1 R: tracks-a1 S: 2259853.855-6
SF: Segment request aborted video P: 1693476723 A: 2 R: tracks-v3 S: 2259847.855-6

@peaBerberian
Copy link
Collaborator

Thank you. So it seems there are two issues, the TypeError: Failed to execute 'generateRequest' on 'MediaKeySession': The initDataType parameter is empty. , for which we're apparently able to fallback but the second generateRequest leads to a InvalidStateError: Failed to execute 'generateRequest' on 'MediaKeySession': The session is already initialized..

I guess Edge is telling us the first time that initialization didn't work and the second time with a safer strat that initialization cannot be retried as it was already performed! Some usual EME shenanigans :P.

Like for the issue you linked, the fact that we're first calling generateRequest with an empty init data type surprises me, I'm not sure of the scenario where this is possible. Apparently we here relied on the encrypted event received from the browser (DRM: Encrypted event received from media element.) which means that somehow Edge saw something about the content's encryption we didn't already see, in an unannounced format.
I'm curious of what Edge is doing here and on which data it based itself to produce that encrypted event (usually it's the segment's pssh box for .mp4 contents, but those are already handled and patched out by the RxPlayer).

Just some initial checks to ensure the RxPlayer is able to tell these are mp4 segments (I guess they are). Are the audio Representation (or AdaptationSet depending) have an "audio/mp4" mime-type in the MPD? Same question with video Representation (or AdaptationSet) with the "video/mp4" mime-type?

If no, then the most probable base issue could be that first the RxPlayer doesn't extract the PSSH as it doesn't know those are mp4 segments, and then when Edge does it, it does not announce (or does but differently than expected) that it is in the "cenc" initDataType.

If yes, then I'm very curious of what that "encrypted" event is based on, it may be possible that it is just unneeded ignorable noise. I guess in that case we will look closer at what this is by base64-ing the data in logs.

The two situations would have different work-arounds.

@jakubjereczek
Copy link
Author

Manifest Audio Representation <AdaptationSet> and Video Representation <AdaptationSet> have mineType "audio/mp4"

Full Manifest:

<?xml version="1.0" encoding="UTF-8"?>
<MPD id='dash' type="dynamic" xmlns="urn:mpeg:dash:schema:mpd:2011"
  xmlns:cenc="urn:mpeg:cenc:2013"
  xmlns:mspr="urn:microsoft:playready"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd"
  profiles="urn:mpeg:dash:profile:isoff-live:2011"
  minBufferTime="PT13S"
  suggestedPresentationDelay="PT13S"
  availabilityStartTime="2023-08-31T10:12:03Z"
  publishTime="2023-09-28T10:46:28Z"
  minimumUpdatePeriod="PT4.2S"
  maxSegmentDuration="PT7S"
  timeShiftBufferDepth="PT24S">
    <Period id='1693476723' start="PT0S" >
        <AdaptationSet id="2" mimeType="video/mp4" contentType="video" maxWidth="1280" maxHeight="720" par="1280:720"  maxFrameRate="25" segmentAlignment="true" startWithSAP="1" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
            <!-- Common Encryption -->
            <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="448bd518-f06e-4d68-aa07-f566bf974a0e"/>
            <!-- widevine -->
            <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" value="Widevine">
              <cenc:pssh>AAAAWXBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAADkIARIQRIvVGPBuTWiqB/Vmv5dKDhoLc3RyZWFtZ3JvdXAiEBjVi0Ru8GhNqgf1Zr+XSg4qAlNEMgA=</cenc:pssh>
            </ContentProtection>
            <!-- playready -->
            <ContentProtection schemeIdUri="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95" value="Microsoft PlayReady">
              <cenc:pssh>AAACmHBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAAnh4AgAAAQABAG4CPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBHAE4AVwBMAFIARwA3AHcAYQBFADIAcQBCAC8AVgBtAHYANQBkAEsARABnAD0APQA8AC8ASwBJAEQAPgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcAA6AC8ALwBpAGQAeAAuAHMAbwBsAG8AYwBvAG8ALgB0AHYALwBpAGQAeAAvAGQAcgBtAC4AYQBzAHAAeAAvAHAAcgAvAHMAZwA8AC8ATABBAF8AVQBSAEwAPgA8AEMASABFAEMASwBTAFUATQA+AHQAMQB1AEgAMQAzAE0AVQAzAHcAOAA9ADwALwBDAEgARQBDAEsAUwBVAE0APgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AA==</cenc:pssh>
              <mspr:pro>eAIAAAEAAQBuAjwAVwBSAE0ASABFAEEARABFAFIAIAB4AG0AbABuAHMAPQAiAGgAdAB0AHAAOgAvAC8AcwBjAGgAZQBtAGEAcwAuAG0AaQBjAHIAbwBzAG8AZgB0AC4AYwBvAG0ALwBEAFIATQAvADIAMAAwADcALwAwADMALwBQAGwAYQB5AFIAZQBhAGQAeQBIAGUAYQBkAGUAcgAiACAAdgBlAHIAcwBpAG8AbgA9ACIANAAuADAALgAwAC4AMAAiAD4APABEAEEAVABBAD4APABQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsARQBZAEwARQBOAD4AMQA2ADwALwBLAEUAWQBMAEUATgA+ADwAQQBMAEcASQBEAD4AQQBFAFMAQwBUAFIAPAAvAEEATABHAEkARAA+ADwALwBQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsASQBEAD4ARwBOAFcATABSAEcANwB3AGEARQAyAHEAQgAvAFYAbQB2ADUAZABLAEQAZwA9AD0APAAvAEsASQBEAD4APABMAEEAXwBVAFIATAA+AGgAdAB0AHAAOgAvAC8AaQBkAHgALgBzAG8AbABvAGMAbwBvAC4AdAB2AC8AaQBkAHgALwBkAHIAbQAuAGEAcwBwAHgALwBwAHIALwBzAGcAPAAvAEwAQQBfAFUAUgBMAD4APABDAEgARQBDAEsAUwBVAE0APgB0ADEAdQBIADEAMwBNAFUAMwB3ADgAPQA8AC8AQwBIAEUAQwBLAFMAVQBNAD4APAAvAEQAQQBUAEEAPgA8AC8AVwBSAE0ASABFAEEARABFAFIAPgA=</mspr:pro>
            </ContentProtection>
            <Representation id="tracks-v1" width="1280" height="720" sar="1:1" frameRate="25" bandwidth="3997000" codecs="avc1.4d001f">
              <SegmentTemplate initialization="tracks-v1/init.m4v" media="tracks-v1/seg-1693476723-$Number$.m4v?t=$Time$" timescale="1000"  startNumber="550956">
                 <SegmentTimeline>
                   <S t="2421241855" d="6000" r="3"/>
                 </SegmentTimeline>
              </SegmentTemplate>
            </Representation>
            <Representation id="tracks-v2" width="1024" height="576" sar="1:1" frameRate="25" bandwidth="2402000" codecs="avc1.4d001f">
              <SegmentTemplate initialization="tracks-v2/init.m4v" media="tracks-v2/seg-1693476723-$Number$.m4v?t=$Time$" timescale="1000"  startNumber="550956">
                 <SegmentTimeline>
                   <S t="2421241855" d="6000" r="3"/>
                 </SegmentTimeline>
              </SegmentTemplate>
            </Representation>
            <Representation id="tracks-v3" width="850" height="480" sar="1:1" frameRate="25" bandwidth="1202000" codecs="avc1.4d001e">
              <SegmentTemplate initialization="tracks-v3/init.m4v" media="tracks-v3/seg-1693476723-$Number$.m4v?t=$Time$" timescale="1000"  startNumber="550956">
                 <SegmentTimeline>
                   <S t="2421241855" d="6000" r="3"/>
                 </SegmentTimeline>
              </SegmentTemplate>
            </Representation>
            <Representation id="tracks-v4" width="682" height="384" sar="1:1" frameRate="25" bandwidth="807000" codecs="avc1.4d001e">
              <SegmentTemplate initialization="tracks-v4/init.m4v" media="tracks-v4/seg-1693476723-$Number$.m4v?t=$Time$" timescale="1000"  startNumber="550956">
                 <SegmentTimeline>
                   <S t="2421241855" d="6000" r="3"/>
                 </SegmentTimeline>
              </SegmentTemplate>
            </Representation>
            <Representation id="tracks-v5" width="512" height="288" sar="1:1" frameRate="25" bandwidth="402000" codecs="avc1.4d0015">
              <SegmentTemplate initialization="tracks-v5/init.m4v" media="tracks-v5/seg-1693476723-$Number$.m4v?t=$Time$" timescale="1000"  startNumber="550956">
                 <SegmentTimeline>
                   <S t="2421241855" d="6000" r="3"/>
                 </SegmentTimeline>
              </SegmentTemplate>
            </Representation>
            <Representation id="tracks-v6" width="426" height="240" sar="1:1" frameRate="25" bandwidth="201000" codecs="avc1.4d0015">
              <SegmentTemplate initialization="tracks-v6/init.m4v" media="tracks-v6/seg-1693476723-$Number$.m4v?t=$Time$" timescale="1000"  startNumber="550956">
                 <SegmentTimeline>
                   <S t="2421241855" d="6000" r="3"/>
                 </SegmentTimeline>
              </SegmentTemplate>
            </Representation>
        </AdaptationSet>
        <AdaptationSet id="1" mimeType="audio/mp4" contentType="audio" lang="dut" segmentAlignment="true" startWithSAP="1">
            <!-- Common Encryption -->
            <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="448bd518-f06e-4d68-aa07-f566bf974a0e"/>
            <!-- widevine -->
            <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" value="Widevine">
              <cenc:pssh>AAAAWXBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAADkIARIQRIvVGPBuTWiqB/Vmv5dKDhoLc3RyZWFtZ3JvdXAiEBjVi0Ru8GhNqgf1Zr+XSg4qAlNEMgA=</cenc:pssh>
            </ContentProtection>
            <!-- playready -->
            <ContentProtection schemeIdUri="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95" value="Microsoft PlayReady">
              <cenc:pssh>AAACmHBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAAnh4AgAAAQABAG4CPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBHAE4AVwBMAFIARwA3AHcAYQBFADIAcQBCAC8AVgBtAHYANQBkAEsARABnAD0APQA8AC8ASwBJAEQAPgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcAA6AC8ALwBpAGQAeAAuAHMAbwBsAG8AYwBvAG8ALgB0AHYALwBpAGQAeAAvAGQAcgBtAC4AYQBzAHAAeAAvAHAAcgAvAHMAZwA8AC8ATABBAF8AVQBSAEwAPgA8AEMASABFAEMASwBTAFUATQA+AHQAMQB1AEgAMQAzAE0AVQAzAHcAOAA9ADwALwBDAEgARQBDAEsAUwBVAE0APgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AA==</cenc:pssh>
              <mspr:pro>eAIAAAEAAQBuAjwAVwBSAE0ASABFAEEARABFAFIAIAB4AG0AbABuAHMAPQAiAGgAdAB0AHAAOgAvAC8AcwBjAGgAZQBtAGEAcwAuAG0AaQBjAHIAbwBzAG8AZgB0AC4AYwBvAG0ALwBEAFIATQAvADIAMAAwADcALwAwADMALwBQAGwAYQB5AFIAZQBhAGQAeQBIAGUAYQBkAGUAcgAiACAAdgBlAHIAcwBpAG8AbgA9ACIANAAuADAALgAwAC4AMAAiAD4APABEAEEAVABBAD4APABQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsARQBZAEwARQBOAD4AMQA2ADwALwBLAEUAWQBMAEUATgA+ADwAQQBMAEcASQBEAD4AQQBFAFMAQwBUAFIAPAAvAEEATABHAEkARAA+ADwALwBQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsASQBEAD4ARwBOAFcATABSAEcANwB3AGEARQAyAHEAQgAvAFYAbQB2ADUAZABLAEQAZwA9AD0APAAvAEsASQBEAD4APABMAEEAXwBVAFIATAA+AGgAdAB0AHAAOgAvAC8AaQBkAHgALgBzAG8AbABvAGMAbwBvAC4AdAB2AC8AaQBkAHgALwBkAHIAbQAuAGEAcwBwAHgALwBwAHIALwBzAGcAPAAvAEwAQQBfAFUAUgBMAD4APABDAEgARQBDAEsAUwBVAE0APgB0ADEAdQBIADEAMwBNAFUAMwB3ADgAPQA8AC8AQwBIAEUAQwBLAFMAVQBNAD4APAAvAEQAQQBUAEEAPgA8AC8AVwBSAE0ASABFAEEARABFAFIAPgA=</mspr:pro>
            </ContentProtection>
            <Representation id="tracks-a1" audioSamplingRate="48000" bandwidth="99000" codecs="mp4a.40.2">
              <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
              <SegmentTemplate initialization="tracks-a1/init.m4v" media="tracks-a1/seg-1693476723-$Number$.m4v?t=$Time$" timescale="1000"  startNumber="550956">
                 <SegmentTimeline>
                   <S t="2421241855" d="6000" r="3"/>
                 </SegmentTimeline>
              </SegmentTemplate>
            </Representation>
        </AdaptationSet>
    </Period>
    <UTCTiming schemeIdUri="urn:mpeg:dash:utc:direct:2014" value="2023-09-28T10:46:28Z" />
</MPD>

@peaBerberian
Copy link
Collaborator

OK, so it does have it...

Well, we may want to see what those encrypted events are about.

We could add our own event listener in a console that just output the given data here, can you write in the console before playback something like:

const base64abc = [
    "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
    "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
    "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
    "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
    "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "/",
];
function bytesToBase64(bytes) {
    let result = "";
    let i;
    const length = bytes.length;
    for (i = 2; i < length; i += 3) {
        result += base64abc[bytes[i - 2] >> 2];
        result += base64abc[((bytes[i - 2] & 0x03) << 4) | (bytes[i - 1] >> 4)];
        result += base64abc[((bytes[i - 1] & 0x0F) << 2) | (bytes[i] >> 6)];
        result += base64abc[bytes[i] & 0x3F];
    }
    if (i === length + 1) { // 1 octet yet to write
        result += base64abc[bytes[i - 2] >> 2];
        result += base64abc[(bytes[i - 2] & 0x03) << 4];
        result += "==";
    }
    if (i === length) { // 2 octets yet to write
        result += base64abc[bytes[i - 2] >> 2];
        result += base64abc[((bytes[i - 2] & 0x03) << 4) | (bytes[i - 1] >> 4)];
        result += base64abc[(bytes[i - 1] & 0x0F) << 2];
        result += "=";
    }
    return result;
}

document.querySelector("video").addEventListener("encrypted", function (evt) {
  console.log("Stringified encrypted event:", JSON.stringify(evt));
  console.log("Base64-encoded init Data:", bytesToBase64(new Uint8Array(evt.initData)));
});

Basically it logs first the JSON-encodable format of the encrypted event linked to that issue, and then encode in a copy-pastable way the communicated data. I want to see if the latter are the expected PSSH boxes (in which case the RxPlayer did not already see them for whatever reason) or something else.

@wioletta-dreszler
Copy link

We have added this code, but there are no logs for encrypted events. For comparison, below are the logs for version 3.29.0:

Compat: Calling generateRequest on the MediaKeySession
Compat: Trying to move CENC PSSH from init data at the end of it.
AVSB: receiving order to push data to the SourceBuffer video 
AVSB: updating codec video/mp4;codecs="avc1.4d001f"
AVSB: pushing segment video 
SF: Segment request ended with success video P: 1693476723 A: 2 R: tracks-v2 S: init
AVSB: receiving order for validating end of segment video video P: 1693476723 A: 2 R: tracks-v2 S: init
AVSB: receiving order to push data to the SourceBuffer audio 
AVSB: pushing segment audio 
SF: Segment request ended with success audio P: 1693476723 A: 1 R: tracks-a1 S: init
AVSB: receiving order for validating end of segment audio audio P: 1693476723 A: 1 R: tracks-a1 S: init
AVSB: Acknowledging complete segment video P: 1693476723 A: 2 R: tracks-v2 S: init
ABR: Choosing representation with bandwidth estimation. 2398000 tracks-v2
AVSB: Acknowledging complete segment audio P: 1693476723 A: 1 R: tracks-a1 S: init
API: current media element state tick event loadedmetadata position 0 seeking false internalSeek null rebuffering false freezing false ended false paused true playbackRate 1 readyState 1
API: current playback timeline:

^0 
loadedmetadata
ABR: Choosing representation with bandwidth estimation. 2398000 tracks-v2
Init: Set initial time 2775726.108100176
Init: Can begin to play content
API: current media element state tick event internal-seeking position 2775726.1081 seeking true internalSeek 2775726.108100176 rebuffering true freezing false ended false paused false playbackRate 1 readyState 1
API: current playback timeline:

^2775726.1081 
seeking
ABR: Choosing representation with bandwidth estimation. 2398000 tracks-v2
Init: Pause playback to build buffer
API: current media element state tick event play position 2775726.1081 seeking true internalSeek 2775726.108100176 rebuffering true freezing false ended false paused false playbackRate 0 readyState 1
API: current playback timeline:

^2775726.1081 
play
ABR: Choosing representation with bandwidth estimation. 2398000 tracks-v2
API: current media element state tick event ratechange position 2775726.1081 seeking true internalSeek 2775726.108100176 rebuffering true freezing false ended false paused false playbackRate 0 readyState 1
API: current playback timeline:

^2775726.1081 
ratechange
ABR: Choosing representation with bandwidth estimation. 2398000 tracks-v2
AVSB: receiving order to push data to the SourceBuffer audio audio P: 1693476723 A: 1 R: tracks-a1 S: 2775721.855-6
AVSB: pushing segment audio audio P: 1693476723 A: 1 R: tracks-a1 S: 2775721.855-6
SF: Segment request ended with success audio P: 1693476723 A: 1 R: tracks-a1 S: 2775721.855-6
AVSB: receiving order for validating end of segment audio audio P: 1693476723 A: 1 R: tracks-a1 S: 2775721.855-6
ABR: New last stable representation 98000
SF: Beginning request audio P: 1693476723 A: 1 R: tracks-a1 S: 2775727.855-6
SI: first segment pushed audio 2775721.8603333333 2775727.876333333
AVSB: Acknowledging complete segment audio P: 1693476723 A: 1 R: tracks-a1 S: 2775721.855-6
SI: found true buffered start audio 2775721.860333 2775721.8603333333
SI: found true buffered end audio 2775727.876333 2775727.876333333
Stringified encrypted event: {"isTrusted":true}
Base64-encoded init Data: AAACmHBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAAnh4AgAAAQABAG4CPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBHAE4AVwBMAFIARwA3AHcAYQBFADIAcQBCAC8AVgBtAHYANQBkAEsARABnAD0APQA8AC8ASwBJAEQAPgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcAA6AC8ALwBpAGQAeAAuAHMAbwBsAG8AYwBvAG8ALgB0AHYALwBpAGQAeAAvAGQAcgBtAC4AYQBzAHAAeAAvAHAAcgAvAHMAZwA8AC8ATABBAF8AVQBSAEwAPgA8AEMASABFAEMASwBTAFUATQA+AHQAMQB1AEgAMQAzAE0AVQAzAHcAOAA9ADwALwBDAEgARQBDAEsAUwBVAE0APgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AAAAAFlwc3NoAAAAAO3vi6l51krOo8gn3NUdIe0AAAA5CAESEESL1Rjwbk1oqgf1Zr+XSg4aC3N0cmVhbWdyb3VwIhAY1YtEbvBoTaoH9Wa/l0oOKgJTRDIA
DRM: Encrypted event received from media element.
DRM: Init data already processed. Skipping it.
AVSB: receiving order to push data to the SourceBuffer video video P: 1693476723 A: 2 R: tracks-v2 S: 2775721.855-6
AVSB: pushing segment video video P: 1693476723 A: 2 R: tracks-v2 S: 2775721.855-6
SF: Segment request ended with success video P: 1693476723 A: 2 R: tracks-v2 S: 2775721.855-6
AVSB: receiving order for validating end of segment video video P: 1693476723 A: 2 R: tracks-v2 S: 2775721.855-6
ABR: New last stable representation 2398000
SF: Beginning request video P: 1693476723 A: 2 R: tracks-v2 S: 2775727.855-6
AVSB: receiving order to push data to the SourceBuffer audio audio P: 1693476723 A: 1 R: tracks-a1 S: 2775727.855-6
AVSB: pushing segment audio audio P: 1693476723 A: 1 R: tracks-a1 S: 2775727.855-6
SF: Segment request ended with success audio P: 1693476723 A: 1 R: tracks-a1 S: 2775727.855-6
AVSB: receiving order for validating end of segment audio audio P: 1693476723 A: 1 R: tracks-a1 S: 2775727.855-6
Stringified encrypted event: {"isTrusted":true}
Base64-encoded init Data: AAACmHBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAAnh4AgAAAQABAG4CPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBHAE4AVwBMAFIARwA3AHcAYQBFADIAcQBCAC8AVgBtAHYANQBkAEsARABnAD0APQA8AC8ASwBJAEQAPgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcAA6AC8ALwBpAGQAeAAuAHMAbwBsAG8AYwBvAG8ALgB0AHYALwBpAGQAeAAvAGQAcgBtAC4AYQBzAHAAeAAvAHAAcgAvAHMAZwA8AC8ATABBAF8AVQBSAEwAPgA8AEMASABFAEMASwBTAFUATQA+AHQAMQB1AEgAMQAzAE0AVQAzAHcAOAA9ADwALwBDAEgARQBDAEsAUwBVAE0APgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AAAAAFlwc3NoAAAAAO3vi6l51krOo8gn3NUdIe0AAAA5CAESEESL1Rjwbk1oqgf1Zr+XSg4aC3N0cmVhbWdyb3VwIhAY1YtEbvBoTaoH9Wa/l0oOKgJTRDIA
DRM: Encrypted event received from media element.
DRM: Init data already processed. Skipping it.
SI: Pushing segment strictly after previous one. audio 2775727.8763333336 2775727.876333
AVSB: Acknowledging complete segment audio P: 1693476723 A: 1 R: tracks-a1 S: 2775727.855-6
SI: found true buffered end audio 2775733.870999 2775733.8710000003
SI: current audio inventory timeline:
2775721.86|A|2775733.87
[A] P: 1693476723 || R: tracks-a1(98000)
Stringified encrypted event: {"isTrusted":true}
Base64-encoded init Data: AAACmHBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAAnh4AgAAAQABAG4CPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBHAE4AVwBMAFIARwA3AHcAYQBFADIAcQBCAC8AVgBtAHYANQBkAEsARABnAD0APQA8AC8ASwBJAEQAPgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcAA6AC8ALwBpAGQAeAAuAHMAbwBsAG8AYwBvAG8ALgB0AHYALwBpAGQAeAAvAGQAcgBtAC4AYQBzAHAAeAAvAHAAcgAvAHMAZwA8AC8ATABBAF8AVQBSAEwAPgA8AEMASABFAEMASwBTAFUATQA+AHQAMQB1AEgAMQAzAE0AVQAzAHcAOAA9ADwALwBDAEgARQBDAEsAUwBVAE0APgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AAAAAFlwc3NoAAAAAO3vi6l51krOo8gn3NUdIe0AAAA5CAESEESL1Rjwbk1oqgf1Zr+XSg4aC3N0cmVhbWdyb3VwIhAY1YtEbvBoTaoH9Wa/l0oOKgJTRDIA
DRM: Encrypted event received from media element.
DRM: Init data already processed. Skipping it.
SI: first segment pushed video 2775721.855 2775727.855
AVSB: Acknowledging complete segment video P: 1693476723 A: 2 R: tracks-v2 S: 2775721.855-6
SI: found true buffered start video 2775721.895 2775721.855
SI: found true buffered end video 2775727.895 2775727.855
ABR: Choosing representation with bandwidth estimation. 2398000 tracks-v2
Stream: new video bitrate estimate 89184019.85771188
DRM: Received message event, type license-request 0Vx0E+Ln71wRpYKHaWjKqA==
AVSB: receiving order to push data to the SourceBuffer video video P: 1693476723 A: 2 R: tracks-v2 S: 2775727.855-6
AVSB: pushing segment video video P: 1693476723 A: 2 R: tracks-v2 S: 2775727.855-6
SF: Segment request ended with success video P: 1693476723 A: 2 R: tracks-v2 S: 2775727.855-6
AVSB: receiving order for validating end of segment video video P: 1693476723 A: 2 R: tracks-v2 S: 2775727.855-6
SF: Beginning request audio P: 1693476723 A: 1 R: tracks-a1 S: 2775733.855-6
SF: Beginning request video P: 1693476723 A: 2 R: tracks-v2 S: 2775733.855-6
Stringified encrypted event: {"isTrusted":true}
Base64-encoded init Data: AAACmHBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAAnh4AgAAAQABAG4CPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBHAE4AVwBMAFIARwA3AHcAYQBFADIAcQBCAC8AVgBtAHYANQBkAEsARABnAD0APQA8AC8ASwBJAEQAPgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcAA6AC8ALwBpAGQAeAAuAHMAbwBsAG8AYwBvAG8ALgB0AHYALwBpAGQAeAAvAGQAcgBtAC4AYQBzAHAAeAAvAHAAcgAvAHMAZwA8AC8ATABBAF8AVQBSAEwAPgA8AEMASABFAEMASwBTAFUATQA+AHQAMQB1AEgAMQAzAE0AVQAzAHcAOAA9ADwALwBDAEgARQBDAEsAUwBVAE0APgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AAAAAFlwc3NoAAAAAO3vi6l51krOo8gn3NUdIe0AAAA5CAESEESL1Rjwbk1oqgf1Zr+XSg4aC3N0cmVhbWdyb3VwIhAY1YtEbvBoTaoH9Wa/l0oOKgJTRDIA
DRM: Encrypted event received from media element.
DRM: Init data already processed. Skipping it.
SI: Segment pushed updates end of previous one video 2775727.855 2775733.855 2775721.895 2775727.895
AVSB: Acknowledging complete segment video P: 1693476723 A: 2 R: tracks-v2 S: 2775727.855-6
SI: calculating buffered end of contiguous segment video 2775727.855 2775727.855
SI: found true buffered end video 2775733.895 2775733.855
SI: current video inventory timeline:
2775721.90|A|2775733.90
[A] P: 1693476723 || R: tracks-v2(2398000)
ABR: Choosing representation with bandwidth estimation. 2398000 tracks-v2
Stream: new video bitrate estimate 84862397.2578307
DRM: Updating MediaKeySession with message
DRM: MediaKeySession update succeeded.
DRM: keystatuseschange event received 0Vx0E+Ln71wRpYKHaWjKqA==
SF: Segment request cancelled video P: 1693476723 A: 2 R: tracks-v2 S: 2775733.855-6
SO: Destroying Stream for video 0
SF: Segment request cancelled audio P: 1693476723 A: 1 R: tracks-a1 S: 2775733.855-6
SO: Destroying Stream for audio 0
SO: Creating new Stream for video 0
Stream: Updating video adaptation A: 2 P: 0
Stream: Reusing a previous SegmentBuffer for the type video
SI: current video inventory timeline:
2775721.90|A|2775733.90
[A] P: 1693476723 || R: tracks-v2(2398000)
ABR: Steps for buffer based chooser. bufferLevel: 0, bitrate: 200000 ,bufferLevel: 7.256668049088546, bitrate: 400000 ,bufferLevel: 12.3648612580488, bitrate: 803000 ,bufferLevel: 16.59588633555705, bitrate: 1198000 ,bufferLevel: 20.423792714774525, bitrate: 2398000 ,bufferLevel: 24.97712024864511, bitrate: 3983000
ABR: Choosing representation with bandwidth estimation. 2398000 tracks-v2
SO: Creating new Stream for audio 0
Stream: Updating audio adaptation A: 1 P: 0
Stream: Reusing a previous SegmentBuffer for the type audio
SI: current audio inventory timeline:
2775721.86|A|2775733.87
[A] P: 1693476723 || R: tracks-a1(98000)
SF: Segment request aborted video P: 1693476723 A: 2 R: tracks-v2 S: 2775733.855-6
Stream: changing representation video tracks-v2 2398000
SI: current video inventory timeline:
2775721.90|A|2775733.90
[A] P: 1693476723 || R: tracks-v2(2398000)
SF: Beginning request video P: 1693476723 A: 2 R: tracks-v2 S: init
SF: Beginning request video P: 1693476723 A: 2 R: tracks-v2 S: 2775733.855-6
DRM: Init data already processed. Skipping it.
Stream: new video bitrate estimate 84862397.2578307
Stream: New active period 0
Stream: changing representation audio tracks-a1 98000
SI: current audio inventory timeline:
2775721.86|A|2775733.87
[A] P: 1693476723 || R: tracks-a1(98000)
SF: Beginning request audio P: 1693476723 A: 1 R: tracks-a1 S: init
SF: Beginning request audio P: 1693476723 A: 1 R: tracks-a1 S: 2775733.855-6
DRM: Init data already processed. Skipping it.
SF: Segment request aborted audio P: 1693476723 A: 1 R: tracks-a1 S: 2775733.855-6
DRM: keystatuseschange event received 0Vx0E+Ln71wRpYKHaWjKqA==
DRM: keystatuseschange event received 0Vx0E+Ln71wRpYKHaWjKqA==
AVSB: receiving order to push data to the SourceBuffer video 
SF: Segment request ended with success video P: 1693476723 A: 2 R: tracks-v2 S: init
AVSB: receiving order for validating end of segment video video P: 1693476723 A: 2 R: tracks-v2 S: init
AVSB: Acknowledging complete segment video P: 1693476723 A: 2 R: tracks-v2 S: init
SI: current video inventory timeline:
2775721.90|A|2775733.90
[A] P: 1693476723 || R: tracks-v2(2398000)
ABR: Choosing representation with bandwidth estimation. 2398000 tracks-v2
AVSB: receiving order to push data to the SourceBuffer audio 
SF: Segment request ended with success audio P: 1693476723 A: 1 R: tracks-a1 S: init
AVSB: receiving order for validating end of segment audio audio P: 1693476723 A: 1 R: tracks-a1 S: init
AVSB: Acknowledging complete segment audio P: 1693476723 A: 1 R: tracks-a1 S: init
SI: current audio inventory timeline:
2775721.86|A|2775733.87
[A] P: 1693476723 || R: tracks-a1(98000)
AVSB: receiving order to push data to the SourceBuffer audio audio P: 1693476723 A: 1 R: tracks-a1 S: 2775733.855-6
AVSB: pushing segment audio audio P: 1693476723 A: 1 R: tracks-a1 S: 2775733.855-6
SF: Segment request ended with success audio P: 1693476723 A: 1 R: tracks-a1 S: 2775733.855-6
AVSB: receiving order for validating end of segment audio audio P: 1693476723 A: 1 R: tracks-a1 S: 2775733.855-6
ABR: New last stable representation 98000
SI: current audio inventory timeline:
2775721.86|A|2775733.87
[A] P: 1693476723 || R: tracks-a1(98000)
SI: Pushing segment strictly after previous one. audio 2775733.871 2775733.870999
AVSB: Acknowledging complete segment audio P: 1693476723 A: 1 R: tracks-a1 S: 2775733.855-6
SI: found true buffered end audio 2775739.865666 2775739.8656666665
SI: current audio inventory timeline:
2775721.86|A|2775739.87
[A] P: 1693476723 || R: tracks-a1(98000)
Stringified encrypted event: {"isTrusted":true}
Base64-encoded init Data: AAACmHBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAAnh4AgAAAQABAG4CPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBHAE4AVwBMAFIARwA3AHcAYQBFADIAcQBCAC8AVgBtAHYANQBkAEsARABnAD0APQA8AC8ASwBJAEQAPgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcAA6AC8ALwBpAGQAeAAuAHMAbwBsAG8AYwBvAG8ALgB0AHYALwBpAGQAeAAvAGQAcgBtAC4AYQBzAHAAeAAvAHAAcgAvAHMAZwA8AC8ATABBAF8AVQBSAEwAPgA8AEMASABFAEMASwBTAFUATQA+AHQAMQB1AEgAMQAzAE0AVQAzAHcAOAA9ADwALwBDAEgARQBDAEsAUwBVAE0APgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AAAAAFlwc3NoAAAAAO3vi6l51krOo8gn3NUdIe0AAAA5CAESEESL1Rjwbk1oqgf1Zr+XSg4aC3N0cmVhbWdyb3VwIhAY1YtEbvBoTaoH9Wa/l0oOKgJTRDIA
DRM: Encrypted event received from media element.
DRM: Init data already processed. Skipping it.
API: current media element state tick event seeked position 2775726.1081 seeking false internalSeek null rebuffering false freezing false ended false paused false playbackRate 0 readyState 4
API: current playback timeline:
2775721.90|==12.00==|2775733.90
                ^2775726.1081 
seeked
ABR: Choosing representation with bandwidth estimation. 2398000 tracks-v2
SI: current video inventory timeline:
2775721.90|A|2775733.90
[A] P: 1693476723 || R: tracks-v2(2398000)
SI: current audio inventory timeline:
2775721.86|A|2775739.87
[A] P: 1693476723 || R: tracks-a1(98000)
Init: Resume playback speed 1
API: current media element state tick event canplay position 2775726.1081 seeking false internalSeek null rebuffering false freezing false ended false paused false playbackRate 1 readyState 4
API: current playback timeline:
2775721.90|==12.00==|2775733.90
                ^2775726.1081 
canplay
ABR: Choosing representation with bandwidth estimation. 2398000 tracks-v2
SI: current video inventory timeline:
2775721.90|A|2775733.90
[A] P: 1693476723 || R: tracks-v2(2398000)
SI: current audio inventory timeline:
2775721.86|A|2775739.87
[A] P: 1693476723 || R: tracks-a1(98000)
API: playerStateChange event LOADED
API: playerStateChange event PLAYING

@peaBerberian
Copy link
Collaborator

peaBerberian commented Oct 2, 2023

Thanks!

there are no logs for encrypted events

Weird it does not change much between v3.30.0 and v3.29.0 on this matter and the v3.30.0 logs do tell us that such kind of event was received, are you sure it was properly done?


For the v3.29.0 logs, the encrypted events contains the pssh as an initialization data (in what is called the "cenc" initDataType: https://www.w3.org/TR/eme-initdata-cenc/), roughly the exact same than what is present in the MPD's ContentProtection elements (strangely there seems to be one supplementary 0x00 byte in the encrypted event between pssh? - maybe I missed a step because it does not seem to create an issue later in the v3.29.0)

Is there an "Encrypted event received from media element" log before what you communicated here? It misses the beginning so I don't know where the original initialization data comes from.


So the weirdness of having an "encrypted" event is also present in the v3.29.0 here... But I think I know why now!

Strangely, that event is seen by the browser after we're pushing a media segment (and not just after the initial initialization segment like what we would expect). So I guess that the "pssh" (which is a "box" of an MP4 file, basically a part of the mp4, announcing information on the wanted key) is inside a "moof" box, and not a "moov" box like we would expect normally (I see no documentation about it being set in a "moof" although I will have to see if other players check for that possibility).

You can use an mp4 prober (e.g. mine: https://peaberberian.github.io/AISOBMFFWVDFBUTFAII/) to see in your loaded MP4 segments (both init and media segments) if the "pssh" is inside a "moof" or a "moov" box, or both.

I guess the way your contents are packaged is unusual, though I don't know if it's compliant to the specification because I cannot seem to find in which specification this "pssh" box is defined - also sadly, I don't have access to many media-related specifications and a good chunk of them is not free.


Now the last important question is why the thing breaks in v3.30.0 but not in the v3.29.0.

For some reasons, in the v3.29.0 we're able to tell that we already received the initialization data. But in the v3.30.0 we're not. This leads to the initialization data being ignored in the v3.29.0, but re-communicated in the v3.30.0.

This is a second mystery we have to resolve here... I have to think a little more about what can happen here for that one.

@jakubjereczek
Copy link
Author

Weird it does not change much between v3.30.0 and v3.29.0 on this matter and the v3.30.0 logs do tell us that such kind of event was received, are you sure it was properly done?

I can confirm, we have checked this independently, me and @wioletta-dreszler and neither of us has encrypted event on v3.30.0.

Is there an "Encrypted event received from media element" log before what you communicated here? It misses the beginning so I don't know where the original initialization data comes from.

I filtered the logs, it looks like this:

[Encrypted debug] Stringified encrypted event: {"isTrusted":true}
[Encrypted debug] Base64-encoded init Data: AAACmHBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAAnh4AgAAAQABAG4CPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBHAE4AVwBMAFIARwA3AHcAYQBFADIAcQBCAC8AVgBtAHYANQBkAEsARABnAD0APQA8AC8ASwBJAEQAPgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcAA6AC8ALwBpAGQAeAAuAHMAbwBsAG8AYwBvAG8ALgB0AHYALwBpAGQAeAAvAGQAcgBtAC4AYQBzAHAAeAAvAHAAcgAvAHMAZwA8AC8ATABBAF8AVQBSAEwAPgA8AEMASABFAEMASwBTAFUATQA+AHQAMQB1AEgAMQAzAE0AVQAzAHcAOAA9ADwALwBDAEgARQBDAEsAUwBVAE0APgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AAAAAFlwc3NoAAAAAO3vi6l51krOo8gn3NUdIe0AAAA5CAESEESL1Rjwbk1oqgf1Zr+XSg4aC3N0cmVhbWdyb3VwIhAY1YtEbvBoTaoH9Wa/l0oOKgJTRDIA
rx-player.js:8229 DRM: Encrypted event received from media element.
[Encrypted debug] Stringified encrypted event: {"isTrusted":true}
[Encrypted debug] Base64-encoded init Data: AAACmHBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAAnh4AgAAAQABAG4CPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBHAE4AVwBMAFIARwA3AHcAYQBFADIAcQBCAC8AVgBtAHYANQBkAEsARABnAD0APQA8AC8ASwBJAEQAPgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcAA6AC8ALwBpAGQAeAAuAHMAbwBsAG8AYwBvAG8ALgB0AHYALwBpAGQAeAAvAGQAcgBtAC4AYQBzAHAAeAAvAHAAcgAvAHMAZwA8AC8ATABBAF8AVQBSAEwAPgA8AEMASABFAEMASwBTAFUATQA+AHQAMQB1AEgAMQAzAE0AVQAzAHcAOAA9ADwALwBDAEgARQBDAEsAUwBVAE0APgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AAAAAFlwc3NoAAAAAO3vi6l51krOo8gn3NUdIe0AAAA5CAESEESL1Rjwbk1oqgf1Zr+XSg4aC3N0cmVhbWdyb3VwIhAY1YtEbvBoTaoH9Wa/l0oOKgJTRDIA
rx-player.js:8229 DRM: Encrypted event received from media element.
[Encrypted debug] Stringified encrypted event: {"isTrusted":true}
[Encrypted debug] Base64-encoded init Data: AAACmHBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAAnh4AgAAAQABAG4CPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBHAE4AVwBMAFIARwA3AHcAYQBFADIAcQBCAC8AVgBtAHYANQBkAEsARABnAD0APQA8AC8ASwBJAEQAPgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcAA6AC8ALwBpAGQAeAAuAHMAbwBsAG8AYwBvAG8ALgB0AHYALwBpAGQAeAAvAGQAcgBtAC4AYQBzAHAAeAAvAHAAcgAvAHMAZwA8AC8ATABBAF8AVQBSAEwAPgA8AEMASABFAEMASwBTAFUATQA+AHQAMQB1AEgAMQAzAE0AVQAzAHcAOAA9ADwALwBDAEgARQBDAEsAUwBVAE0APgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AAAAAFlwc3NoAAAAAO3vi6l51krOo8gn3NUdIe0AAAA5CAESEESL1Rjwbk1oqgf1Zr+XSg4aC3N0cmVhbWdyb3VwIhAY1YtEbvBoTaoH9Wa/l0oOKgJTRDIA
rx-player.js:8229 DRM: Encrypted event received from media element.
[Encrypted debug] Stringified encrypted event: {"isTrusted":true}
[Encrypted debug] Base64-encoded init Data: AAACmHBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAAnh4AgAAAQABAG4CPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBHAE4AVwBMAFIARwA3AHcAYQBFADIAcQBCAC8AVgBtAHYANQBkAEsARABnAD0APQA8AC8ASwBJAEQAPgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcAA6AC8ALwBpAGQAeAAuAHMAbwBsAG8AYwBvAG8ALgB0AHYALwBpAGQAeAAvAGQAcgBtAC4AYQBzAHAAeAAvAHAAcgAvAHMAZwA8AC8ATABBAF8AVQBSAEwAPgA8AEMASABFAEMASwBTAFUATQA+AHQAMQB1AEgAMQAzAE0AVQAzAHcAOAA9ADwALwBDAEgARQBDAEsAUwBVAE0APgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AAAAAFlwc3NoAAAAAO3vi6l51krOo8gn3NUdIe0AAAA5CAESEESL1Rjwbk1oqgf1Zr+XSg4aC3N0cmVhbWdyb3VwIhAY1YtEbvBoTaoH9Wa/l0oOKgJTRDIA
rx-player.js:8229 DRM: Encrypted event received from media element.
[Encrypted debug] Stringified encrypted event: {"isTrusted":true}
[Encrypted debug] Base64-encoded init Data: AAACmHBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAAnh4AgAAAQABAG4CPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBHAE4AVwBMAFIARwA3AHcAYQBFADIAcQBCAC8AVgBtAHYANQBkAEsARABnAD0APQA8AC8ASwBJAEQAPgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcAA6AC8ALwBpAGQAeAAuAHMAbwBsAG8AYwBvAG8ALgB0AHYALwBpAGQAeAAvAGQAcgBtAC4AYQBzAHAAeAAvAHAAcgAvAHMAZwA8AC8ATABBAF8AVQBSAEwAPgA8AEMASABFAEMASwBTAFUATQA+AHQAMQB1AEgAMQAzAE0AVQAzAHcAOAA9ADwALwBDAEgARQBDAEsAUwBVAE0APgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AAAAAFlwc3NoAAAAAO3vi6l51krOo8gn3NUdIe0AAAA5CAESEESL1Rjwbk1oqgf1Zr+XSg4aC3N0cmVhbWdyb3VwIhAY1YtEbvBoTaoH9Wa/l0oOKgJTRDIA
rx-player.js:8229 DRM: Encrypted event received from media element.
[Encrypted debug] Stringified encrypted event: {"isTrusted":true}
[Encrypted debug] Base64-encoded init Data: AAACmHBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAAnh4AgAAAQABAG4CPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBHAE4AVwBMAFIARwA3AHcAYQBFADIAcQBCAC8AVgBtAHYANQBkAEsARABnAD0APQA8AC8ASwBJAEQAPgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcAA6AC8ALwBpAGQAeAAuAHMAbwBsAG8AYwBvAG8ALgB0AHYALwBpAGQAeAAvAGQAcgBtAC4AYQBzAHAAeAAvAHAAcgAvAHMAZwA8AC8ATABBAF8AVQBSAEwAPgA8AEMASABFAEMASwBTAFUATQA+AHQAMQB1AEgAMQAzAE0AVQAzAHcAOAA9ADwALwBDAEgARQBDAEsAUwBVAE0APgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AAAAAFlwc3NoAAAAAO3vi6l51krOo8gn3NUdIe0AAAA5CAESEESL1Rjwbk1oqgf1Zr+XSg4aC3N0cmVhbWdyb3VwIhAY1YtEbvBoTaoH9Wa/l0oOKgJTRDIA
rx-player.js:8229 DRM: Encrypted event received from media element.
[Encrypted debug] Stringified encrypted event: {"isTrusted":true}
[Encrypted debug] Base64-encoded init Data: AAACmHBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAAnh4AgAAAQABAG4CPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBHAE4AVwBMAFIARwA3AHcAYQBFADIAcQBCAC8AVgBtAHYANQBkAEsARABnAD0APQA8AC8ASwBJAEQAPgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcAA6AC8ALwBpAGQAeAAuAHMAbwBsAG8AYwBvAG8ALgB0AHYALwBpAGQAeAAvAGQAcgBtAC4AYQBzAHAAeAAvAHAAcgAvAHMAZwA8AC8ATABBAF8AVQBSAEwAPgA8AEMASABFAEMASwBTAFUATQA+AHQAMQB1AEgAMQAzAE0AVQAzAHcAOAA9ADwALwBDAEgARQBDAEsAUwBVAE0APgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AAAAAFlwc3NoAAAAAO3vi6l51krOo8gn3NUdIe0AAAA5CAESEESL1Rjwbk1oqgf1Zr+XSg4aC3N0cmVhbWdyb3VwIhAY1YtEbvBoTaoH9Wa/l0oOKgJTRDIA
rx-player.js:8229 DRM: Encrypted event received from media element.
[Encrypted debug] Stringified encrypted event: {"isTrusted":true}
[Encrypted debug] Base64-encoded init Data: AAACmHBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAAnh4AgAAAQABAG4CPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBHAE4AVwBMAFIARwA3AHcAYQBFADIAcQBCAC8AVgBtAHYANQBkAEsARABnAD0APQA8AC8ASwBJAEQAPgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcAA6AC8ALwBpAGQAeAAuAHMAbwBsAG8AYwBvAG8ALgB0AHYALwBpAGQAeAAvAGQAcgBtAC4AYQBzAHAAeAAvAHAAcgAvAHMAZwA8AC8ATABBAF8AVQBSAEwAPgA8AEMASABFAEMASwBTAFUATQA+AHQAMQB1AEgAMQAzAE0AVQAzAHcAOAA9ADwALwBDAEgARQBDAEsAUwBVAE0APgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AAAAAFlwc3NoAAAAAO3vi6l51krOo8gn3NUdIe0AAAA5CAESEESL1Rjwbk1oqgf1Zr+XSg4aC3N0cmVhbWdyb3VwIhAY1YtEbvBoTaoH9Wa/l0oOKgJTRDIA
rx-player.js:8229 DRM: Encrypted event received from media element.

@m-scheepers
Copy link

@peaBerberian is there something which can either be done on RxPlayer-side or client-side for this issue? We would like to update to latest 3.x rxplayer version; but due to this issue we currently put this on-hold.

@peaBerberian
Copy link
Collaborator

Sorry, I didn't take the time to understand what may happen here.

First there is something weird that seems to happen at the content-level with pssh information in media segments. If you can remove those to only have them on the initialization segment, as generally expected, it might fix the issue.

In any case this might theoretically be work-arounded uglily by ensuring in our case that the "cenc" initDataType is set when none is initially set in the generateRequest API by monkey-patching it:

const originalGenerateRequest = MediaKeySession.prototype.generateRequest;
MediaKeySession.prototype.generateRequest = function() {
  const initDataType = arguments[0];
  if (initDataType === undefined) {
    arguments[0] = "cenc",
  }
  return originalGenerateRequest.apply(this, arguments);
}

But I get that you might not want to add such ugly patch in your codebase.

I'm also not completely sure of the final effect of that work-around here, we might have two license requests for the same license instead of just one (it shouldn't break playback though).

@jakubjereczek
Copy link
Author

@peaBerberian We have rechecked it using version 3.32.1, and it seems to be working fine. Were there any significant changes between version 3.30 and 3.32.1?

@peaBerberian
Copy link
Collaborator

I looked around and did not see why this would be the case, so, that's fortunate and worrying at the same time!

This release did include some DRM code refactoring to help us debug DRM issues (as the majority of our issues are linked to DRM), so maybe a change there prevented a race condition that was previously happening?

Let's hope it won't break again :s

@KunXi-Fox
Copy link

Just FYI,

We met similar issue on MS Edge + Windows 11, turns out there's something wrong with PlayReady, after change drm to Widevine, it works totally fine.

@peaBerberian
Copy link
Collaborator

peaBerberian commented Dec 16, 2024

Hi @KunXi-Fox , thanks for the information. Is it the same issue than the one from this issue?

We've recently (after a Microsoft update) encountered PlayReady SL3000 issues on edge and windows 11 which led on a few devices to a black screen, where moving the window containing the media player fixes the issue until the next content starts. We've communicated the bug to Microsoft a few weeks ago but no answer for now.
Maybe it's that other issue instead in your case?
In that last case switching to Widevine or PlayReady Software "fixes" the problem (it more likely just works around it!).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants