registerLocalEncodedVideoFrameObserver method

Future<int?> registerLocalEncodedVideoFrameObserver(
  1. ILocalEncodedVideoFrameObserver observer
)

@detail api @hiddensdk(audiosdk) @author liuyangyang @brief Register a local video frame observer.
This method applys to both internal capturing and custom capturing.
After calling this API, SDK triggers onLocalEncodedVideoFrame{@link #ILocalEncodedVideoFrameObserver#onLocalEncodedVideoFrame} whenever a video frame is captured. @param observer Local video frame observer. See ILocalEncodedVideoFrameObserver{@link #ILocalEncodedVideoFrameObserver}. You can cancel the registration by setting it to null. @return - 0: Success. - < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details. @note You can call this API before or after entering the RTC room. Calling this API before entering the room ensures that video frames are monitored and callbacks are triggered as early as possible.

Implementation

Future<int?> registerLocalEncodedVideoFrameObserver(
    ILocalEncodedVideoFrameObserver observer) async {
  $a() => ($instance as $p_a.RTCEngine)
      .registerLocalEncodedVideoFrameObserver(packObject(
          observer, () => android_ILocalEncodedVideoFrameObserver()));
  $i() => ($instance as $p_i.ByteRTCEngine)
      .registerLocalEncodedVideoFrameObserver(
          packObject(observer, () => ios_ILocalEncodedVideoFrameObserver()));

  if (Platform.isAndroid) {
    return $a();
  } else if (Platform.isIOS) {
    return $i();
  } else {
    throw UnsupportedError(
        'Not Support Platform ${Platform.operatingSystem}');
  }
}