Intent to Prototype: EME MediaKeySession Closed Reason

68 views
Skip to first unread message

Xiaohan Wang (王消寒)

unread,
Jun 7, 2021, 6:47:37 PM6/7/21
to blink-dev

Contact emails

xhw...@chromium.org

Explainer

https://github.com/w3c/encrypted-media/issues/473

Specification

https://github.com/w3c/encrypted-media/pull/487

Summary

A MediaKeySessionClosedReason is proposed to indicate the reason for EME MediaKeySession closure, and the `closed` attribute would return a Promise<MediaKeySessionClosedReason> instead of the current Promise<void>. See https://github.com/w3c/encrypted-media/issues/473.


Blink component

Internals>Media>Encrypted

Motivation

The current EME spec says "the CDM may close a session at any point, such as when the session is no longer needed or when system resources are lost". However, there's not way to specify the exact reason for session closure. In some cases, this is part of normal user flow, e.g. user close laptop lid to put the device into sleep mode, where the player should resume playback. In some other cases, this is due to some unrecoverable fatal error.

This proposal updates the `closed` attribute on MediaKeySession to provide a MediaKeySessionClosedReason so that the JavaScript player can handle session closure differently based on the reasons.


Initial public proposal

https://github.com/w3c/encrypted-media/issues/473  

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility

This is backward compatible with existing API such that existing players will continue to work without issues.



Gecko: No signal

WebKit: Support in W3C Media Working Group meeting.

Web developers: Supported and approved by Netflix


Is this feature fully tested by web-platform-tests?

No

Flag name

EncryptedMediaSessionClosedReason (see CL)

Link to entry on the Chrome Platform Status

https://www.chromestatus.com/feature/5632124143009792

Xiaohan Wang

unread,
Jun 7, 2021, 7:00:42 PM6/7/21
to blink-dev, Xiaohan Wang
This is a rather simple change and is backward compatible. Do we still need to go through the TAG review?

Yoav Weiss

unread,
Jun 8, 2021, 4:00:23 AM6/8/21
to Xiaohan Wang, blink-dev
This change is changing an existing method to have it return a new Enum instead of returning a void. That indeed seems to me like a change that doesn't necessarily need a TAG review.
At the same time, I think we need to gather up support from other vendors.

On Tue, Jun 8, 2021 at 1:00 AM Xiaohan Wang <xhw...@chromium.org> wrote:
This is a rather simple change and is backward compatible. Do we still need to go through the TAG review?

On Monday, June 7, 2021 at 3:47:37 PM UTC-7 Xiaohan Wang wrote:

Can we wait for the PR to land?
 


Summary

A MediaKeySessionClosedReason is proposed to indicate the reason for EME MediaKeySession closure, and the `closed` attribute would return a Promise<MediaKeySessionClosedReason> instead of the current Promise<void>. See https://github.com/w3c/encrypted-media/issues/473.


Blink component

Internals>Media>Encrypted

Motivation

The current EME spec says "the CDM may close a session at any point, such as when the session is no longer needed or when system resources are lost". However, there's not way to specify the exact reason for session closure. In some cases, this is part of normal user flow, e.g. user close laptop lid to put the device into sleep mode, where the player should resume playback. In some other cases, this is due to some unrecoverable fatal error.

This proposal updates the `closed` attribute on MediaKeySession to provide a MediaKeySessionClosedReason so that the JavaScript player can handle session closure differently based on the reasons.


Initial public proposal

https://github.com/w3c/encrypted-media/issues/473  

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility

This is backward compatible with existing API such that existing players will continue to work without issues.


What about interop risk? Are other vendors likely to adopt as well? Would developers need to feature detect support? If so, do we need to change documentation to that effect?
 


Gecko: No signal

Can you ask for a signal? bit.ly/blink-signals  
Digging through the minutes, I found Jer Noble stating: "I don't hear any objection to this idea, so it seems reasonable to prepare a PR for this, so that we can discuss with concrete text in front of us." 

It's unclear if he's making that statement with his chair hat on or with his WebKit engineer one. It's also not a clear statement of support. It'd be good to get WebKit folks to review the PR and approve it.


Web developers: Supported and approved by Netflix


Is this feature fully tested by web-platform-tests?

No

Flag name

EncryptedMediaSessionClosedReason (see CL)

Link to entry on the Chrome Platform Status

https://www.chromestatus.com/feature/5632124143009792

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/af828347-330e-45bc-8666-3bde184e6ddbn%40chromium.org.

Xiaohan Wang (王消寒)

unread,
Jun 8, 2021, 11:18:33 AM6/8/21
to Yoav Weiss, blink-dev
Yoav: Thanks for the comments. Really appreciate it! I'll get the signals and wait for the PR to land and report back here. 

Yoav Weiss

unread,
Jun 8, 2021, 11:34:47 AM6/8/21
to Xiaohan Wang (王消寒), blink-dev
Apologies, as my previous message was not clear. No need to wait for the PR to land for prototyping, just for shipping.

Xiaohan Wang (王消寒)

unread,
Jun 8, 2021, 12:23:45 PM6/8/21
to Yoav Weiss, blink-dev
Got it. Thanks for the clarification!
Reply all
Reply to author
Forward
0 new messages