peers / peerjs

Simple peer-to-peer with WebRTC.
https://peerjs.com
MIT License
12.48k stars 1.43k forks source link

Switch Camera During Call #380

Closed RikdeVos closed 5 years ago

RikdeVos commented 7 years ago

I want to switch camera stream while in a call, without closing the connection to the other peer. Is this possible?

Currently doing something like this:

navigator.webkitGetUserMedia({video: true, audio: true}, (stream) => {
  peer.call(key, stream);
});
soulpcbr commented 7 years ago

It is not possible.

Mrsevic commented 7 years ago

It is possible. Take a look at skyway examples or this example: https://github.com/muaz-khan/WebRTC-Experiment/blob/master/demos/switch-streams.html

FelipeMiranda commented 6 years ago

Really??? that's not possible?

manhpham commented 5 years ago

Hi, any one can switch camera during call? Can you help me?

kidandcat commented 5 years ago

You need to establish a new connection, this is because of how WebRTC works.

afrokick commented 5 years ago

You can use replaceTrack of RTCRtpSender.

this.call.peerConnection.getSenders()[0].replaceTrack()