注册

iOS10 视频通话报错:Thread 1: EXC_BAD_ACCESS(code=1,address=0x50)


SDK 3.2.0


 
iOS 8.1 没有问题
 
报错地点在 callSession.localVideoView = * 这里。代码如下:
@implementation ViewController

- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
EMError *error = [[EMClient sharedClient] loginWithUsername:@"zhiquan" password:@"123456"];
if (!error) {
NSLog(@"登录成功");

[[EMClient sharedClient].callManager startVideoCall:@"changlin" completion:^(EMCallSession *callSession, EMError *error) {
if (!error) {
//1.对方窗口
callSession.remoteVideoView = [[EMCallRemoteView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
[self.view addSubview:callSession.remoteVideoView];

//2.自己窗口
CGFloat width = 80;
CGFloat height = self.view.frame.size.height / self.view.frame.size.width * width;
callSession.localVideoView = [[EMCallLocalView alloc] initWithFrame:CGRectMake(self.view.frame.size.width - 90, 100, width, height)];
[self.view addSubview:callSession.localVideoView];
} else {
NSLog(@"startVideoCall error is @%", error);
}
}];
} else {
NSLog(@"登录失败,error is @%", error);
}
}
已邀请:
iOS10需要添加info.plist文件相机权限字段。
    <key>NSPhotoLibraryUsageDescription</key>
<string>App需要您的同意,才能访问相册</string>

<key>NSCameraUsageDescription</key>
<string>App需要您的同意,才能访问相机</string>

<key>NSMicrophoneUsageDescription</key>
<string>App需要您的同意,才能访问麦克风</string>

<key>NSLocationUsageDescription</key>
<string>App需要您的同意,才能访问位置</string>

<key>NSLocationWhenInUseUsageDescription</key>
<string>App需要您的同意,才能在使用期间访问位置</string>

<key>NSLocationAlwaysUsageDescription</key>
<string>App需要您的同意,才能始终访问位置</string>

<key>NSCalendarsUsageDescription</key>
<string>App需要您的同意,才能访问日历</string>

<key>NSRemindersUsageDescription</key>
<string>App需要您的同意,才能访问提醒事项</string>

<key>NSMotionUsageDescription</key>
<string>App需要您的同意,才能访问运动与健身</string>

<key>NSHealthUpdateUsageDescription</key>
<string>App需要您的同意,才能访问健康更新 </string>

<key>NSHealthShareUsageDescription</key>
<string>App需要您的同意,才能访问健康分享</string>

<key>NSBluetoothPeripheralUsageDescription</key>
<string>App需要您的同意,才能访问蓝牙</string>

<key>NSAppleMusicUsageDescription</key>
<string>App需要您的同意,才能访问媒体资料库</string>
iOS10 上我加了这些字段后仍然出错,可能不是 @ted.zl 说的原因。

要回复问题请先登录注册