5

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.

android_learner
  • 343
  • 2
  • 13
  • Could you elaborate more on what the issue is. – Shubham Khatri Apr 20 '20 at 12:32
  • Sure. This was about while audio call is ongoing, switching to video mode. We were able to make an audio call and also just a video. But switching between audio to video or video to audio got us into challenges. While upgrading(switching to video) only one of the participant's video was seen but other did not. – android_learner Apr 21 '20 at 16:28

0 Answers0