Re: Extending createObjectUrl to MediaStream?

On 2013-08-28 17:48, Dominique Hazael-Massieux wrote:
> Hi WebApps WG,
>
> The Media Capture Task Force (responsible for specs that deal with
> MediaStream objects [1]) has been considering whether one should be able
> to assign a MediaStream to <video> and <audio> elements via an URL
> obtained via createObjectURL or not, and is seeking feedback on the
> question.
>
> More precisely:
> A. we define a new srcObject attribute on HTMLMediaElement objects that
> can take directly a MediaStream object and make it playable
>    video.srcObject = mediastream;
> B. the spec also supports assigning a MediaStream via the src attribute,
> via an URL obtained through createObjectURL:
>   video.src = URL.createObjectURL(mediastream);
>
> While there are ongoing discussions on how to spec B properly [2] (which
> will require coordination with the WebApps Working Group), we are first
> and foremost wondering if that option is needed at all.
>
> We are thus looking for input on the use cases for createObjectURL as
> used for the File API, and whether these use cases would also apply to
> our MediaStream case. In general, is there a need for any object
> readable by media elements to support an URL-based approach for
> consistency with the rest of the platform?

One need I can see is when you want to display the video in another
window. Let's say you want to have the video in a popout window -
something I think we should definitely support - handing that window the 
URL (using postMessage) for use by its video element is a very
convenient way to support this use-case. This works in Chrome today.

But, an alternative could perhaps be to make MediaStream a transferable 
(which means that the MediaStream object could be sent over using 
postMessage IIUC).

>
> Thanks!
>
> Dom for capture-ACTION-23
>
> 1. http://dev.w3.org/2011/webrtc/editor/getusermedia.html
> 2. https://www.w3.org/Bugs/Public/show_bug.cgi?id=19594
>
>
>
>


Received on Friday, 30 August 2013 13:16:47 UTC