录制和回放1

This commit is contained in:
kai60 2020-10-03 16:49:18 +08:00
parent 68d139a184
commit 55d25d8fba
8 changed files with 104 additions and 14 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -1283,12 +1283,7 @@ Assign BOOL isPush;
}
else if ([model.type isEqualToString:@"camera"]){
// self.hidesBottomBarWhenPushed = YES;
// IfishP2PPlayBackListViewController *cameraShopVC=[[IfishP2PPlayBackListViewController alloc]init];
// cameraShopVC.camera = model.camera;
// [self.navigationController pushViewController:cameraShopVC animated:YES];
// self.hidesBottomBarWhenPushed = NO;
// soket
[[Socketsingleton sharedInstance] cutOffSocket];
//

View File

@ -640,7 +640,7 @@ Strong UIImage *screenShotImage;//截图
self.bottomToolHView.hidden = NO;
//view view
UIView *bottomHView = [[UIView alloc] initWithFrame:CGRectMake(0.0, CGRectGetMaxY(self.segControl.frame) + 10, width, height-CGRectGetMaxY(self.segControl.frame))];
UIView *bottomHView = [[UIView alloc] initWithFrame:CGRectMake(0.0, CGRectGetMaxY(self.segControl.frame) + 10, width, height-CGRectGetMaxY(self.segControl.frame)-10)];
bottomHView.backgroundColor = JWUIColorFromRGB(0xdddddd);
[self.view addSubview:bottomHView];
self.bottomFishHView = bottomHView;
@ -4570,6 +4570,23 @@ GWP2PCallErrorNotSupport,
}];
}
//
else if (indexPath.row ==6){
CameraRecordViewController*ca=[[CameraRecordViewController alloc]init];
ca.camera=self.contact;
[self.navigationController pushViewController:ca animated:YES];
}
else if (indexPath.row ==7){
IfishP2PPlayBackListViewController *cameraShopVC=[[IfishP2PPlayBackListViewController alloc]init];
cameraShopVC.camera = self.contact;
[self.navigationController pushViewController:cameraShopVC animated:YES];
}
}

View File

@ -68,10 +68,10 @@ static NSString *bootomRecCellIdentifier = @"IfishRecVideoViewCell";
////
//_dataImgArray = @[LXImageWithImageName(@"devicename_iocn_screenshots.png"),LXImageWithImageName(@"devicename_iocn_gallery.png"),LXImageWithImageName(@"devicename_iocn_rec.png"),LXImageWithImageName(@"devicename_iocn_playback.png"),LXImageWithImageName(@"devicename_iocn_care.png"),LXImageWithImageName(@"devicename_iocn_look.png"),LXImageWithImageName(@"devicename_iocn_Ilookat.png"),LXImageWithImageName(@"devicename_iocn_look.png"),LXImageWithImageName(@"devicename_iocn_look.png")];
//equipment_iocn_playback
_dataImgArray = @[LXImageWithImageName(@"equipment_iocn_printscreen"),LXImageWithImageName(@"equipment_iocn_gallery"),LXImageWithImageName(@"equipment_iocn_care"),LXImageWithImageName(@"equipment_iocn_look"),LXImageWithImageName(@"equipment_iocn_mylook"),LXImageWithImageName(@"equipment_iocn_share")];
_dataImgArray = @[LXImageWithImageName(@"equipment_iocn_printscreen"),LXImageWithImageName(@"equipment_iocn_gallery"),LXImageWithImageName(@"equipment_iocn_care"),LXImageWithImageName(@"equipment_iocn_look"),LXImageWithImageName(@"equipment_iocn_mylook"),LXImageWithImageName(@"equipment_iocn_share"),LXImageWithImageName(@"equipment_iocn_videorecord"),LXImageWithImageName(@"equipment_iocn_videoback")];
//_dataNameArray = @[@"截图",@"图库",@"录制",@"回放",@"我的看护",@"爱鱼看看",@"我的看看",@"",@""];
_dataNameArray = @[@"截图",@"图库",@"我的看护",@"爱鱼看看",@"我的看看",@"分享爱鱼奇"];
_dataNameArray = @[@"截图",@"图库",@"我的看护",@"爱鱼看看",@"我的看看",@"分享爱鱼奇",@"视频录制",@"视频回放"];
}
#pragma mark - UICollectionViewDataSource
@ -84,7 +84,7 @@ static NSString *bootomRecCellIdentifier = @"IfishRecVideoViewCell";
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
//return 9;
return 6;
return 8;
}
#pragma mark item

