setLocalPublishFallbackOption method Null safety

Future<int> setLocalPublishFallbackOption(
  1. int option
)

Sets the fallback option for the published local video stream based on the network conditions.

The quality of the published local audio and video streams is degraded with poor quality network connections. /// If you call this method and set the option to NERtcStreamFallbackOptions.audioOnly:

  • With unreliable upstream network and the quality of audio and video streams are degraded, the SDK switches to receive a low-quality video stream or stops receiving video streams. This way, the audio quality is maintained or improved.
  • The SDK monitors the network performance and recovers audio and video streams if the network quality improves.
  • If the published audio and video stream from the local client falls back to the audio stream, or recovers to the audio and video stream, the SDK triggers the onLocalPublishFallbackToAudioOnly callback.

You must call the method before calling joinChannel.

options indicates the fallback options for publishing audio and video streams. The default value is disabled. For more information, see NERtcStreamFallbackOptions. Return 0 indicates a successful call.

Implementation

Future<int> setLocalPublishFallbackOption(int option) async {
  IntValue reply =
      await _api.setLocalPublishFallbackOption(IntValue()..value = option);
  return reply.value ?? -1;
}