3

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?

1
  • This may give you some direction. Note, that I do not believe that there is a implementation in Chrome as of yet. Also, mozCaptureStreamUntilEnded is in FireFox only. Commented Sep 15, 2014 at 13:02

1 Answer 1

1

You have two options:

  1. Use a data connection and push each frame and then play each frame on the other side.
  2. If you are in firefox, you could try 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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.