View File

@ -9,7 +9,11 @@
#import "BaseViewController.h"
#import "IfishCameraModel.h"
#import "MBProgressHUD.h"
#import <GWP2P/GWP2P.h>
@interface CameraRecordViewController : BaseViewController
@property (nonatomic,strong) IfishCameraModel *camera;
@property (nonatomic, strong) GWP2PVideoPlayer *player;//摄像头页面
@property (strong, nonatomic) MBProgressHUD *progressAlert;
@end

View File

@ -25,7 +25,7 @@ static const CGFloat ToastFade = 0.2;
@property(nonatomic) NSInteger minute;
@property(nonatomic,strong) NSTimer*timer;
@property(nonatomic,copy) NSString *timestr;
@property (nonatomic, assign) BOOL isConnectCamera;
@property(nonatomic) BOOL isRecording;
@property(nonatomic) NSIndexPath *timerIndex;
@property(nonatomic) NSIndexPath *switchIndex;
@ -92,7 +92,78 @@ static const CGFloat ToastFade = 0.2;
[self.view addSubview:self.tab];
}
-(void)connectDevice{
UserModel *model=[dataContorl getUserInfo];
NSString *userIDName=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff];
//
if ([GWP2PClient sharedClient].linkStatus != P2PLinkStatusOK) {
NSLog(@"正在检查P2P连接状态");
BOOL connectDevice = [[GWP2PClient sharedClient] connectWithAccount:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2 sessionID1:model.sessionID sessionID2:model.sessionID2 customerIDs:nil];
if (connectDevice) {
[self connectCamera];
}else{
NSLog(@"p2pConnect failure.失败,不能操作设备");
}
}
}
//
-(void)connectCamera{
[[GWP2PClient sharedClient] getMultipleDeviceStatusWithDeviceID:self.camera.cameraId password:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
if (success) {
_isConnectCamera = YES;
[self monitorP2PCall];
NSLog(@"当前连接设备信息:%@",dataDictionary);
}else{
_isConnectCamera = YES;
[self monitorP2PCall];
// _isConnectCamera = NO;
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [self.view makeToast:@"连接设备失败"];
// [self hiddenMonitoringUI:NO callWithErrorType:100 isReCall:NO];
// });
// return;
}
}];
}
#pragma mark --
-(void)monitorP2PCall{
if ([self.player isPlaying]) {//
return;
}
//p2p
if ([GWP2PClient sharedClient].linkStatus != P2PLinkStatusOK) {
[self connectDevice];
return;
}
//
if (!_isConnectCamera) {
[self connectCamera];
return;
}
WEAK_SELF;
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[weakSelf.player p2pCallDeviceWithDeviceId:self.camera.cameraId password:self.camera.cameraPass definition:GWP2PPTZDefinitionSD calling:^(NSDictionary *parameters) {
//
NSLog(@"[p2pCallDevice-Calling],paras=%@",parameters);
} accept:^(NSDictionary *parameters) {
NSLog(@"[p2pCallDevice-Accept],paras=%@",parameters);
} reject:^(GWP2PCallError error, NSString *errorCode) {
} ready:^{
} allowLAN:YES];
});
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
@ -623,12 +694,15 @@ static const CGFloat ToastFade = 0.2;
[self startTostVIew];
if (swt.isOn) {
_isManual = YES;
_isManual = NO;
[[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId
password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_OFF];
password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_ON];
[[P2PClient sharedClient] setDeviceRecordType:GWP2PRecordTypeSchedule withDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
NSLog(@"data=%@",dataDictionary);
}];;
}else{
_isManual = NO;
_isManual = YES;
[[P2PClient sharedClient] setRemoteRecordWithId:self.camera.cameraId
password:self.camera.cameraPass state:SETTING_VALUE_REMOTE_RECORD_STATE_ON];
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB