我试图将ooVoo连接到我的应用中。 (* ooVoo是视频聊天框架) 但是我已经陷入了第一阶段,即打开预览。 它只显示空白的黑色。 我错过了什么?
以下是我的代码。 (我也在这里上传了我的项目https://github.com/lossefanya/OovooTest)
self.oovooClient = [ooVooClient sharedInstance];
[self.oovooClient authorizeClient:OOVOO_TOKEN completion:^(SdkResult *result) {
[self.oovooClient.Account login:@"tester" completion:^(SdkResult *result) {
VideoPanel *videoPanel = [[VideoPanel alloc] initWithFrame:CGRectMake(0, 0, 300, 300)];
self.oovooClient.AVChat.delegate = self;
self.oovooClient.AVChat.VideoController.delegate = self;
[self.oovooClient.AVChat.VideoController bindVideoRender:nil render:videoPanel];
[self.oovooClient.AVChat.VideoController openCamera];
[[KGModal sharedInstance] showWithContentView:videoPanel];
}];
}];
仅供参考,我已阅读并关注他们的文件和示例代码。 https://github.com/oovoodev/Documentation/blob/master/iOS%20Documentation/Development%20Guide%20-%20iOS.md
答案 0 :(得分:0)
我无法理解为什么。但我发现ooVoo VideoPanel应该有父视图。喜欢以下
self.oovooClient = [ooVooClient sharedInstance];
[self.oovooClient authorizeClient:OOVOO_TOKEN completion:^(SdkResult *result) {
NSLog(@"ooVoo init: %@", result);
[self.oovooClient.Account login:@"tester" completion:^(SdkResult *result) {
NSLog(@"ooVoo login: %@", result);
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 300)];
VideoPanel *videoPanel = [[VideoPanel alloc] initWithFrame:CGRectMake(0, 0, 300, 300)];
[view addSubview:videoPanel];
self.oovooClient.AVChat.delegate = self;
self.oovooClient.AVChat.VideoController.delegate = self;
[self.oovooClient.AVChat.VideoController bindVideoRender:nil render:videoPanel];
[self.oovooClient.AVChat.VideoController openCamera];
[[KGModal sharedInstance] showWithContentView:view];
}];
}];