Re: Make MediaStream usable with postMessage

Based on Anne's feedback, here's another attempt to specify this:

===================================================
-- Section "Terminology, HTML Terms": Add that "structured clone" is
defined in [HTML5]

-- Section 4.2 "MediaStream", add sentence:
"MediaStream is intended to be usable with HTML5 Web Messaging's 
postMessage API", link to http://dev.w3.org/html5/postmsg/

-- Section 4.2 "MediaStream", add paragraph:
"When a user agent (e.g. as result of postMessage() being called with a 
MediaStream as argument) is required to obtain a structured clone of a 
MediaStream, follow the algorithm outlined in
[http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#safe-passing-of-structured-data]; 

when the 'internal structured cloning algorithm' step is reached, follow 
the steps outlined for cloning a MediaStream [link to "To clone a 
MediaStream"], and let streamClone be output."

-- Section 4.2 "MediaStream", add paragraph:
"To clone a MediaStream stream, run these steps:
1. Let streamClone be a newly constructed MediaStream object.
2. Initialize streamClone's id attribute to a newly generated value.
3. Let trackSetClone be the result of cloning [link to "To clone a 
MediaStreamTrack"] all the MediaStreamTrack's in stream.
4. Let trackSetClone be streamClone's track set."

-- Section 4.2.2 Methods, for the "clone" method, replace the 
description with something like:
"Follow the steps outlined for cloning a MediaStream [link to "To clone 
a MediaStream"]"


-- Section 4.3 "MediaStreamTrack", add paragraph:
"To clone a MediaStreamTrack track, run these steps:
1. Let trackClone be a newly constructed MediaStreamTrack object.
2. Initialize trackClone's id attribute to a newly generated value.
3. Let trackClone inherit track's underlying source, kind, label and 
enabled attributes.
4. Return trackClone."

-- Section 4.3.3.2 Methods, for the "clone" method, replace the 
description with something like:
"Follow the steps outlined for cloning a MediaStreamTrack [link to "To 
clone a MediaStreamTrack"]"
==========================================

Does this seem reasonable?

Stefan



On 10/21/13 5:04 PM, Anne van Kesteren wrote:
> On Mon, Oct 21, 2013 at 3:43 PM, Stefan Håkansson LK
> <stefan.lk.hakansson@ericsson.com> wrote:
>> This (abstract clone) sounds interesting. Could you provide a link to an
>> example?
>
> See e.g. how http://dom.spec.whatwg.org/#dom-document-adoptnode is
> defined in terms of http://dom.spec.whatwg.org/#concept-node-adopt
>
> The DOM has a lot of operations defined that are used by methods. For
> your case, the abstract operation could take a targetRealm and for the
> case of invoking clone(), targetRealm would simply be identical to
> that of the object the method is invoked upon.
>
>


Received on Tuesday, 22 October 2013 17:24:38 UTC