initRtcEngine method
void
initRtcEngine()
Implementation
void initRtcEngine() async {
//美颜使用
// rtcEngine = await RtcEngine.create(widget.agoraAppKey);
//普通使用
rtcEngine =
await RtcEngine.createWithContext(RtcEngineContext(widget.agoraAppKey));
addAgoraEventHandlers();
rtcEngine?.enableVideo();
rtcEngine?.enableAudio();
rtcEngine?.setChannelProfile(ChannelProfile.Communication);
VideoEncoderConfiguration config = VideoEncoderConfiguration();
config.orientationMode = VideoOutputOrientationMode.FixedPortrait;
rtcEngine?.setVideoEncoderConfiguration(config);
widget.delegate?.onVideoSetState();
rtcEngine?.setBeautyEffectOptions(
true,
BeautyOptions(
lighteningContrastLevel: LighteningContrastLevel.Normal,
lighteningLevel: .6,
smoothnessLevel: .5,
rednessLevel: .1,
),
);
}