I am trying to upgrade audio to video using re-negotiate
toggleVideo(enableVideo) {
const { session } = this.state;
const constraints = {
offerToReceiveVideo: enableVideo,
};
const options = {
useUpdate: true,
rtcOfferConstraints: constraints,
};
if (session.connection.localDescription.type === 'offer') {
session.renegotiate(options, () => {
this.setState(() => ({ videoIsEnabled: enableVideo }));
const remoteStream = this.state.session.connection.getRemoteStreams()[0];
this.remoteMedia.current.srcObject = remoteStream.clone();
});
} else {
// answer
this.setState(() => ({ videoIsEnabled: enableVideo }));
// lots of changes tried here
}
}
The caller's video stream is sent to callee. So the callee could see both local and remote stream.
However, callee's video is not sent to the caller. Thus caller could only see local stream.