[Bug 25199] EME should use Promises

https://www.w3.org/Bugs/Public/show_bug.cgi?id=25199

--- Comment #1 from David Dorwin <ddorwin@google.com> ---
There was some initial support in the April 1 telecon. People should review the
full proposal before the f2f on April 9.


Below is a proposal for an IDL that reflects the proposal. In addition, the
only MediaKeySession events would be "message" and "error" (possibly with a TBD
better name).


enum MediaWaitingFor { "none", "data", "key" };

partial interface HTMLMediaElement {
  // Encrypted Media
  readonly attribute MediaKeys mediaKeys;
  Promise<any> setMediaKeys(MediaKeys mediaKeys);

  attribute EventHandler onneedkey;

  readonly attribute MediaWaitingFor waitingFor;
};

interface MediaKeys {
  readonly attribute DOMString keySystem;

  Promise<MediaKeySession> createSession(DOMString initDataType, Uint8Array
initData);
  Promise<MediaKeySession> loadSession(DOMString sessionId);

  static Promise<MediaKeys> create(DOMString keySystem)
  static bool isTypeSupported(DOMstring keySystem, optional DOMString
contentType);
};

interface MediaKeySession : EventTarget {
  // error state
  readonly attribute MediaKeyError? error;

  // session properties
  readonly attribute DOMString keySystem;
  readonly attribute DOMString sessionId;
  readonly attribute Promise<any> close;

  // session operations
  Promise<any> update(Uint8Array response);
  Promise<any> release();
};

partial interface HTMLSourceElement {
  attribute DOMString keySystem;
};

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Wednesday, 2 April 2014 21:36:07 UTC