[encrypted-media] Allow applications to check MediaKeySessionType support via requestMediaKeySystemAccess()

ddorwin has just created a new issue for 
https://github.com/w3c/encrypted-media:

= Allow applications to check MediaKeySessionType support via 
requestMediaKeySystemAccess() =
Currently, applications can request/require support for persisting 
state, but this does not guarantee that either of the `persistent-*` 
`MediaKeySessionType`s are supported. Although applications can check 
support for specific `MediaKeySessionType`s by calling 
`createSession()`, which will throw a `DOMException` "If the Key 
System implementation represented by this object's cdm implementation 
value does not support sessionType," it would be nice if applications 
could check before selecting a key system and potentially causing a 
user prompt.

Consider the following scenario:
1) User wants to pin content for offline playback.
2) User agent prompts the user for permission to use the key system.
3) Application reports that offline playback is not supported.

The problem is worse in the event that the user agent supports another
 key system (or configuration) does support `persistent-license`.

We don't need to add every capability to 
`MediaKeySystemConfiguration`, but this seems like an important one 
since there is no downgrade option.


Assuming we want to address this, we need to decide how to expose this
 information. A sequence of `sessionTypes` would be easy and 
extensible. For consistency with the other sequence members of 
`MediaKeySystemConfiguration`, support for any of the 
`MediaKeySessionType`s in the sequence (or an empty sequence) would 
result in success.

If an application needs a specific session type, it can check 
getConfiguration() on the resulting `MediaKeySystemAccess` object or 
only request the specific `MediaKeySessionType`.

Step 2 of `createSession()`, which is currently "If the Key System 
implementation represented by this object's cdm implementation value 
does not support sessionType, throw a new DOMException whose name is 
NotSupportedError", should probably be updated to check a property 
from the resulting `MediaKeySystemAccess`. The most obvious and 
understandable behavior would be to use the list of `sessionTypes`. 
The downside is that this would, for example, prevent an application 
that only checked for `persistent-license` from creating `temporary` 
sessions as appropriate.

See https://github.com/w3c/encrypted-media/issues/29

Received on Monday, 9 February 2015 21:50:26 UTC