IvRRimUm
IvRRimUm

Reputation: 1834

Webrtc stream local video file

How would one stream a local media file(video file) to peers?( i am using janus-gateway - videoroom plugin for this ).

For audio there is webAudio, but what about the video?

Thanks!

Update: Maybe someone has an example? Or a small code snippet? Maybe a link to some lib?

Upvotes: 3

Views: 7794

Answers (1)

Ajay
Ajay

Reputation: 2643

Render the local video on Canvas & create stream object from Canvas element. And then you can add the stream to PeerConnection. Then stream will be sent to remote peer(Janus/Browser/any server).

Demo: https://webrtc.github.io/samples/src/content/capture/canvas-pc/

Source: https://github.com/webrtc/samples/blob/gh-pages/src/content/capture/canvas-pc/js/main.js#L45

Upvotes: 5

Related Questions