← Back to release summary

EME MediaKeySession Closed Reason

Category
Multimedia
Type
Chromium catches up
Status
Enabled by default (Chrome 96)
Intent stage
Shipped

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.

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.

Standards & signals

Docs: https://googlechrome.github.io/samples/media/key-session-closed-reason.html

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

View on chromestatus.com