差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 后一修订版 两侧同时换到之后的修订记录 | ||
cs:300visitoraccess:iossdkapi [2020/02/20 06:55] dujiepeng |
cs:300visitoraccess:iossdkapi [2020/03/25 09:52] candywang [桌面共享] |
||
---|---|---|---|
行 551: | 行 551: | ||
}]; | }]; | ||
</code> | </code> | ||
+ | |||
+ | |||
+ | ==== 共享桌面 ==== | ||
+ | <code objc> | ||
+ | // view 为需要共享的view | ||
+ | [[HDClient sharedClient].callManager publishWindow:view completion:^(id obj, HDError * error) {}]; | ||
+ | </code> | ||
+ | |||
+ | ⚠️注:因为ios系统比较特殊,系统级别的共享方案在ios10推出,ios11才完善,您也可以公告自定义数据流的方式通过系统api获取桌面流,然后传入sdk中,具体参考如下: | ||
+ | <code> | ||
+ | [[HDClient sharedClient].callManager publishWindow:nil completion:^(id obj, HDError * error) { | ||
+ | [[RPScreenRecorder sharedRecorder] startCaptureWithHandler:^(CMSampleBufferRef _Nonnull sampleBuffer, RPSampleBufferType bufferType, NSError * _Nullable error) | ||
+ | { | ||
+ | if (CMSampleBufferDataIsReady(sampleBuffer) && bufferType == RPSampleBufferTypeVideo) | ||
+ | { | ||
+ | [[HDClient sharedClient].callManager inputCustomVideoSampleBuffer:sampleBuffer rotation:UIDeviceOrientationPortrait publishId:obj completion:^(HDError *error) {}]; | ||
+ | } | ||
+ | } | ||
+ | completionHandler:nil]; | ||
+ | }]; | ||
+ | </code> | ||
+ | |||
===== 高级功能 ===== | ===== 高级功能 ===== | ||