WICG / hdcp-detection

Incubation for HDCP detection feature in EME
https://wicg.github.io/hdcp-detection/
Other
12 stars 7 forks source link

Reject promise with NotSupportedError on unsupported keysystem in 'HDCP Policy Check' proposal (moved from wicg/media-capabilities) #2

Open mounirlamouri opened 6 years ago

mounirlamouri commented 6 years ago

Original issue: https://github.com/WICG/media-capabilities/issues/56

/CC @xhwang-chromium @JamesWCCheng

joeyparrish commented 5 years ago

@JamesWCCheng, this does not make sense because the new method is on MediaKeys. You can't get a MediaKeys instance if the key system is unsupported, so this error would have been reached during requestMediaKeySystemAccess.

(Cross-posted to the original discussion as well.)

xhwang-chromium commented 5 years ago

Reading through the old bug, I think "unsupported key system" here means key systems that do not implement/support this "hdcp detection" API, not a key system not supported by the UA. For example, Clear Key key system doesn't do anything about HDCP, and can potentially declare that "hdcp detection" API is not supported.

I see mounirlamouri@'s point that the CDM should "just do what it would do with a real license with certain limitation/requirement (e.g. HDCP reqirement)". The current explainer doc also says:

The new API will allow application developers to query the status of a hypothetical key associated with an HDCP policy...

However, in the example of Clear Key key system, it never expects a license with HDCP requirement. As such, a typically Clear Key CDM implementation wouldn't have code to check HDCP status to determine whether a "hypothetical key associated with an HDCP policy" would be usable or not. Therefore, it's hard and unnecessary to ask all CDMs to implement this API, and I think it makes more sense to have these CDMs declare "HDCP detection" API is not supported.

In summary, I think it makes sense that if a MediaKeys (CDM) doesn't not support this policy check that it should reject the promise with NotSupportedError. This is actually how things are implemented in Blink/Chromium.

If agreed, we should update the explainer doc to reflect this.

joeyparrish commented 5 years ago

Okay, that makes sense to me.

xhwang-chromium commented 3 years ago

joeyparrish: I am a bit confused with all the labels :) Just want to make sure this is included when you update the spec.