onLocalVideoStateChanged property

(void Function(VideoSourceType source, LocalVideoStreamState state, LocalVideoStreamReason error)?) onLocalVideoStateChanged
final

Occurs when the local video stream state changes. When the state of the local video stream changes (including the state of the video capture and encoding), the SDK triggers this callback to report the current state. This callback indicates the state of the local video stream, including camera capturing and video encoding, and allows you to troubleshoot issues when exceptions occur.The SDK triggers the onLocalVideoStateChanged callback with the state code of localVideoStreamStateFailed and error code of localVideoStreamErrorCaptureFailure in the following situations:The app switches to the background, and the system gets the camera resource.The camera starts normally, but does not output video frames for four consecutive seconds.When the camera outputs the captured video frames, if the video frames are the same for 15 consecutive frames, the SDK triggers the onLocalVideoStateChanged callback with the state code of localVideoStreamStateCapturing and error code of localVideoStreamErrorCaptureFailure. Note that the video frame duplication detection is only available for video frames with a resolution greater than 200 × 200, a frame rate greater than or equal to 10 fps, and a bitrate less than 20 Kbps.For some device models, the SDK does not trigger this callback when the state of the local video changes while the local video capturing device is in use, so you have to make your own timeout judgment.

  • source The capture type of the custom video source. See VideoSourceType .
  • state The state of the local video, see LocalVideoStreamState .
  • error The detailed error information, see LocalVideoStreamError .

Implementation

final void Function(VideoSourceType source, LocalVideoStreamState state,
    LocalVideoStreamReason error)? onLocalVideoStateChanged;