muteLocalVideo abstract method
- TRTCVideoStreamType streamType,
- bool mute
Pause/Resume publishing local video stream
This API can pause (or resume) publishing the local video image. After the pause, other users in the same room will not be able to see the local image.
This API is equivalent to the two APIs of startLocalPreview/stopLocalPreview
when TRTCVideoStreamTypeBig is specified, but has higher performance and response speed.
The startLocalPreview/stopLocalPreview
APIs need to enable/disable the camera,
which are hardware device-related operations, so they are very time-consuming.
In contrast, muteLocalVideo
only needs to pause or allow the data stream at the software level,
so it is more efficient and more suitable for scenarios where frequent enabling/disabling are needed.
After local video publishing is paused, other members in the same room will receive the onUserVideoAvailable(userId, false)
callback notification.
After local video publishing is resumed, other members in the same room will receive the onUserVideoAvailable(userId, true)
callback notification.
Parameters:
- mute(bool):
- true: pause; false: resume.
- streamType(TRTCVideoStreamType):
- Specify for which video stream to pause (or resume). Only TRTCVideoStreamType.big and TRTCVideoStreamType.sub are supported.
Implementation
void muteLocalVideo(TRTCVideoStreamType streamType, bool mute);