startScreenCapture method

FutureOr<int> startScreenCapture(
  1. ScreenMediaType type,
  2. dynamic mediaProjectionResultData
)

@detail api @hiddensdk(audiosdk) @author wangqianqian.1104 @brief The RTC SDK start capturing the screen audio and/or video stream internally. @param type Media type. See ScreenMediaType{@link #ScreenMediaType} @param mediaProjectionResultData The Intent obtained after applying for screen sharing permission from the Android device. See getMediaProjection. @return - 0: Success. - < 0 : Fail. See ReturnStatus{@link #ReturnStatus} for more details @note - The call of this API takes effects only when you are using RTC SDK to record screen. You will get a warning by onVideoDeviceWarning{@link #IRTCEngineEventHandler#onVideoDeviceWarning} or onAudioDeviceWarning{@link #IRTCEngineEventHandler#onAudioDeviceWarning} after calling this API when the source is set to an external recorder. - After capturing, you need to call publishStreamAudio{@link #RTCRoom#publishStreamAudio} and/or publishStreamVideo{@link #RTCRoom#publishStreamVideo} to push to the remote end. - You will receive onVideoDeviceStateChanged{@link #IRTCEngineEventHandler#onVideoDeviceStateChanged} and onAudioDeviceStateChanged{@link #IRTCEngineEventHandler#onAudioDeviceStateChanged} when the capturing is started. - To stop capturing, call stopScreenCapture{@link #RTCEngine#stopScreenCapture}.

Implementation

FutureOr<int> startScreenCapture(
    ScreenMediaType type, Intent mediaProjectionResultData) async {
  return await nativeCall(
      'startScreenCapture', [type.$value, mediaProjectionResultData]);
}