enableLocalVideo abstract method

Future<void> enableLocalVideo(
  1. bool enabled
)

Enables or disables local video capture.

This method disables or re-enables local video capture and does not affect receiving remote video. After calling enableVideo, local video capture is enabled by default. If you call enableLocalVideo(false) in a channel to disable local video capture, it also stops publishing the video stream in the channel. To re-enable, call enableLocalVideo(true), then call updateChannelMediaOptions and set the options parameter to publish the captured video stream to the channel. After successfully enabling or disabling local video capture, the remote side receives the onRemoteVideoStateChanged callback. This method can be called before or after joining a channel. However, settings made before joining only take effect after joining. This method sets the internal engine to an enabled state and remains effective after leaving the channel.

  • enabled Whether to enable local video capture. true : (Default) Enable local video capture. false : Disable local video capture. After disabling, the remote user cannot receive the local video stream, but the local user can still receive the remote video stream. When set to false, this method does not require a local camera.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions.

Implementation

Future<void> enableLocalVideo(bool enabled);