setLocalVideoConfig method Null safety

Future<int> setLocalVideoConfig(
  1. NERtcVideoConfig videoConfig
)

Set the video encoding profile.

  • The audio-only SDK disables this API. If you need to use the API, you can download the standard SDK from the CommsEase official website and replace the audio-only SDK.
  • You can call this method before or after you join the room.
  • After the setting is configured. The setting takes effect the next time the local video is enabled.
  • Each profile has a set of video parameters, such as resolution, frame rate, and bitrate. All the specified values of the parameters are the maximum values in optimal conditions. If the video engine cannot use the maximum value of resolution, frame rate, or bitrate due to unreliable network conditions, the value closest to the maximum value is used.

Video profile configuration config. For more information, see NERtcVideoEncodeConfiguration. Return 0 indicates a successful call.

Implementation

Future<int> setLocalVideoConfig(NERtcVideoConfig videoConfig) async {
  IntValue reply = await _api.setLocalVideoConfig(SetLocalVideoConfigRequest()
    ..frontCamera = videoConfig.frontCamera
    ..videoCropMode = videoConfig.videoCropMode
    ..videoProfile = videoConfig.videoProfile
    ..frameRate = videoConfig.frameRate
    ..minFrameRate = videoConfig.minFrameRate
    ..bitrate = videoConfig.bitrate
    ..minBitrate = videoConfig.minBitrate
    ..degradationPrefer = videoConfig.degradationPrefer
    ..width = videoConfig.width
    ..height = videoConfig.height
    ..cameraType = videoConfig.cameraType
    ..mirrorMode = videoConfig.mirrorMode
    ..orientationMode = videoConfig.orientationMode);
  return reply.value ?? -1;
}