setVideoEncoderConfig method
@detail api @brief Sets the expected quality of the video stream by specifying the resolution, frame rate, bitrate, and the fallback strategy when the network is poor. @param encoderConfig See VideoEncoderConfig{@link #VideoEncoderConfig}. @return - 0: Success. - < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details. @note - Since V3.61, this method can only set a single profile for the video stream. If you intend to publish the stream in multiple qualities, use setLocalSimulcastMode{@link #RTCEngine#setLocalSimulcastMode}. - Without calling this method, only one stream will be sent with a profile of 640px × 360px @15fps. The default encoding preference is frame rate-first. - If you use an external video source, you can also use this method to set the encoding parameters.
Implementation
Future<int?> setVideoEncoderConfig(VideoEncoderConfig encoderConfig) async {
if (Platform.isAndroid) {
return ($instance as $a.RTCEngine).setVideoEncoderConfig(
unpackObject<$a.VideoEncoderConfig>(encoderConfig), {});
} else if (Platform.isIOS) {
return ($instance as $i.ByteRTCEngine).setVideoEncoderConfig(
unpackObject<$i.ByteRTCVideoEncoderConfig>(encoderConfig), {});
} else {
throw UnsupportedError(
'Not Support Platform ${Platform.operatingSystem}',
);
}
}