Peerjs: Switch Camera During Call

Created on 27 May 2017  ·  6Comments  ·  Source: peers/peerjs

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);
});

Most helpful comment

It is not possible.

All 6 comments

It is not possible.

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

Really??? that's not possible?

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

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

You can use replaceTrack of RTCRtpSender.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

afrokick picture afrokick  ·  5Comments

senihtosun picture senihtosun  ·  5Comments

geraldsamosir picture geraldsamosir  ·  6Comments

nhducseuit picture nhducseuit  ·  5Comments

Kitanga picture Kitanga  ·  5Comments