| | |
| | | #import <Photos/Photos.h> |
| | | #import "AudioSessionHelper.h" |
| | | #import "CBToast.h" |
| | | #import "ESVideo.h" |
| | | |
| | | @interface ESVideoMonitorViewController ()<ESVideoPhoneDelegate> |
| | | |
| | |
| | | #pragma SDK可视对讲 功能部分 |
| | | -(void)initESVideo{ |
| | | //初始化中断,进入后台的tag |
| | | _es = ESVideo.shareInstance.es; |
| | | |
| | | _playing = NO; |
| | | _isSpeaking = NO; |
| | | self.isInterrupt = NO; |
| | |
| | | }); |
| | | }; |
| | | //门口机会有视频的长宽高,是固定的(暂时还不确定) |
| | | _es = [[ESVideoPhone alloc]initESVideoPhoneWithFrame:CGRectMake(0, 57, APP_SCREEN_WIDTH, 211) delegate:self imagecallBack:snapImageCallback]; |
| | | // _es = [[ESVideoPhone alloc]initESVideoPhoneWithFrame:CGRectMake(0, 57, APP_SCREEN_WIDTH, 211) delegate:self imagecallBack:snapImageCallback]; |
| | | if (_es) { |
| | | //判断视频渲染是否初始化成功,如果失败会走ESVideoPhoneDelegate方法 |
| | | if (_es.showView) { |
| | | // for(UIView *view in [_es.showView subviews]) |
| | | // { |
| | | // [view removeFromSuperview]; |
| | | // } |
| | | _es.delegate = self; |
| | | ESVideo.shareInstance.snapImageCallback = snapImageCallback; |
| | | _es.showView.backgroundColor = [UIColor whiteColor]; |
| | | [self.centerView addSubview:_es.showView]; |
| | | _es.showView.hidden = YES; |
| | | } |
| | | }else{ |
| | | NSLog(@"ESVideoPhone 初始化失败"); |
| | |
| | | [_es stopTalk]; |
| | | |
| | | _es.delegate = nil; |
| | | |
| | | |
| | | ESVideo.shareInstance.snapImageCallback = nil; |
| | | // _es.showView.removeFromSuperview; |
| | | |
| | | } |
| | | [_es freeSubClass]; |
| | | |
| | | // [_es freeSubClass]; |
| | | } |
| | | |
| | | -(void)dealloc{ |
| | |
| | | }else if([phoneEventStr isEqual:@"EVT_Connected"]){ |
| | | [self speaker:nil]; |
| | | // [_mCallOrAccept setTitle:@"通话中..." forState:UIControlStateNormal]; |
| | | }else if([phoneEventStr isEqual:@"EVT_MonitorConnected"]){ |
| | | _es.showView.hidden = NO; |
| | | [self speaker:nil]; |
| | | // [_mCallOrAccept setTitle:@"通话中..." forState:UIControlStateNormal]; |
| | | }else if([phoneEventStr isEqual:@"EVT_HangUp"]){ |
| | | |
| | | |