Video is not displayed when connecting P2P using WebRtc

I am trying to create a VideoChat using WebRtc on my PC and Chrome on my mobile phone.

If I initiate the SDP Offer from the PC, the video is displayed,but if I initiate the SDP Offer from the mobile phone, the video is not displayed.Also, it displays fine on PC to PC and mobile phone to mobile phone.

Even if the video is not displayed,go throw the below code.

remoteVideoRef.current.srcObject = remoteStream;
    pc.ontrack = (event) => {
      // console.log('ontrack');
      console.log(pc.connectionState);
      const remoteStream = event.streams[0];
      if (remoteVideoRef && remoteVideoRef.current) {
        remoteVideoRef.current.srcObject = remoteStream;
      }
    };

How can I investigate why the video is not displayed?

Read more here: Source link