方向控制功能

This commit is contained in:
kai60
2021-05-10 10:51:06 +08:00
parent 38c2a62dfc
commit dd3acff62a
82 changed files with 3084 additions and 11 deletions
@@ -65,8 +65,9 @@
#import "Xuanduo2SettingController.h"
#import "MessageAlertView.h"
#import "CreatErWeiMaController.h"
#import "ELPCircleConsoleView.h"
//上部分视频封装 下部分分段控制器 封装 (下一步代码优化)
@interface IfishP2PMonitorController ()<HaveHotCoolWenDuPicviewDelegate,GWP2PVideoPlayerProtocol>
@interface IfishP2PMonitorController ()<HaveHotCoolWenDuPicviewDelegate,GWP2PVideoPlayerProtocol,ELPCircleConsoleMoveDelegate>
{
CGFloat _horizontalScreenH;
CGFloat _monitorInterfaceW;//rtsp监控界面弹出修改
@@ -107,6 +108,7 @@ Strong MessageAlertView *popView;
@property (strong, nonatomic) UIView *shutterView;
@property(nonatomic,strong) HaveHotCoolWenDuPicview *xuanduoPicView;
@property(nonatomic,strong) ELPCircleConsoleView *directionView;
Weak UIView *remoteView;//显示player的载体
Strong UIImage *screenShotImage;//截图
@end
@@ -485,6 +487,19 @@ Strong UIImage *screenShotImage;//截图
promptButton.tag = PROMPT_BUTTON_TAG;
[promptButton addTarget:self action:@selector(onVerticalBtnPress:) forControlEvents:UIControlEventTouchUpInside];
[self.canvasView addSubview:promptButton];
self.directionView=[[ELPCircleConsoleView alloc]init];
self.directionView.frame=CGRectMake(0, 0, 200, 200);
self.directionView.delegate=self;
[self.canvasView addSubview:self.directionView];
self.directionView.center=self.canvasView.center;
self.directionView.hidden=YES;
//self.directionView.image=LXImageWithImageName(@"equipment_iocn_joystick");
// [self.directionView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.center.mas_equalTo(self.canvasView);
// make.width.mas_equalTo(200);
// make.height.mas_equalTo(200);
// }];
self.promptButton = promptButton;
//图片frame
CGFloat progressView_wh = LOADINGPRESSVIEW_WIDTH_HEIGHT;
@@ -520,7 +535,7 @@ Strong UIImage *screenShotImage;//截图
[pressView setHidden:YES];
self.pressView = pressView;
[self.canvasView bringSubviewToFront:self.directionView];
//、横屏工具栏
CGFloat midtH=self.canvasView.frame.size.height/5;
@@ -717,6 +732,37 @@ Strong UIImage *screenShotImage;//截图
[self.popView loadInfoWithTitle:titles Icons:titleImgs];
}
#pragma mark - 方向控制
-(void)rotateCircleView:(ELPCircleConsoleView *)rotetaCircleView didRotateWithValueX:(NSString *)Xstr valueY:(NSString *)Ystr stop:(BOOL)needStop moveDirection:(ELPCircleConsoleMoveDirection)orientation{
//TODO for your own action method
if(orientation == ELPCircleConsoleMoveDirectionUp){
[self.player p2pTurnDirection:GWP2PPTZDirectionUp];
}
else if(orientation == ELPCircleConsoleMoveDirectionDown){
[self.player p2pTurnDirection:GWP2PPTZDirectionDown];
}
else if(orientation == ELPCircleConsoleMoveDirectionLeft){
[self.player p2pTurnDirection:GWP2PPTZDirectionLeft];
}
else if(orientation == ELPCircleConsoleMoveDirectionRight){
[self.player p2pTurnDirection:GWP2PPTZDirectionRight];
}
else if(orientation == ELPCircleConsoleMoveDirectionUpStop){
[self.player p2pTurnDirection:GWP2PPTZDirectionUp];
}
else if(orientation == ELPCircleConsoleMoveDirectionDownStop){
[self.player p2pTurnDirection:GWP2PPTZDirectionDown];
}
else if(orientation == ELPCircleConsoleMoveDirectionLeftStop){
[self.player p2pTurnDirection:GWP2PPTZDirectionLeft];
}
else if(orientation == ELPCircleConsoleMoveDirectionRightStop){
[self.player p2pTurnDirection:GWP2PPTZDirectionRight];
}
}
//判断摄像头是否有关系设备
#pragma mark - 判断摄像头是否有关系设备
@@ -3001,6 +3047,8 @@ GWP2PCallErrorNotSupport,
[self didHiddenResolutionInterface];
}
#pragma mark - 自带方向滑动
//上滑动
- (void)swipeUp:(id)sender {
@@ -3481,6 +3529,9 @@ GWP2PCallErrorNotSupport,
self.promptButton.frame = CGRectMake(0.0, 0.0, self.canvasView.frame.size.width, self.canvasView.frame.size.height);
//上面的canvasView重新add了remoteView
[self.canvasView bringSubviewToFront:self.promptButton];
self.directionView.center=self.canvasView.center;
[self.canvasView bringSubviewToFront:self.directionView];
//旋转图片
CGFloat tipHeight = LOADINGPRESSVIEW_WIDTH_HEIGHT;
self.yProgressView.frame = CGRectMake((self.canvasView.frame.size.width-LOADINGPRESSVIEW_WIDTH_HEIGHT)/2, (self.canvasView.frame.size.height-tipHeight)/2, LOADINGPRESSVIEW_WIDTH_HEIGHT, LOADINGPRESSVIEW_WIDTH_HEIGHT);
@@ -3595,8 +3646,8 @@ GWP2PCallErrorNotSupport,
//左边的按住说话弹出的声音图标
//进入横屏时,调整frame
self.pressView.frame = CGRectMake(10, height-PRESS_LAYOUT_WIDTH_AND_HEIGHT-BOTTOM_BAR_HEIGHT, PRESS_LAYOUT_WIDTH_AND_HEIGHT/2, PRESS_LAYOUT_WIDTH_AND_HEIGHT);
self.directionView.center=self.canvasView.center;
[self.canvasView bringSubviewToFront:self.directionView];
//设置横屏底部工具栏5秒隐藏
[self hideBootommViewAfterSecondes];
@@ -4586,6 +4637,10 @@ GWP2PCallErrorNotSupport,
[self.navigationController pushViewController:cameraShopVC animated:YES];
}
else if (indexPath.row ==8)
{
self.directionView.hidden=!self.directionView.isHidden;
}
}
@@ -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"),LXImageWithImageName(@"equipment_iocn_videorecord"),LXImageWithImageName(@"equipment_iocn_videoback")];
_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"),LXImageWithImageName(@"equipment_iocn_joystickicon")];
//_dataNameArray = @[@"截图",@"图库",@"录制",@"回放",@"我的看护",@"爱鱼看看",@"我的看看",@"",@""];
_dataNameArray = @[@"截图",@"图库",@"我的看护",@"爱鱼看看",@"我的看看",@"分享爱鱼奇",@"视频录制",@"视频回放"];
_dataNameArray = @[@"截图",@"图库",@"我的看护",@"爱鱼看看",@"我的看看",@"分享爱鱼奇",@"视频录制",@"视频回放",@"方向控制"];
}
#pragma mark - UICollectionViewDataSource
@@ -84,7 +84,7 @@ static NSString *bootomRecCellIdentifier = @"IfishRecVideoViewCell";
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
//return 9;
return 8;
return 9;
}
#pragma mark 设置item内容