[Bug 16613] Consider a more object-oriented design in which sessions are represented as objects

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

--- Comment #4 from David Dorwin <ddorwin@google.com> 2012-06-12 00:04:36 UTC ---
Advantages of the object-oriented approach:
 * Clearly defines the lifetime of a session. (See also 16547.)
 * keySystem and sessionId do not need to be passed around - they are always
properties.
 * We might be able to eliminate cancel[KeyRequest]().
 * Minimal changes to the HTMLMediaElement interface and better encapsulation
of this functionality.
 * May allow sharing of keys between multiple elements if the object can be
associated with additional elements. (See also bug 17202.)
 * Might allow us to use properties on the object with simple events instead of
using complex events.
 * Addresses at least some aspects of bug bug 16547, bug 16548, bug 16550, bug
16612, bug 16614, 16615, bug 17199, bug 17202, bug 17203

Disadvantages:
 * Additional complexity for implementations?
   - Association of sessions with elements _might_ be more difficult.
   - Another IDL, and implementation.
     * For WebKit, we currently just add some methods on the existing media
element stack. A new element would require implementing a new stack to get to
the embedder.
 * Additional complexity for applications?
 * If we tie the generateKeyRequest() functionality to this object, each new
license (and every unique init_data) would create a new object. This could
apply to relatively simple cases, such as separate files (and keys) for audio
and video. (In the existing proposal, a separate session ID would be created,
but all interaction would be through the same object - the HTMLMediaElement.)

TBD:
 * The impact of firing events at the new object instead of the
HTMLMediaElement on applications.
 * It would be nice to have some input on what might be preferable from an
application developer POV.
 * Whether Media Source will move in a similar direction - consistency would be
nice. See bug 17082.
 * Should new objects be automatically associated with a media element? Should
there be some "static" creation method (or just new "MediaKeySession") that
provides an object that can be added to an HTMLMediaElement. This would be
similar to xxxTracks as discussed in bug 17082 comment 4.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 12 June 2012 00:04:39 UTC