Reputation: 29
I would like to stream a video file selected through the input file to a peer using WebRTC.
Details: I would like to use the addstream method instead of the data channel for this purpose.
In my code I generated a blob from the file, like this:
localVideo.src = window.URL.createObjectURL(file);
It plays correctly locally.
But I also would like to stream this video to a peer.
Then I try to generate a MediaStream from the blob to use it as parameter of the method addstream.
None of these methods works on chrome Version 37.0.2062.120 (64-bit)
localVideo.captureStream
localVideo.createMediaElementSource
localVideo.captureStreamUntilEnded
localVideo.stream
localVideo.srcObject
localStream.mozCaptureStreamUntilEnded
Anyone know how to do it?
Upvotes: 3
Views: 3452
Reputation: 7566
You have two options:
mozCaptureStreamUntilEnded
There is no implementation in Chrome that is built for streaming a video file as a MediaStream as of yet.
Muaz Kahn WebRTC Experiments has a small script that should simplify this for you. It takes into account both options.
Upvotes: 1