AgoraIO-Extensions/agora-rtc-react

Video is not published from phone to desktop

Closed this issue · 0 comments

What kind of problem do you need help?

I am using "agora-rtc-react": "^2.3.0"

When I connect two users over video on a desktop computer, everything works fine.

However, when I publish video and audio tracks from a mobile device (iPhone 15 Pro) to a desktop computer, I receive the audio, but no video.

Is there anything different about publishing the video from a mobile device?

This is (most of) the code I am using:

const { localMicrophoneTrack } = useLocalMicrophoneTrack(micEnabled, {
    microphoneId: selectedMic?.deviceId,
  });

const { localCameraTrack } = useLocalCameraTrack(cameraEnabled, {
    cameraId: selectedCamera?.deviceId,
  }); 

const { audioTracks } = useRemoteAudioTracks(remoteUsers);
audioTracks.forEach((track) => track.play());

const remoteUsers = useRemoteUsers();
const remoteUser = remoteUsers.filter(
    (user) => user.uid !== currentUser?.id && user.uid && currentUser?.id,
  )?.[0];


usePublish([localMicrophoneTrack, localCameraTrack]);
useJoin(
    {
      appid: env.NEXT_PUBLIC_AGORA_APP_ID ?? "",
      channel: videoDate?.agoraChannel ?? "",
      token: null,
      uid: currentUser?.id,
    },
    (!!videoDate?.agoraChannel && currentUser?.id !== null) ?? false,
);
  
return <><LocalUser
                audioTrack={localMicrophoneTrack}
                videoTrack={localCameraTrack}
                cameraOn={true}
                reversed={true}
                micOn={true}
                playAudio={false}
                playVideo={true}
              />
<RemoteUser
          user={remoteUser}
          className="absolute bottom-0 left-0 right-0 top-0 bg-gray-800"
        /></>