subscribeScreen abstract method

Future<int?> subscribeScreen({
  1. required String uid,
  2. required MediaStreamType type,
})

Subscribes to specific screen sharing media stream, or update subscription options.

uid: ID of the remote user who published the target screen audio/video stream.

type: Media stream type.

Return value:

Notes:

  • This method can be used to subscribe to a remote user for the first time, or to update the media stream type of an already subscribed remote user.
  • You must first get the remote stream information through RTCRoomEventHandler.onUserPublishScreen before calling this API to subscribe to streams as needed.
  • Once the local user subscribes to the remote stream, the subscription will sustain until the local user leaves the room or unsubscribe from it by calling RTCRoom.unsubscribeScreen.
  • Exceptions during the call are notified through RTCRoomEventHandler.onStreamStateChanged, see ErrorCode for specific reasons.

Implementation

Future<int?> subscribeScreen({
  required String uid,
  required MediaStreamType type,
});