W3C home > Mailing lists > Public > public-media-capture@w3.org > November 2013

Re: Getting the MediaStream associated with a video element?

From: Adam Bergkvist <adam.bergkvist@ericsson.com>
Date: Wed, 13 Nov 2013 06:59:49 +0000
To: cowwoc <cowwoc@bbs.darktech.org>, "public-webrtc@w3.org" <public-webrtc@w3.org>, "public-media-capture@w3.org" <public-media-capture@w3.org>
Message-ID: <A222C88B6882744D8D4B9681B31588901161E53B@ESESSMB307.ericsson.se>
On 2013-11-13 06:16, cowwoc wrote:
> Hi,
>
> I've seen code for attaching MediaStream to a <video> element, but
> shouldn't we also be able to do the opposite? If the following code is
> used to attach:
>
>     video.src = URL.createObjectURL(stream);
>
> how are we supposed to translate the URL back into a MediaStream?

We don't support the createObjectURL() method of rendering a MediaStream 
anymore. The supported way is to use the srcObject attribute on the 
media elements.

video.srcObject = stream;

In case you can just read the srcObject attribute to get the stream.

This topic belongs on the public-media-capture list (cc'ed). When 
replying to this message, please remove the public-webrtc list.

/Adam
Received on Wednesday, 13 November 2013 07:00:16 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:24:43 UTC