Publish and Subscribe
enableDualStreamMode [1/2]
Enables or disables dual-stream mode on the sender side.
virtual int enableDualStreamMode(bool enabled) __deprecated = 0;
- Deprecated
- Deprecated since v4.2.0. Use
setDualStreamModeinstead.
Dual-stream mode consists of a high-quality (high bitrate, high resolution) and a low-quality (low bitrate, low resolution) video stream. After enabling dual-stream mode, you can call setRemoteVideoStreamType to select the high or low-quality stream on the receiver side.
- This method applies to all types of video streams on the sender side, including but not limited to camera capture, screen sharing, and custom video streams.
- To enable dual-stream mode in multi-channel scenarios, use enableDualStreamModeEx.
- You can call this method before or after joining a channel.
Parameters
- enabled
- Whether to enable dual-stream mode:
- true: Enable dual-stream mode.
- false: (default) Disable dual-stream mode.
Return Values
- 0: Success.
- < 0: Failure.
enableDualStreamMode [2/2]
Sets the dual-stream mode and low-quality stream on the sender side.
virtual int enableDualStreamMode(bool enabled, const SimulcastStreamConfig& streamConfig) __deprecated = 0;
- Deprecated
- Deprecated since v4.2.0. Use
setDualStreamModeinstead.
- High-quality stream: high bitrate and resolution.
- Low-quality stream: low bitrate and resolution.
- This method applies to all types of video streams on the sender side, including but not limited to camera capture, screen sharing, and custom video streams.
- To enable dual-stream mode in multi-channel scenarios, use enableDualStreamModeEx.
- You can call this method before or after joining a channel.
Parameters
- enabled
- Whether to enable dual-stream mode:
- true: Enable dual-stream mode.
- false: (default) Disable dual-stream mode.
- streamConfig
- Configuration for the low-quality stream. See SimulcastStreamConfig.
Note: When
modeis set toDISABLE_SIMULCAST_STREAM,streamConfighas no effect.
Return Values
- 0: Success.
- < 0: Failure.
enableDualStreamModeEx
Enables or disables video streams with different quality levels on the sender side.
virtual int enableDualStreamModeEx(bool enabled, const SimulcastStreamConfig& streamConfig, const RtcConnection& connection) = 0;
- Deprecated
- Deprecated since v4.2.0. Use setDualStreamModeEx instead.
Video streams with different quality levels consist of a pair of high-quality (high bitrate, high resolution) and low-quality (low bitrate, low resolution) streams. After enabling this feature, you can call the setRemoteVideoStreamType method on the subscriber side to choose to receive either high- or low-quality video streams.
Scenario
This method is applicable in multi-channel scenarios.
Parameters
- enabled
- Whether to enable video streams with different quality levels:
- true: Enable.
- false: (Default) Disable.
- streamConfig
- Configuration for the low-quality stream. See SimulcastStreamConfig.
Note: When
modeis set toDISABLE_SIMULCAST_STREAM, settingstreamConfighas no effect. - connection
- Connection information. See RtcConnection.
Return Values
- 0: Success.
- < 0: Failure.
muteAllRemoteAudioStreams
Stops or resumes receiving all remote audio streams.
virtual int muteAllRemoteAudioStreams(bool mute) = 0;
This method stops or resumes receiving audio streams from all remote users who have joined or will join the channel via joinChannel. It is equivalent to autoSubscribeAudio in ChannelMediaOptions.
muteAllRemoteAudioStreams(true) after joining, the local user stops receiving audio streams from all users in the channel, including those who join after the call.Parameters
- mute
- Whether to stop receiving all remote audio streams:
- true: Stop receiving.
- false: Resume receiving.
Return Values
- 0: Success.
- < 0: Failure.
muteAllRemoteAudioStreamsEx
Stops or resumes subscribing to all remote users' audio streams.
virtual int muteAllRemoteAudioStreamsEx(bool mute, const RtcConnection& connection) = 0;
After you call this method, the local user stops or resumes subscribing to all remote users' audio streams, including those who join the channel after this method is called.
autoSubscribeAudio to false in ChannelMediaOptions when calling joinChannel.Scenario
This method applies to multi-channel scenarios.
Parameters
- mute
- Whether to stop subscribing to all remote users' audio streams:
- true: Stop subscribing to all remote users' audio streams.
- false: (Default) Subscribe to all remote users' audio streams.
- connection
- Connection information. See RtcConnection.
Return Values
- 0: The method call succeeds.
- < 0: The method call fails.
muteAllRemoteVideoStreams
Stops or resumes receiving all remote users' video streams.
virtual int muteAllRemoteVideoStreams(bool mute) = 0;
This method takes effect for all remote users who have joined or will join the channel via joinChannel, and is equivalent to autoSubscribeVideo in ChannelMediaOptions. Make sure to call this method after joining a channel.
muteAllRemoteVideoStreams(true) after joining a channel, the local user stops receiving all users' video streams in the channel, including those who join after the method is called.Parameters
- mute
- Whether to stop receiving all remote video streams:
- true: Stop receiving all remote video streams.
- false: Resume receiving all remote video streams.
Return Values
- 0: Success.
- < 0: Failure.
muteAllRemoteVideoStreamsEx
Stops or resumes subscribing to all remote users' video streams.
virtual int muteAllRemoteVideoStreamsEx(bool mute, const RtcConnection& connection) = 0;
After you call this method, the local user stops or resumes subscribing to all remote users' video streams, including those who join the channel afterward.
Scenario
This method applies to multi-channel scenarios.
Parameters
- mute
- Whether to stop subscribing to all remote users' video streams.
- true: Stop subscribing to all remote users' video streams.
- false: (Default) Subscribe to all remote users' video streams.
- connection
- Connection information. See RtcConnection.
Return Values
- 0: The method call succeeds.
- < 0: The method call fails.
muteLocalAudioStream
Controls whether to publish the locally captured audio stream.
virtual int muteLocalAudioStream(bool mute) = 0;
When you call this method to stop publishing the local audio stream, the audio capture device continues to work and is not affected.
Timing
You can call this method before or after joining a channel.
Parameters
- mute
- Whether to stop publishing the local audio stream:
- true: Stop publishing the local audio stream.
- false: (Default) Resume publishing the local audio stream.
Return Values
- 0: Success.
- < 0: Failure.
muteLocalAudioStreamEx
Stops or resumes publishing the local audio stream.
virtual int muteLocalAudioStreamEx(bool mute, const RtcConnection& connection) = 0;
Scenario
This method applies to multi-channel scenarios.
Parameters
- mute
- Whether to stop publishing the local audio stream:
- true: Stop publishing the local audio stream.
- false: (Default) Resume publishing the local audio stream.
- connection
- Connection information. See RtcConnection.
Return Values
- 0: Success.
- < 0: Failure.
muteLocalVideoStream
Controls whether to publish the captured local video stream.
virtual int muteLocalVideoStream(bool mute) = 0;
This method controls whether to publish the captured local video stream. If you call this method to stop publishing the local video stream, the video capturing device continues to work normally and is not affected. Compared to disabling local video by setting enableLocalVideo to false, this method responds faster.
Timing
You can call this method before or after joining a channel.
Parameters
- mute
- Whether to stop publishing the local video stream.
- true: Stop publishing the local video stream.
- false: (Default) Publish the local video stream.
Return Values
- 0: Success.
- < 0: Failure.
muteLocalVideoStreamEx
Stops or resumes publishing the local video stream.
virtual int muteLocalVideoStreamEx(bool mute, const RtcConnection& connection) = 0;
This method does not affect ongoing video recording because it does not turn off the camera.
Scenario
This method applies to multi-channel scenarios.
Parameters
- mute
- Whether to stop publishing the local video stream.
- true: Stop publishing the local video stream.
- false: (Default) Publish the local video stream.
- connection
- Connection information. See RtcConnection.
Return Values
- 0: Success.
- < 0: Failure.
muteRemoteAudioStream
Stops or resumes subscribing to the audio stream of a specified remote user.
virtual int muteRemoteAudioStream(uid_t uid, bool mute) = 0;
Timing
Call this method after joining a channel.
Parameters
- uid
- The user ID of the specified remote user.
- mute
- Whether to subscribe to the audio stream of the specified remote user.
- true: Stop subscribing to the user's audio stream.
- false: (Default) Subscribe to the user's audio stream.
Return Values
- 0: Success.
- < 0: Failure.
muteRemoteAudioStreamEx
Stops or resumes receiving audio stream from a specified user.
virtual int muteRemoteAudioStreamEx(uid_t uid, bool mute, const RtcConnection& connection) = 0;
You can call this method before or after joining a channel. If the user leaves the channel, the setting becomes invalid.
Scenario
This method applies to multi-channel scenarios.
Parameters
- uid
- The ID of the specified user.
- mute
- Whether to stop receiving the audio stream from the specified user:
- true: Stop receiving the audio stream from the specified user.
- false: (Default) Resume receiving the audio stream from the specified user.
- connection
- Connection information. See RtcConnection.
Return Values
- 0: Success.
- < 0: Failure.
muteRemoteVideoStream
Stops or resumes subscribing to the video stream of a specified remote user.
virtual int muteRemoteVideoStream(uid_t uid, bool mute) = 0;
Timing
Call this method after joining a channel.
Parameters
- uid
- The user ID of the specified remote user.
- mute
- Whether to subscribe to the specified remote user's video stream:
- true: Stop subscribing to the user's video stream.
- false: (Default) Subscribe to the user's video stream.
Return Values
- 0: Success.
- < 0: Failure.
muteRemoteVideoStreamEx
Stops or resumes receiving video stream from a specified remote user.
virtual int muteRemoteVideoStreamEx(uid_t uid, bool mute, const RtcConnection& connection) = 0;
Scenario
This method applies to multi-channel scenarios.
Timing
You can call this method before or after joining a channel to stop or resume receiving video stream from a specified remote user. If the user leaves the channel, the setting becomes invalid.
Parameters
- uid
- Remote user ID.
- mute
- Whether to stop receiving the video stream from the specified user:
- true: Stop receiving the video stream from the user.
- false: (Default) Resume receiving the video stream from the user.
- connection
- Connection information. See RtcConnection.
Return Values
- 0: Success.
- < 0: Failure.
setDualStreamMode [1/2]
Sets the video stream mode on the sender side to control whether to send a low-quality stream.
virtual int setDualStreamMode(SIMULCAST_STREAM_MODE mode) = 0;
By default, the SDK enables adaptive mode (AUTO_SIMULCAST_STREAM) for the low-quality stream on the sender side, meaning the sender does not proactively send the low-quality stream. A receiver with the host role can request the low-quality stream by calling setRemoteVideoStreamType, and the sender will start sending it upon receiving the request.
If you want to change this behavior, call this method and set mode to DISABLE_SIMULCAST_STREAM (never send) or ENABLE_SIMULCAST_STREAM (always send).
To revert to the default behavior, call this method again and set mode to AUTO_SIMULCAST_STREAM.
enableDualStreamMode is:
- Setting
modetoDISABLE_SIMULCAST_STREAMis equivalent to callingenableDualStreamMode(false). - Setting
modetoENABLE_SIMULCAST_STREAMis equivalent to callingenableDualStreamMode(true). - Both methods can be called before or after joining a channel. If both are called, the later one takes effect.
Parameters
- mode
- The video stream mode on the sender side. See SIMULCAST_STREAM_MODE.
Return Values
- 0: Success.
- < 0: Failure.
setDualStreamMode [2/2]
Configures the video stream mode for different quality layers on the sender side.
virtual int setDualStreamMode(SIMULCAST_STREAM_MODE mode, const SimulcastStreamConfig& streamConfig) = 0;
AUTO_SIMULCAST_STREAM) on the sender side, meaning the sender does not actively send the low-quality stream. The receiver with the broadcaster role can request the low-quality stream by calling setRemoteVideoStreamType, and the sender will automatically start sending it upon receiving the request.
- If you want to change this behavior, call this method and set
modetoDISABLE_SIMULCAST_STREAM(never send low-quality stream) orENABLE_SIMULCAST_STREAM(always send low-quality stream). - To restore the default behavior, call this method again and set
modetoAUTO_SIMULCAST_STREAM.
setDualStreamMode method (with parameter SIMULCAST_STREAM_MODE mode) is that this method also supports configuring the low-quality stream, and the SDK sends the video stream according to the configuration in streamConfig.enableDualStreamMode are as follows:
- Calling this method with
modeset toDISABLE_SIMULCAST_STREAMis equivalent to callingenableDualStreamModewithenabledset to false. - Calling this method with
modeset toENABLE_SIMULCAST_STREAMis equivalent to callingenableDualStreamModewithenabledset to true. - Both methods can be called before or after joining a channel. If both are called, the later call takes precedence.
Parameters
- mode
- The video stream sending mode. See SIMULCAST_STREAM_MODE.
- streamConfig
- Configuration for the low-quality video stream. See SimulcastStreamConfig.
Note: When
modeis set toDISABLE_SIMULCAST_STREAM,streamConfighas no effect.
Return Values
- 0: Success.
- < 0: Failure.
setDualStreamModeEx
Sets the video stream mode with multiple quality levels on the sender side.
virtual int setDualStreamModeEx(SIMULCAST_STREAM_MODE mode, const SimulcastStreamConfig& streamConfig, const RtcConnection& connection) = 0;
By default, the SDK enables the adaptive mode (AUTO_SIMULCAST_STREAM) for low-quality video streams on the sender side, meaning the sender does not proactively send low-quality video streams. Receivers with the host role can request low-quality streams by calling setRemoteVideoStreamTypeEx, and the sender will start sending them upon receiving the request.
If you want to change this behavior, call this method and set mode to DISABLE_SIMULCAST_STREAM (never send low-quality streams) or ENABLE_SIMULCAST_STREAM (always send low-quality streams).
To revert to the default behavior after changing it, call this method again and set mode to AUTO_SIMULCAST_STREAM.
- Calling this method with
modeset toDISABLE_SIMULCAST_STREAMis equivalent to callingenableDualStreamModeEx(false). - Calling this method with
modeset toENABLE_SIMULCAST_STREAMis equivalent to callingenableDualStreamModeEx(true). - Both methods can be called before or after joining a channel. If both are called, the latter takes precedence.
Scenario
This method is applicable in multi-channel scenarios.
Parameters
- mode
- The sending mode for video streams. See SIMULCAST_STREAM_MODE.
- streamConfig
- Configuration for the low-quality stream. See SimulcastStreamConfig.
Note: When
modeis set toDISABLE_SIMULCAST_STREAM, this parameter has no effect. - connection
- Connection information. See RtcConnection.
Return Values
- 0: Success.
- < 0: Failure.
setRemoteDefaultVideoStreamType
Sets the default video stream type to subscribe to.
virtual int setRemoteDefaultVideoStreamType(VIDEO_STREAM_TYPE streamType) = 0;
setDualStreamMode, the receiving client can call this method in the following scenarios:
- By default, the SDK enables adaptive small video stream mode (
AUTO_SIMULCAST_STREAM) on the sender, meaning only the high-quality stream is sent. In this case, only host-role receivers can call this method to request the low-quality stream. Once the sender receives the request, it starts sending the low-quality stream. Then all users in the channel can call this method to switch to low-quality stream subscription mode. - If the sender calls
setDualStreamModewithmodeset toDISABLE_SIMULCAST_STREAM(never send low-quality stream), this method has no effect. - If the sender calls
setDualStreamModewithmodeset toENABLE_SIMULCAST_STREAM(always send low-quality stream), both host and audience-role receivers can call this method to switch to low-quality stream subscription mode.
Timing
Call this method before joining a channel.
Parameters
- streamType
- The default video stream type to subscribe to. See VIDEO_STREAM_TYPE.
Return Values
- 0: Success.
- < 0: Failure.
setRemoteVideoStreamType
Sets the type of video stream to subscribe to.
virtual int setRemoteVideoStreamType(uid_t uid, VIDEO_STREAM_TYPE streamType) = 0;
setDualStreamMode, the receiver can use this method in the following scenarios:
- By default, the SDK enables the video low stream adaptive mode (
AUTO_SIMULCAST_STREAM) on the sender side, which means only the high-quality stream is sent. Only receivers with the host role can call this method to request the low-quality video stream. Once the sender receives the request, it automatically starts sending the low-quality stream. At this point, all users in the channel can call this method to switch to subscribe to the low-quality stream. - If the sender calls
setDualStreamModewithmodeset toDISABLE_SIMULCAST_STREAM(never send low-quality stream), this method has no effect. - If the sender calls
setDualStreamModewithmodeset toENABLE_SIMULCAST_STREAM(always send low-quality stream), both host and audience roles on the receiver side can call this method to switch to subscribe to the low-quality stream.
Timing
You can call this method before or after joining a channel.
Parameters
- uid
- The user ID.
- streamType
- The video stream type. See VIDEO_STREAM_TYPE.
Return Values
- 0: Success.
- < 0: Failure.
setRemoteVideoStreamTypeEx
Sets the type of video stream to subscribe to.
virtual int setRemoteVideoStreamTypeEx(uid_t uid, VIDEO_STREAM_TYPE streamType, const RtcConnection& connection) = 0;
- By default, the SDK enables video low stream adaptive mode (
AUTO_SIMULCAST_STREAM) on the sender, meaning only high stream is sent. In this case, only receivers with broadcaster role can call this method to request low stream. Once the sender receives the request, it automatically starts sending low stream. Then, all users in the channel can call this method to switch to low stream subscription mode. - If the sender calls
setDualStreamModeand setsmodetoDISABLE_SIMULCAST_STREAM(never send low stream), this method call is invalid. - If the sender calls
setDualStreamModeand setsmodetoENABLE_SIMULCAST_STREAM(always send low stream), both broadcaster and audience roles on the receiver can call this method to switch to low stream subscription mode.
mode to DISABLE_SIMULCAST_STREAM, this method call is invalid. You should call setDualStreamModeEx again on the sender and adjust the settings.Scenario
This method applies to multi-channel scenarios.
Parameters
- uid
- User ID.
- streamType
- Video stream type. See VIDEO_STREAM_TYPE.
- connection
- Connection information. See RtcConnection.
Return Values
- 0: Success.
- < 0: Failure.
setRemoteVideoSubscriptionOptions
Sets subscription options for remote video streams.
virtual int setRemoteVideoSubscriptionOptions(uid_t uid, const VideoSubscriptionOptions &options) = 0;
- If IVideoFrameObserver is registered, the SDK subscribes to both raw and encoded data by default.
- If IVideoEncodedFrameObserver is registered, the SDK subscribes to only encoded data by default.
- If both observers are registered, the default behavior follows the last registered observer. For example, if IVideoFrameObserver is registered last, the SDK subscribes to both raw and encoded data.
Parameters
- uid
- The user ID of the remote user.
- options
- The video subscription options. See VideoSubscriptionOptions.
Return Values
- 0: Success.
- < 0: Failure.
setRemoteVideoSubscriptionOptionsEx
Sets whether to subscribe to a remote user's video stream.
virtual int setRemoteVideoSubscriptionOptionsEx(uid_t uid, const VideoSubscriptionOptions& options, const RtcConnection& connection) = 0;
When a remote user enables dual-stream mode, you can call this method to set whether to subscribe to their video stream and specify the subscription options.
Scenario
This method applies to multi-channel scenarios.
Parameters
- uid
- The remote user ID.
- options
- Video subscription options. See VideoSubscriptionOptions.
- connection
- Connection information. See RtcConnection.
Return Values
- 0: Success.
- < 0: Failure.
setSubscribeAudioAllowlist
Sets the allowlist for audio stream subscription.
virtual int setSubscribeAudioAllowlist(uid_t* uidList, int uidNumber) = 0;
- You can call this method before or after joining a channel.
- The allowlist is not affected by muteRemoteAudioStream, muteAllRemoteAudioStreams, or the
autoSubscribeAudiosetting in ChannelMediaOptions. - Once the allowlist is set, it remains effective even if you leave and rejoin the channel.
- If a user is included in both the allowlist and blocklist, only the blocklist takes effect.
Parameters
- uidList
- The list of user IDs whose audio streams you want to subscribe to. To remove a user from the allowlist, call setSubscribeAudioAllowlist again with a new list that only includes the user IDs you still want to subscribe to.
- uidNumber
- The number of user IDs in the list.
Return Values
- 0: Success.
- < 0: Failure.
setSubscribeAudioAllowlistEx
Sets the allowlist for audio stream subscription.
virtual int setSubscribeAudioAllowlistEx(uid_t* uidList, int uidNumber, const RtcConnection& connection) = 0;
- You can call this method before or after joining a channel.
- The allowlist is not affected by muteRemoteAudioStream, muteAllRemoteAudioStreams, or the
autoSubscribeAudiosetting in ChannelMediaOptions. - Once the subscription allowlist is set, it remains effective even if you leave and rejoin the current channel.
- If a user is added to both the allowlist and blocklist, only the blocklist takes effect.
Scenario
This method applies to multi-channel scenarios.
Parameters
- uidList
- The list of user IDs you want to subscribe to. To subscribe to a user's audio stream, add the user's ID to this list. To remove a user from the allowlist, you need to call the setSubscribeAudioAllowlist method to update the user ID list; that is, you only need to include the user IDs of the users you want to subscribe to in the new list.
- uidNumber
- The number of users in the user ID list.
- connection
- Connection information. See RtcConnection.
Return Values
- 0: The method call succeeds.
- < 0: The method call fails.
setSubscribeAudioBlocklist
Sets the blocklist of users whose audio streams will not be subscribed to.
virtual int setSubscribeAudioBlocklist(uid_t* uidList, int uidNumber) = 0;
- You can call this method before or after joining a channel.
- The blocklist is not affected by muteRemoteAudioStream, muteAllRemoteAudioStreams, or the
autoSubscribeAudiosetting in ChannelMediaOptions. - Once the blocklist is set, it remains effective even if you leave and rejoin the channel.
- If a user is included in both the allowlist and blocklist, only the blocklist takes effect.
Parameters
- uidList
- The list of user IDs whose audio streams you do not want to subscribe to. To remove a user from the blocklist, call setSubscribeAudioBlocklist again with a new list that only includes the user IDs you still want to block.
- uidNumber
- The number of user IDs in the list.
Return Values
- 0: Success.
- < 0: Failure.
setSubscribeAudioBlocklistEx
Sets the blocklist of users whose audio streams are not subscribed.
virtual int setSubscribeAudioBlocklistEx(uid_t* uidList, int uidNumber, const RtcConnection& connection) = 0;
- You can call this method before or after joining a channel.
- The blocklist is not affected by muteRemoteAudioStream, muteAllRemoteAudioStreams, or the
autoSubscribeAudiosetting in ChannelMediaOptions. - Once the subscription blocklist is set, it remains effective even if you leave and rejoin the current channel.
- If a user is added to both the allowlist and blocklist, only the blocklist takes effect.
Scenario
This method applies to multi-channel scenarios.
Parameters
- uidList
- The list of user IDs whose audio streams you do not want to subscribe to. To remove a user from the blocklist, you need to call the setSubscribeAudioBlocklist method to update the user ID list.
- uidNumber
- The number of users in the user ID list.
- connection
- Connection information. See RtcConnection.
Return Values
- 0: The method call succeeds.
- < 0: The method call fails.
setSubscribeVideoAllowlist
Sets the allowlist for video stream subscription.
virtual int setSubscribeVideoAllowlist(uid_t* uidList, int uidNumber) = 0;
- You can call this method before or after joining a channel.
- The allowlist is not affected by muteRemoteVideoStream, muteAllRemoteVideoStreams, or the
autoSubscribeAudiosetting in ChannelMediaOptions. - Once the allowlist is set, it remains effective even if you leave and rejoin the channel.
- If a user is included in both the allowlist and blocklist, only the blocklist takes effect.
Parameters
- uidList
- The list of user IDs whose video streams you want to subscribe to. To remove a user, call setSubscribeVideoAllowlist again with a new list that only includes the user IDs you still want to subscribe to.
- uidNumber
- The number of user IDs in the list.
Return Values
- 0: Success.
- < 0: Failure.
setSubscribeVideoAllowlistEx
Sets the allowlist for video stream subscription.
virtual int setSubscribeVideoAllowlistEx(uid_t* uidList, int uidNumber, const RtcConnection& connection) = 0;
You can call this method to specify the users whose video streams you want to subscribe to.
- You can call this method before or after joining a channel.
- The allowlist is not affected by the muteRemoteVideoStream, muteAllRemoteVideoStreams, or
autoSubscribeAudiosettings in ChannelMediaOptions. - Once the allowlist is set, it remains effective even if you leave and rejoin the channel.
- If a user is added to both the allowlist and blocklist, only the blocklist takes effect.
Scenario
This method applies to multi-channel scenarios.
Parameters
- uidList
- The list of user IDs whose video streams you want to subscribe to. To subscribe to a user's video stream, add their user ID to this list. To remove a user from the allowlist, call setSubscribeVideoAllowlist to update the list and include only the user IDs you still want to subscribe to.
- uidNumber
- The number of user IDs in the list.
- connection
- Connection information. See RtcConnection.
Return Values
- 0: Success.
- < 0: Failure.
setSubscribeVideoBlocklist
Sets the blocklist for video stream subscription.
virtual int setSubscribeVideoBlocklist(uid_t* uidList, int uidNumber) = 0;
- You can call this method before or after joining a channel.
- The blocklist is not affected by muteRemoteVideoStream, muteAllRemoteVideoStreams, or the
autoSubscribeAudiosetting in ChannelMediaOptions. - Once the blocklist is set, it remains effective even if you leave and rejoin the channel.
- If a user is included in both the allowlist and blocklist, only the blocklist takes effect.
Parameters
- uidList
- The list of user IDs whose video streams you do not want to subscribe to. To remove a user from the blocklist, call setSubscribeVideoBlocklist again with a new list that only includes the user IDs you still want to block.
- uidNumber
- The number of user IDs in the list.
Return Values
- 0: Success.
- < 0: Failure.
setSubscribeVideoBlocklistEx
Sets the list of user IDs whose video streams you do not want to subscribe to.
virtual int setSubscribeVideoBlocklistEx(uid_t* uidList, int uidNumber, const RtcConnection& connection) = 0;
- You can call this method before or after joining a channel.
- The blocklist is not affected by the muteRemoteVideoStream, muteAllRemoteVideoStreams, or
autoSubscribeAudiosettings in ChannelMediaOptions. - Once the blocklist is set, it remains effective even if you leave and rejoin the channel.
- If a user is added to both the allowlist and blocklist, only the blocklist takes effect.
Scenario
This method applies to multi-channel scenarios.
Parameters
- uidList
- The list of user IDs whose video streams you do not want to subscribe to. To remove a user from the blocklist, call setSubscribeVideoBlocklist to update the list and include only the user IDs you still want to block.
- uidNumber
- The number of user IDs in the list.
- connection
- Connection information. See RtcConnection.
Return Values
- 0: Success.
- < 0: Failure.
onAudioPublishStateChanged
Callback triggered when the audio publishing state changes.
virtual void onAudioPublishStateChanged(const char* channel, STREAM_PUBLISH_STATE oldState, STREAM_PUBLISH_STATE newState, int elapseSinceLastState)
Parameters
- channel
- Channel name.
- oldState
- Previous audio publishing state. See STREAM_PUBLISH_STATE.
- newState
- Current audio publishing state. See STREAM_PUBLISH_STATE.
- elapseSinceLastState
- Time elapsed from the previous state to the current state (ms).
onAudioSubscribeStateChanged
Callback for audio subscription state changes.
virtual void onAudioSubscribeStateChanged(const char* channel, uid_t uid, STREAM_SUBSCRIBE_STATE oldState, STREAM_SUBSCRIBE_STATE newState, int elapseSinceLastState)
Parameters
- channel
- Channel name.
- uid
- Remote user ID.
- oldState
- Previous subscription state. See STREAM_SUBSCRIBE_STATE.
- newState
- Current subscription state. See STREAM_SUBSCRIBE_STATE.
- elapseSinceLastState
- Time elapsed from the previous state to the current state (ms).
onVideoSubscribeStateChanged
Callback for video subscription state changes.
virtual void onVideoSubscribeStateChanged(const char* channel, uid_t uid, STREAM_SUBSCRIBE_STATE oldState, STREAM_SUBSCRIBE_STATE newState, int elapseSinceLastState)
Parameters
- channel
- Channel name.
- uid
- Remote user ID.
- oldState
- Previous video subscription state. See STREAM_SUBSCRIBE_STATE.
- newState
- Current video subscription state. See STREAM_SUBSCRIBE_STATE.
- elapseSinceLastState
- Time elapsed from the previous state to the current state (ms).