enableFaceDetection method

  1. @override
Future<void> enableFaceDetection(
  1. bool enabled
)

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 enabled 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 enabled) {
  return _invokeMethod('enableFaceDetection', {
    'enabled': enabled,
  });
}