startScreenCapture method
@hidden(macOS) @detail api @hiddensdk(audiosdk) @author wangzhanqiang @brief Starts capturing the screen audio and/or video stream with the RTC SDK internal module. @param type Media type. See ByteRTCScreenMediaType{@link #ByteRTCScreenMediaType}. @param bundleId The bundle ID of the Extension, which is used to only display your Extension in your app. @return - 0: Success. - < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} 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 rtcEngine:onVideoDeviceWarning:deviceType:deviceWarning:{@link #ByteRTCEngineDelegate#rtcEngine:onVideoDeviceWarning:deviceType:deviceWarning} or rtcEngine:onAudioDeviceWarning:deviceType:deviceWarning:{@link #ByteRTCEngineDelegate#rtcEngine:onAudioDeviceWarning:deviceType:deviceWarning} after calling this API when the source is set to an external recorder. - If you start the Extension from the iOS control center, this API do not need to be called. - After the streams are captured, you need to call publishScreenVideo:{@link #ByteRTCRoom#publishScreenVideo} and/or publishScreenAudio:{@link #ByteRTCRoom#publishScreenAudio} to push the streams to the remote end. - You will receive rtcEngine:onVideoDeviceStateChanged:device_type:device_state:device_error:{@link #ByteRTCEngineDelegate#rtcEngine:onVideoDeviceStateChanged:device_type:device_state:device_error} and rtcEngine:onAudioDeviceStateChanged:device_type:device_state:device_error:{@link #ByteRTCEngineDelegate#rtcEngine:onAudioDeviceStateChanged:device_type:device_state:device_error} when the capturing is started.
Implementation
FutureOr<int> startScreenCapture(
ByteRTCScreenMediaType type, NSString bundleId) async {
return await nativeCall(
'startScreenCapture:bundleId:', [type.$value, bundleId]);
}