【发布时间】:2016-06-11 12:46:57
【问题描述】:
我想使用 Tokbox 在 iOS 中提供屏幕共享 On/Off 功能。
我可以切换到设备屏幕共享,但共享屏幕后我无法切换回设备 Camara。
我已尝试使用以下代码。
-(void)toogleScreen{
if (isSharingEnable == YES) {
isSharingEnable = NO;
NSLog(@"%@",_publisher.description);
_publisher.videoCapture = nil;
[_publisher setVideoType:OTPublisherKitVideoTypeCamera];
_publisher.audioFallbackEnabled = YES;
} else {
isSharingEnable = YES;
[_publisher setVideoType:OTPublisherKitVideoTypeScreen];
_publisher.audioFallbackEnabled = NO;
TBScreenCapture* videoCapture =
[[TBScreenCapture alloc] initWithView:self.view];
[_publisher setVideoCapture:videoCapture];
}
}
【问题讨论】:
-
他们有一个加速器包来做这件事。 github.com/opentok/screensharing-annotation-acc-pack
标签: ios objective-c opentok tokbox screensharing