- From: <bugzilla@jessica.w3.org>
- Date: Sat, 08 Nov 2014 00:43:04 +0000
- To: public-html-bugzilla@w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=26372
--- Comment #34 from David Dorwin <ddorwin@google.com> ---
The current proposal is to remove getUsableKeyIds() and add the following:
enum MediaKeyStatus { "valid", "expired", "outputprohibited", ... };
interface MediaKeySession : EventTarget {
...
readonly maplike<BufferSource, MediaKeyStatus>;
};
Note: BufferSource is a typedef for ArrayBuffer or ArrayBufferView.
"maplike" essentially adds a set of properties and methods to the object that
contains it. An interface may only have one such declaration. (See
http://heycam.github.io/webidl/#idl-maplike for details.) The effect is that
MediaKeySession becomes a "collection of keys" (represented by key IDs and
statuses.
Specifically, the following are implicitly added to the MediaKeySession
interface. (Each item is presented as it would be used on a MediaKeySession
named session.)
* session.size returns the number of keys the session is currently tracking.
* session.entries() returns an Iterator object for the pairs
- Provides full access to all the key IDs and their associated key statuses.
* session.forEach(callback) calls the |callback| for each pair.
- Another way to iterate through the pairs.
* session.get(keyId) returns the MediaKeyStatus of the key specified by the
BufferSource |keyId|.
- This could be used to check the status of a specific key.
* session.has(keyId) returns whether the session currently contains information
about the key specified by the BufferSource |keyId|.
- This could be used to determine whether the session has a key.
* session.keys() returns an Iterator object for the key IDs (ArrayBuffers).
- The name "keys" could be confusing.
- Fortunately, this is probably not very useful.
* session.values() returns an Iterator object for the statuses
(MediaKeyStatus).
- This could be used to quickly determine, for example, whether there are any
keys that are not valid.
* symbol.iterator probably returns something similar to session.entries().
Note: The members could change while using an Iterator or in the middle of
forEach()
--
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Saturday, 8 November 2014 00:43:06 UTC