subscribeStream abstract method
Subscribes to specific remote media streams captured by camera/microphone, or updates subscription options.
uid
: ID of the remote user who published the target audio/video stream.
type
: Media stream type.
See ReturnStatus for return values.
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.onUserPublishStream 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.unsubscribeStream.
- Exceptions during the call are notified through RTCRoomEventHandler.onStreamStateChanged, see ErrorCode for specific reasons.
Implementation
Future<int?> subscribeStream({
required String uid,
required MediaStreamType type,
});