Re: Extending createObjectUrl to MediaStream?

On 2013-09-03 12:01, Harald Alvestrand wrote:
> On 09/03/2013 10:27 AM, Stefan Håkansson LK wrote:
>> On 2013-09-03 01:29, Robert O'Callahan wrote:
>>> What are your use-cases where they're not the same? More importantly,
>>> what are the use-cases where they cannot be made the same by the developer?
>> E.g. the main page delegating communication to someone else (perhaps via
>> an iFrame). If the MediaStream is a transferable object the incoming
>> MediaStream can be transferred to the main page, which in turn can
>> control layout and rendering.
>
> One interesting thing about a MediaStream is that it's got multiple
> links to the world around it. In particular, it can be connected to
> multiple downstream objects.
> This means that what happens to its peers when one transfers it has to
> be defined.
>
> For instance, if MediaStream were transferable, could I do this?
>
> GetUserMedia(....., success, failure)
>
> function success(stream) {
>      myVideoTag.srcObject = stream
>      stream.transfer(myWorker)
> }
>
> and after this - would the video stop playing (because the stream is
> gone from my context), or not?

I think it should stop playing since the object srcObject references is 
gone. (It would work differently with createObjecURL + myVideoTag.src 
since that would only be a handle to an underlying resource)

If you'd like it to continue playing you'd have to clone the MediaStream 
and transfer the clone.

>
>
>


Received on Tuesday, 3 September 2013 11:49:15 UTC