W3C home > Mailing lists > Public > public-html-media@w3.org > November 2018

[encrypted-media] sessionTypes: sequence of DOMString vs sequence of MediaKeySessionType

From: xhwang-chromium via GitHub <sysbot+gh@w3.org>
Date: Wed, 07 Nov 2018 20:35:26 +0000
To: public-html-media@w3.org
Message-ID: <issues.opened-378458492-1541622925-sysbot+gh@w3.org>
xhwang-chromium has just created a new issue for https://github.com/w3c/encrypted-media:

== sessionTypes: sequence of DOMString vs sequence of MediaKeySessionType ==
This is about the `sessionTypes` in `MediaKeySystemConfiguration` in the EME spec. For historically backgrounds, see issue #260 and #47.

The spec defines `sessionTypes` as:

> `sessionTypes` of type sequence \<DOMString\> 
>     A list of `MediaKeySessionTypes` that must be supported. All values must be supported.

This is causing an issue in [ Get Supported Configuration and Consent](https://w3c.github.io/encrypted-media/#get-supported-configuration-and-consent), step 13 and 13.1

> 13 For each value in session types:
> 13.1 Let session type be the value.

Here the `session type` is still a DOMString, but is passed to [Is persistent session type?](https://w3c.github.io/encrypted-media/#is-persistent-session-type) algorithm, which expects a `MediaKeySessionType` value as input. So it seems we are missing a DOMString to MediaKeySessionType conversion somewhere.

Using a DOMString has another issue that it makes it much harder to catch typos. For example, if we get `NotSupportedError` for `sessionTypes: ['persistent-licence']`, the author of the JS player may think that persistent license is not supported, but actually it's just a typo in the "licen**c**e".

With that, should `sessionTypes` be defined as sequence<MediaKeySessionType>? That'll solve both issues above. For the typo example, `TypeError` will be returned immediately.

One argument of using the DOMString is that it allows nice forward compatibility. See see issue #260 and #47. But at least we need to fix the missing type conversion in the spec.

Please view or discuss this issue at https://github.com/w3c/encrypted-media/issues/447 using your GitHub account
Received on Wednesday, 7 November 2018 20:35:28 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 15:49:23 UTC