Open sandersaares opened 8 years ago
This sounds like a good idea. Would you be able to make a PR with the new test ?
While the EME APIs can be used without an "encrypted" event - or even attaching the MediaKeys
to a media element - encrypted streams always have Initialization Data, which should result in an "encrypted" event when playback starts.
Can you be more specific about the test case you are requesting? Is it performing a license exchange before attaching to a media element (and perhaps another case after attaching but before media data has been provided)?
For example, DASH content may have the PSSH only in the manifest and not in any media segments themselves. The player will take it from the manifest and directly provide it to generateRequest()
.
This is the style recommended by DASH-IF Interoperability Points. Latest CMAF draft also recommends this method of passing the PSSH be used, I believe.
I fear I do not have the required knowledge of the test suite or test authoring here to contribute a PR, though.
The EME spec doesn't currently cover this scenario explicitly. I filed https://github.com/w3c/encrypted-media/issues/333.
Chrome follows something closer to the recommendation of that issue, so such a test should work there. Are Edge (@jdsmith3000) and Firefox (@cpearce) following the current algorithm or is there some other reason they require a 'pssh' box?
Re: Firefox and Edge - they have issues only with audio tracks - for video tracks, they work fine if no "encrypted" event is raised, as far as I can tell. For Edge, I have filed Connect feedback ID 3101080 (private) and for Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1300069.
I'm not aware of any reason Edge should require a pssh box in either audio or video. I am confirming, but at this point believe that any behavior that seems to require this would be a bug.
@ddorwin It does make sense to me that this be clarified in the spec, and adding a test for it would be useful for compliance testing, though perhaps not required to support the spec moving to PR.
I have a test for this case in Firefox's mochitest harness (I fixed it recently):
https://dxr.mozilla.org/mozilla-central/source/dom/media/test/test_eme_missing_pssh.html
We can convert that to a Web Platform Test.
@cpearce: Are you preparing a PR for adding this test?
https://github.com/w3c/encrypted-media/issues/333 has been fixed, so such a test would now correctly test behavior defined by the spec.
A few browsers (Edge, Firefox) are known to have a dependency on activating a CDM only if there is a PSSH box being in the media stream fead to MSE, triggering an "encrypted" event. There is no such requirement in EME - it receives Initialization Data via
generateRequest()
and the data fed to this function does not need to come from the "encrypted" event. Indeed, nothing in EME even says the "encrypted" event needs to be raised for the CDM to operate.On a quick read through the results, I did not notice any test titles that would suggest anything is already testing this scenario. Having such at test case in the EME test suite seems beneficial for interoperability, therefore I suggest such a test case be added.