ios_startScreenVideoCapture method

Future<int?> ios_startScreenVideoCapture(
  1. ByteRTCScreenCaptureSourceInfo sourceInfo,
  2. ByteRTCScreenCaptureParam captureParameters
)

@platform ios @hidden(iOS) @detail api @hiddensdk(audiosdk) @author liyi.000 @brief Capture screen video stream for sharing. Screen video stream includes: content displayed on the screen, or content in the application window. @param sourceInfo Screen capture source information. See ByteRTCScreenCaptureSourceInfo{@link #ByteRTCScreenCaptureSourceInfo}.
Call getScreenCaptureSourceList{@link #ByteRTCEngine#getScreenCaptureSourceList} to get all the screen sources that can be shared. @param captureParameters Screen capture parameters. See ByteRTCScreenCaptureParam{@link #ByteRTCScreenCaptureParam}. @return - 0: Success; - -1: Failure; @note - The call of this API takes effects only when you are using RTC SDK to record screen. You will get a warning by rtcEngine:onVideoDeviceWarning:deviceType:deviceWarning:{@link #ByteRTCEngineDelegate#rtcEngine:onVideoDeviceWarning:deviceType:deviceWarning} after calling this API when the video source is set to an external recorder. - This API only starts screen capturing but does not publish the captured video. Call publishScreenVideo:{@link #ByteRTCRoom#publishScreenVideo} to publish the captured video. - To turn off screen video capture, call stopScreenVideoCapture{@link #ByteRTCEngine#stopScreenVideoCapture}. - Local users will receive rtcEngine:onVideoDeviceStateChanged:device_type:device_state:device_error:{@link #ByteRTCEngineDelegate#rtcEngine:onVideoDeviceStateChanged:device_type:device_state:device_error} on the state of screen capturing such as start, pause, resume, and error. - After successfully calling this API, local users will receive rtcEngine:onFirstLocalVideoFrameCaptured:withFrameInfo:{@link #ByteRTCEngineDelegate#rtcEngine:onFirstLocalVideoFrameCaptured:withFrameInfo}. - Before calling this API, you can call setScreenVideoEncoderConfig:{@link #ByteRTCEngine#setScreenVideoEncoderConfig} to set the frame rate and encoding resolution of the screen video stream. - After receiving rtcEngine:onFirstLocalVideoFrameCaptured:withFrameInfo:{@link #ByteRTCEngineDelegate#rtcEngine:onFirstLocalVideoFrameCaptured:withFrameInfo}, you can set the local screen sharing view by calling setLocalVideoCanvas:withCanvas:{@link #ByteRTCEngine#setLocalVideoCanvas:withCanvas} or setLocalVideoSink:withSink:withPixelFormat:{@link #ByteRTCEngine#setLocalVideoSink:withSink:withPixelFormat}. - After you start capturing screen video stream for sharing,you can call updateScreenCaptureHighlightConfig:{@link #ByteRTCEngine#updateScreenCaptureHighlightConfig} to update border highlighting settings, updateScreenCaptureMouseCursor:{@link #ByteRTCEngine#updateScreenCaptureMouseCursor} to update the processing settings for the mouse, and updateScreenCaptureFilterConfig:{@link #ByteRTCEngine#updateScreenCaptureFilterConfig} to set the window that needs to be filtered on PC clinets.

Implementation

Future<int?> ios_startScreenVideoCapture(
    $p_i.ByteRTCScreenCaptureSourceInfo sourceInfo,
    $p_i.ByteRTCScreenCaptureParam captureParameters) async {
  $() => ($instance as $p_i.ByteRTCEngine)
      .startScreenVideoCapture(sourceInfo, captureParameters);

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