- From: Randell Jesup <randell-ietf@jesup.org>
- Date: Mon, 30 Jul 2012 13:01:55 -0700
- To: public-media-capture@w3.org
On 7/30/2012 10:06 AM, Travis Leithead wrote: >> -----Original Message----- >> From: Stefan Hakansson LK [mailto:stefan.lk.hakansson@ericsson.com] >> On 07/30/2012 11:08 AM, Sunyang (Eric) wrote: >>> Can we generate a stream from a file, and then use addStream() to send >>> it to peer? >> That is the intention. > We should simply extend MediaStreamTrackList:add for this scenario (see below). However, I'm skeptical that you'd want to be able to "stream" arbitrary files as a media stream track. For example, what would happen if you tried to send a PDF or HTML document as a stream? It just doesn't make sense. If that's your goal, what you want is simply a Blob-based file transfer mechanism (peer-to-peer). I doubt that real-time media transfer is the transfer mechanism you would want for that. The MediaStream Processing document specifies a mechanism of running a file through a video element, and doing video_elem.captureStreamUntilEnded() to generate a MediaStream from the decoded audio/video. Individual tracks could then be used to build derivative streams if you like. You get them all, and get them in a synchronized way (inside one MediaStream). > Regarding streaming (or capture) of other visible media content from a web page, I would propose simply extending the MediaStreamTrackList:add API as follows: > > void add((MediaStreamTrack or HTMLImageElement or HTMLCanvasElement or HTMLMediaElement) track); > > This augmented API would add the provided track, or in the case of the image/canvas/video/audio element, would create a new video track based on a snapshot of those elements' contents at that moment in time and add the new track to the videoTracks list. To be clear the track would just keep sending that same snapshot image the entire time its enabled (unless we want to make an exception for an HTMLMediaElement). -- Randell Jesup randell-ietf@jesup.org
Received on Monday, 30 July 2012 20:02:25 UTC