javascriptreactjsagora-web-sdk-ng

How to detect remote user shared screen from local user in agora rtc react


I am using agora rtc react. By using it, I can share screens from the local end but can't detect it from the remote user end and vice versa. Hooks i have used are,

import {
  ILocalAudioTrack,
  ILocalVideoTrack,
  LocalAudioTrack,
  LocalVideoTrack,
  RemoteUser,
  useJoin,
  useLocalCameraTrack,
  useLocalMicrophoneTrack,
  useLocalScreenTrack,
  usePublish,
  useRemoteUsers,
} from 'agora-rtc-react';```

All of them are working fine but I couldn't find any other way to detect screen share from other user end.

Solution

  • to detect the screen share you have to create a client first call the

    client.on('user-published')

    event which will return user and mediaType this event will also called when a user turns the camera or microphone on.