enableFaceDetection method Null safety

Future<void> enableFaceDetection(
  1. bool enable
)

Enables/Disables face detection for the local user.

Once face detection is enabled, the SDK triggers the RtcEngineEventHandler.facePositionChanged callback to report the face information of the local user, which includes the following aspects:

  • The width and height of the local video.
  • The position of the human face in the local video.
  • The distance between the human face and the device screen.

Note

You can call this method either before or after joining a channel.

Parameter enable Determines whether to enable the face detection function for the local user:

  • true: Enable face detection.
  • false: (Default) Disable face detection.

Implementation

@override
Future<void> enableFaceDetection(bool enable) {
  return _invokeMethod('enableFaceDetection', {
    'enable': enable,
  });
}