setChannelProperties method
Function to set all the channel properties.
Implementation
void setChannelProperties(AgoraChannelData agoraChannelData) async {
await value.engine?.setChannelProfile(agoraChannelData.channelProfile);
if (agoraChannelData.channelProfile == ChannelProfile.LiveBroadcasting) {
await value.engine?.setClientRole(agoraChannelData.clientRole);
} else {
print('You can only set channel profile in case of Live Broadcasting');
}
value = value.copyWith(
isActiveSpeakerDisabled: agoraChannelData.isActiveSpeakerDisabled);
await value.engine
?.muteAllRemoteVideoStreams(agoraChannelData.muteAllRemoteVideoStreams);
await value.engine
?.muteAllRemoteAudioStreams(agoraChannelData.muteAllRemoteAudioStreams);
if (agoraChannelData.setBeautyEffectOptions != null) {
await value.engine?.setBeautyEffectOptions(
true, agoraChannelData.setBeautyEffectOptions!);
}
await value.engine
?.enableDualStreamMode(agoraChannelData.enableDualStreamMode);
if (agoraChannelData.localPublishFallbackOption != null) {
await value.engine?.setLocalPublishFallbackOption(
agoraChannelData.localPublishFallbackOption!);
}
if (agoraChannelData.remoteSubscribeFallbackOption != null) {
await value.engine?.setRemoteSubscribeFallbackOption(
agoraChannelData.remoteSubscribeFallbackOption!);
}
if (agoraChannelData.videoEncoderConfiguration != null) {
await value.engine?.setVideoEncoderConfiguration(
agoraChannelData.videoEncoderConfiguration!);
}
await value.engine?.setCameraAutoFocusFaceModeEnabled(
agoraChannelData.setCameraAutoFocusFaceModeEnabled);
await value.engine?.setCameraTorchOn(agoraChannelData.setCameraTorchOn);
await value.engine?.setAudioProfile(
agoraChannelData.audioProfile, agoraChannelData.audioScenario);
}