onLocalPublishFallbackToAudioOnly method Null safety

void onLocalPublishFallbackToAudioOnly(
  1. bool isFallback,
  2. int streamType
)

Occurs when the published local media stream falls back to an audio-only stream due to poor network conditions or switches back to an audio and video stream after the network condition improves.

If you call NERtcEngine.setLocalPublishFallbackOption to set the fallback option, and set the value to NERtcStreamFallbackOptions.audioOnly, the local published stream will fall back to an audio-only stream. or resume to an audio and video stream when the upstream network improves. Then, this callback is triggered.

isFallback checks if the published stream falls back or resumes.

  • true: The local media stream falls back to audio-only stream due to poor network condition.
  • false: The local media stream resumes to an audio and video stream due to excellent network condition.

streamType indicates the type of a video stream, such as mainstream or substream. For more information, see NERtcVideoStreamType

Implementation

void onLocalPublishFallbackToAudioOnly(bool isFallback, int streamType);