startScreenCapture method
参数:
encParams 设置屏幕分享时的编码参数,推荐采用上述推荐配置,如果您指定 encParams 为 nil,则使用您调用 startScreenCapture 之前的编码参数设置。
appGroup 该参数仅仅在ios端有效,Android端不需要关注这个参数。该参数是主 App 与 Broadcast 共享的 Application Group Identifier。
在ios下如果appGroup为空的话,将只能变为应用内的屏幕分享,并且只有在iOS 13.0 及以上的有效
Implementation
Future<void> startScreenCapture(TRTCVideoEncParam encParams,
[String appGroup = '']) {
if (Platform.isAndroid) {
return _channelInvokeMethod(
'startScreenCapture', {"encParams": jsonEncode(encParams)});
}
if (Platform.isIOS && appGroup != '') {
return _channelInvokeMethod('startScreenCaptureByReplaykit', {
"encParams": jsonEncode(encParams),
"appGroup": appGroup,
});
} else if (Platform.isIOS && appGroup == '') {
return _channelInvokeMethod('startScreenCaptureInApp', {
"encParams": jsonEncode(encParams),
});
}
return _channelInvokeMethod(
'startScreenCapture', {"encParams": jsonEncode(encParams)});
}