V4.9.9测试版第一次提交 构建版本9.9.1
This commit is contained in:
+1
-35
@@ -12,7 +12,6 @@
|
||||
#import "IfishKankanListModel.h"
|
||||
|
||||
#import "LXAdScrollView.h"
|
||||
#import "WoDeKanKanViewController.h"
|
||||
|
||||
#define TABBAR_H self.tabBarController.tabBar.frame.size.height
|
||||
|
||||
@@ -76,7 +75,6 @@
|
||||
self.navigationItem.rightBarButtonItem = rightItem;
|
||||
[self creatUI];
|
||||
[self creatReatRefreshView];
|
||||
//[self loadBannerData];
|
||||
[self loadNewBannerData];
|
||||
|
||||
}
|
||||
@@ -127,42 +125,11 @@
|
||||
-(void)pushMyKankan{
|
||||
|
||||
self.hidesBottomBarWhenPushed = YES;
|
||||
// WoDeKanKanViewController *wodeKakanVC=[[WoDeKanKanViewController alloc] init];
|
||||
MineKankanEditViewController *editVC = [[MineKankanEditViewController alloc] init];
|
||||
_isPushEdit = YES;
|
||||
[self.navigationController pushViewController:editVC animated:YES];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark -v4.1 前 看看banner
|
||||
-(void)loadBannerData{
|
||||
__weak typeof (self)weskSelf=self;
|
||||
[AFHttpTool getLiveBannerSuccess:^(id response) {
|
||||
|
||||
NSDictionary *reDic=[NSJSONSerialization JSONObjectWithData:response options:NSJSONReadingMutableContainers error:nil];
|
||||
if ([reDic[@"result"] isEqualToString:@"100"]){
|
||||
NSArray*bannerArr=reDic[@"data"];
|
||||
|
||||
for (NSDictionary *bannerDic in bannerArr) {
|
||||
KanKanBanner *banner=[[KanKanBanner alloc] init];
|
||||
banner.appShow = bannerDic[@"appShow"];
|
||||
banner.bannerId = bannerDic[@"bannerId"];
|
||||
banner.bannerImg = bannerDic[@"bannerImg"];
|
||||
banner.bannerLink = bannerDic[@"bannerLink"];
|
||||
banner.bannerType = bannerDic[@"bannerType"];
|
||||
[_bannerImgArr addObject:banner.bannerImg];
|
||||
[_bannerArray addObject:banner];
|
||||
}
|
||||
[weskSelf setingBannerViewData];
|
||||
}
|
||||
|
||||
} failure:^(NSError *err) {
|
||||
|
||||
NSLog(@"loadBannererr%@",err);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark -v4.1 后看看banner
|
||||
-(void)loadNewBannerData{
|
||||
|
||||
@@ -194,7 +161,6 @@
|
||||
_tableView.delegate=self;
|
||||
_tableView.separatorStyle=UITableViewCellSeparatorStyleNone;
|
||||
_tableView.backgroundColor= TABLE_BACKGROUD_COLOR;
|
||||
//_tableView.backgroundColor= [UIColor redColor];
|
||||
UIView *footerView=[[UIView alloc] initWithFrame:CGRectMake(0,0, kScreenSize.width, 0.1)];
|
||||
footerView.backgroundColor = [UIColor clearColor];
|
||||
_tableView.tableFooterView = footerView;
|
||||
@@ -370,7 +336,7 @@
|
||||
|
||||
|
||||
}
|
||||
|
||||
//跳转进入直播详情页面
|
||||
-(void)pushShareP2pView:(IfishKankanListModel *)listModel
|
||||
{
|
||||
KanHuListModel *kanHuCamera =[[KanHuListModel alloc] init];
|
||||
|
||||
+1
-20
@@ -7,7 +7,6 @@
|
||||
//
|
||||
|
||||
#import "IfishP2PLivePlayViewController.h"
|
||||
#import "IfishP2PVideoPlayView.h"
|
||||
|
||||
@interface IfishP2PLivePlayViewController ()<P2PShareViewBootomViewDelegate>
|
||||
|
||||
@@ -53,20 +52,6 @@
|
||||
[self.view bringSubviewToFront:self.subHbottomView];
|
||||
}
|
||||
|
||||
//为用到
|
||||
-(void)setupVideoPlayView{
|
||||
|
||||
IfishP2PVideoPlayView *playView=[IfishP2PVideoPlayView videoPlayView];
|
||||
playView.delegate=self;
|
||||
// 播放器显示位置(竖屏时)
|
||||
playView.frame = CGRectMake(0,64, self.view.bounds.size.width, self.view.bounds.size.width * 9 / 16);
|
||||
|
||||
[self.view addSubview:playView];
|
||||
// 指定一个作为播放的控制器
|
||||
playView.contrainerViewController = self;
|
||||
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
|
||||
[super didReceiveMemoryWarning];
|
||||
@@ -112,7 +97,6 @@
|
||||
//聊天
|
||||
-(void)chatBtnClickAction
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#pragma mark- 暂停 挂断
|
||||
@@ -125,9 +109,7 @@
|
||||
while (self.isPlaying) {
|
||||
usleep(50*1000);
|
||||
}
|
||||
[[P2PClient sharedClient] p2pHungUp];
|
||||
|
||||
self.remoteView.isQuitMonitorInterface = NO;//rtsp监控界面弹出修改
|
||||
[self.player p2pStop];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -151,7 +133,6 @@
|
||||
|
||||
///[self.remoteView getLastImgGoback];
|
||||
[AppDelegate sharedDefault].canFullScreen = NO;
|
||||
[self.remoteView releseromotViewSet];
|
||||
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
|
||||
|
||||
-152
@@ -1,152 +0,0 @@
|
||||
//
|
||||
// IfishP2PVideoPlayView.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/11/11.
|
||||
// Copyright © 2016年 lianxiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "IfishCameraModel.h"
|
||||
#import "ProgressImageView.h"
|
||||
#import "OpenGLView.h"
|
||||
#import "TouchButton.h"
|
||||
#import<GWP2P/GWP2P.h>
|
||||
#import "CustomBorderButton.h"
|
||||
#import "CustomView.h"
|
||||
#define FocalLength_Elongation_btnTag 300
|
||||
#define FocalLength_Shorten_btnTag 301
|
||||
#define FocalLength_Change_sliderTag 302
|
||||
|
||||
//竖屏
|
||||
#define STOPBTN_TAG 1603227
|
||||
#define SOUND_BUTTON_H_TAG 1603221
|
||||
#define SWITCH_SCREEN_BUTTON_H_TAG 1603222
|
||||
#define DEFENCE_BUTTON_H_TAG 1603223
|
||||
#define TALK_BUTTON_H_TAG 1603224
|
||||
#define SCREENSHOT_BUTTON_H_TAG 1603225
|
||||
#define PROMPT_BUTTON_TAG 1603226
|
||||
#define SCREENSHOT_BUTTON_FLIE_TAG 1603228
|
||||
|
||||
#define VT_STOPBTN_TAG 1603229
|
||||
|
||||
#define DOOR_BELLALERT 1001001
|
||||
#define CAMERA_DEVICE_JIEBANG_ALERT 1001002
|
||||
#define XUANDUO_GUANSHUIBENG_ALERT 1001003
|
||||
|
||||
#define WEIJIHUO_ALERT 1001004
|
||||
|
||||
#define ALERT_TAG_UPDATE 1
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
#import "P2PClient.h"
|
||||
//暂未完成 勿yong
|
||||
|
||||
@protocol IfishP2PVideoPlayViewDelegate <NSObject>
|
||||
|
||||
-(void)btnClickToBackAction;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@interface IfishP2PVideoPlayView : UIView<AVCaptureVideoDataOutputSampleBufferDelegate,UIGestureRecognizerDelegate,
|
||||
TouchButtonDelegate,
|
||||
OpenGLViewDelegate,
|
||||
UIScrollViewDelegate,
|
||||
UIAlertViewDelegate,
|
||||
P2PClientDelegate>
|
||||
|
||||
|
||||
{
|
||||
CGFloat _horizontalScreenH;
|
||||
CGFloat _monitorInterfaceW;//rtsp监控界面弹出修改
|
||||
CGFloat _monitorInterfaceH;//rtsp监控界面弹出修改
|
||||
|
||||
UIButton* _btnDefence;
|
||||
|
||||
BOOL _isPlaying;
|
||||
BOOL _isOkFirstRenderVideoFrame;//YES表示第一次成功渲染图像
|
||||
BOOL _isOkRenderVideoFrame;//YES表示图像渲染出来了
|
||||
|
||||
BOOL _isCanAutoOrientation;//限制屏幕什么时候可以旋转
|
||||
|
||||
BOOL _isInItDevice; //是否连接设备
|
||||
BOOL _isStop;//是否暂停 用于区分是 暂停按钮 还是 连接失败按钮
|
||||
|
||||
}
|
||||
|
||||
|
||||
+ (instancetype)videoPlayView;
|
||||
@property (weak, nonatomic) IBOutlet UIView *canvasView;
|
||||
@property (nonatomic,strong) IfishCameraModel *contact;
|
||||
@property (weak, nonatomic) IBOutlet ProgressImageView *yProgressView;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *promptButton;
|
||||
@property (weak, nonatomic) IBOutlet OpenGLView *remoteView;
|
||||
@property (weak, nonatomic) IBOutlet UIView *midToolHView;
|
||||
|
||||
@property(nonatomic,assign) id delegate;
|
||||
|
||||
@property (nonatomic, weak) UIViewController *contrainerViewController;
|
||||
@property (nonatomic) BOOL isReject;
|
||||
@property (nonatomic) BOOL isShowControllerBar;
|
||||
@property (nonatomic) BOOL isShowVToolBar;
|
||||
@property (nonatomic) BOOL isVideoModeHD;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIButton *switchScreenButtonH;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *stopBtnH;
|
||||
|
||||
|
||||
|
||||
@property (nonatomic) BOOL isFullScreen4B3;
|
||||
|
||||
@property (nonatomic,strong) UIScrollView *scrollView;//监控界面缩放
|
||||
@property (nonatomic) BOOL isScale;//监控界面缩放
|
||||
|
||||
@property (strong, nonatomic) UIView *bottomView;//重新调整监控画面
|
||||
@property (strong, nonatomic) UIView *pressView;
|
||||
@property (nonatomic) BOOL isTalking;
|
||||
|
||||
@property (strong, nonatomic) UIView *controllerRight;
|
||||
@property (strong, nonatomic) UIView *controllerRightBg;//重新调整监控画面
|
||||
@property (strong, nonatomic) UIView *bottomBarView;//重新调整监控画面
|
||||
@property (strong, nonatomic) UIView *controllBar;
|
||||
@property (nonatomic) BOOL isAlreadyShowResolution;//重新调整监控画面
|
||||
|
||||
@property (nonatomic) BOOL isDefenceOn;//重新调整监控画面
|
||||
|
||||
//GPIO 口控制参数记录
|
||||
@property(strong, nonatomic) CustomBorderButton *customBorderButton;
|
||||
@property(strong, nonatomic) CustomView *leftView;
|
||||
@property(nonatomic) BOOL isShowLeftView;
|
||||
|
||||
@property(nonatomic) int lastGroup;
|
||||
@property(nonatomic) int lastPin;
|
||||
@property(nonatomic) int lastValue;
|
||||
@property(nonatomic) int *lastTime;
|
||||
|
||||
@property(nonatomic, strong) UIButton *clickGPIO0_0Button;
|
||||
@property(nonatomic, strong) UIButton *clickGPIO0_1Button;
|
||||
@property(nonatomic, strong) UIButton *clickGPIO0_2Button;
|
||||
@property(nonatomic, strong) UIButton *clickGPIO0_3Button;
|
||||
@property(nonatomic, strong) UIButton *clickGPIO0_4Button;
|
||||
@property(nonatomic, strong) UIButton *clickGPIO2_6Button;
|
||||
|
||||
@property(nonatomic, strong) UIButton *lightButton;
|
||||
@property (nonatomic) BOOL isLightSwitchOn;
|
||||
@property (strong, nonatomic) UIActivityIndicatorView *progressView;
|
||||
@property (nonatomic) BOOL isSupportLightSwitch;
|
||||
|
||||
|
||||
//YES表示当前处于监控中,且接收到推送,点击观看监控
|
||||
@property (assign,nonatomic) BOOL isIntoMonitorFromMonitor;
|
||||
|
||||
|
||||
@property (strong, nonatomic) UIView *focalLengthView;
|
||||
@property (nonatomic) BOOL isSupportFocalLength;
|
||||
@property (strong, nonatomic) UIPinchGestureRecognizer *pinchGestureRecognizer;
|
||||
|
||||
//判断当前监控处于横屏还是竖屏界面
|
||||
@property (assign,nonatomic) BOOL isFullScreen;
|
||||
@property (strong, nonatomic) UIView *fullScreenBgView;
|
||||
|
||||
|
||||
@end
|
||||
-934
@@ -1,934 +0,0 @@
|
||||
//
|
||||
// IfishP2PVideoPlayView.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/11/11.
|
||||
// Copyright © 2016年 lianxiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import "IfishP2PVideoPlayView.h"
|
||||
#import "Utils.h"
|
||||
#import "P2PClient.h"
|
||||
#pragma mark - 监控竖屏时,各控件初始化
|
||||
|
||||
#define BOTTOM_BAR_HEIGHT (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 95.0:50.0)
|
||||
|
||||
#define PRESS_LAYOUT_WIDTH_AND_HEIGHT 38
|
||||
|
||||
#define CONTROLLER_BTN_COUNT 5
|
||||
#define PUBLIC_WIDTH_OR_HEIGHT (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 95.0:50.0)
|
||||
#define CONTROLLER_BTN_H_W (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 70.0:40.0) //布防、声音...高度宽度
|
||||
#define RESOLUTION_BTN_H (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 44.0:30.0) //分辨率按钮高度
|
||||
|
||||
#define CONTROLLER_RIGHT_ITEM_WIDTH 70
|
||||
#define CONTROLLER_RIGHT_ITEM_HEIGHT 40
|
||||
#define CONTROLLER_LEFT_ITEM_WIDTH 20
|
||||
|
||||
#define CONTROLLER_BTN_TAG_HUNGUP 0
|
||||
#define CONTROLLER_BTN_TAG_SOUND 1
|
||||
#define CONTROLLER_BTN_TAG_SCREENSHOT 2
|
||||
#define CONTROLLER_BTN_TAG_PRESS_TALK 3
|
||||
#define CONTROLLER_BTN_TAG_DEFENCE_LOCK 4
|
||||
#define CONTROLLER_BTN_TAG_HD 5
|
||||
#define CONTROLLER_BTN_TAG_SD 6
|
||||
#define CONTROLLER_BTN_TAG_LD 7
|
||||
#define CONTROLLER_BTN_TAG_RESOLUTION 8
|
||||
#define CONTROLLER_LABEL_TAG_HD 10
|
||||
#define CONTROLLER_LABEL_TAG_SD 11
|
||||
#define CONTROLLER_LABEL_TAG_LD 12
|
||||
|
||||
#define CONTROLLER_BTN_TAG_GPIO1_0 13 //lock
|
||||
|
||||
#define LEFTVIEW_WIDTH (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 88:88)
|
||||
#define LEFTVIEW_HEIGHT (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 120:120)
|
||||
#define CUSTOM_BORDER_BUTTON_WIDTH 20
|
||||
#define CUSTOM_BORDER_BUTTON_HEIGHT 45
|
||||
#define LEFT_BAR_BTN_WIDTH (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 90:60)
|
||||
#define LEFT_BAR_BTN_MARGIN (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 15:10)
|
||||
|
||||
|
||||
|
||||
#define LOADINGPRESSVIEW_WIDTH_HEIGHT (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? 50:80)
|
||||
|
||||
@implementation IfishP2PVideoPlayView
|
||||
|
||||
|
||||
// 快速创建View的方法
|
||||
+ (instancetype)videoPlayView
|
||||
{
|
||||
return [[[NSBundle mainBundle] loadNibNamed:@"IfishP2PVideoPlayView" owner:nil options:nil] firstObject];
|
||||
}
|
||||
|
||||
|
||||
-(void)awakeFromNib{
|
||||
|
||||
[super awakeFromNib];
|
||||
|
||||
[self connectDevice];
|
||||
self.isShowControllerBar = YES;
|
||||
self.isVideoModeHD = NO;
|
||||
_isReject=YES;
|
||||
_isStop = NO;
|
||||
_isOkFirstRenderVideoFrame = YES;
|
||||
|
||||
//监控竖屏时,各控件初始化(先)
|
||||
[self initComponentForPortrait];
|
||||
//监控横屏时,各控件初始化(后)
|
||||
[self initComponentForHorizontalScreen];
|
||||
[self cameraConnectSeting];
|
||||
|
||||
}
|
||||
|
||||
-(void)cameraConnectSeting{
|
||||
//rtsp监控界面弹出修改
|
||||
[self monitorP2PCall];
|
||||
//设置代理
|
||||
[[P2PClient sharedClient] setDelegate:self];
|
||||
[self hiddenMonitoringUI:NO callErrorInfo:nil isReCall:YES];
|
||||
|
||||
}
|
||||
|
||||
//rtsp监控界面弹出修改
|
||||
|
||||
-(void)monitorP2PCall{
|
||||
|
||||
NSString *newPassword = GIWEI_INITPASS;
|
||||
NSString *cameraPass = [Utils GetTreatedPassword:newPassword];
|
||||
NSString *cameraId = @"3573889";
|
||||
|
||||
[[P2PClient sharedClient] p2pCallWithId:cameraId password:cameraPass callType:P2PCALL_TYPE_MONITOR];
|
||||
|
||||
// [[P2PClient sharedClient] p2pCallWithId:self.contact.cameraId password:self.contact.cameraPass callType:P2PCALL_TYPE_MONITOR];
|
||||
|
||||
[[P2PClient sharedClient] setP2pCallState:P2PCALL_STATUS_CALLING];
|
||||
BOOL isBCalled = [[P2PClient sharedClient] isBCalled];
|
||||
P2PCallType type = [[P2PClient sharedClient] p2pCallType];
|
||||
NSString *callId = [[P2PClient sharedClient] callId];
|
||||
|
||||
if(!isBCalled){
|
||||
BOOL isApMode = ([[AppDelegate sharedDefault]dwApContactID] != 0);
|
||||
if (!isApMode)
|
||||
{
|
||||
//[[P2PClient sharedClient] p2pCallWithId:callId password:self.contact.cameraPass callType:type];
|
||||
[[P2PClient sharedClient] p2pCallWithId:callId password:cameraPass callType:type];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//[[P2PClient sharedClient] p2pCallWithId:@"1" password:self.contact.cameraPass callType:type];
|
||||
[[P2PClient sharedClient] p2pCallWithId:@"1" password:cameraPass callType:type];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-(void)initComponentForPortrait{
|
||||
|
||||
//视频监控连接中的背景图片
|
||||
NSString *filePath = [Utils getHeaderFilePathWithId:self.contact.cameraId];
|
||||
UIImage *headImg = [UIImage imageWithContentsOfFile:filePath];
|
||||
if(headImg==nil){
|
||||
headImg = LXImageWithImageName(@"ic_header.png");
|
||||
}
|
||||
self.canvasView.layer.contents = (id)headImg.CGImage;
|
||||
|
||||
_yProgressView.backgroundView.image = LXImageWithImageName(@"monitor_press.png");
|
||||
[_yProgressView start];
|
||||
|
||||
self.remoteView.delegate= self;
|
||||
[self.remoteView.layer setMasksToBounds:YES];
|
||||
//_remoteView 添加点击手势现实和隐藏 midToolHView
|
||||
UITapGestureRecognizer *appermidToolView=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onSingleTap)];
|
||||
[appermidToolView setCancelsTouchesInView:YES];
|
||||
[appermidToolView setDelaysTouchesEnded:YES];
|
||||
[self.canvasView addGestureRecognizer:appermidToolView];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - 监控横屏时,各控件初始化
|
||||
-(void)initComponentForHorizontalScreen{
|
||||
|
||||
CGRect rect = [AppDelegate getScreenSize:NO isHorizontal:YES];
|
||||
CGFloat width = rect.size.width;
|
||||
_monitorInterfaceW = width;
|
||||
|
||||
CGFloat height = rect.size.height;
|
||||
if(CURRENT_VERSION<7.0){
|
||||
height +=20;
|
||||
}
|
||||
_monitorInterfaceH = height;
|
||||
_horizontalScreenH = height;
|
||||
|
||||
//
|
||||
|
||||
//横屏背景
|
||||
UIView *fullScreenBgView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, width, height)];
|
||||
fullScreenBgView.backgroundColor = XBlack;
|
||||
self.fullScreenBgView = fullScreenBgView;
|
||||
|
||||
|
||||
|
||||
|
||||
//进入横屏时,响应onDoubleTap
|
||||
//退出横屏时,响应onDoubleTap 暂停
|
||||
UITapGestureRecognizer *doubleTapG = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onDoubleTap)];
|
||||
doubleTapG.delegate = self;
|
||||
[doubleTapG setNumberOfTapsRequired:2];
|
||||
[self.remoteView addGestureRecognizer:doubleTapG];
|
||||
|
||||
|
||||
|
||||
//进入横屏时,响应onSingleTap
|
||||
//退出横屏时,响应onSingleTap
|
||||
UITapGestureRecognizer *singleTapG = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onSingleTap)];
|
||||
singleTapG.delegate = self;
|
||||
[singleTapG setNumberOfTapsRequired:1];
|
||||
[singleTapG requireGestureRecognizerToFail:doubleTapG];
|
||||
[self.remoteView addGestureRecognizer:singleTapG];
|
||||
|
||||
|
||||
|
||||
//进入横屏时,响应localLengthPinchToZoom
|
||||
//退出横屏时,不响应localLengthPinchToZoom
|
||||
NSString * plist = [[NSBundle mainBundle] pathForResource:@"Common-Configuration" ofType:@"plist"];
|
||||
NSDictionary * dic = [NSDictionary dictionaryWithContentsOfFile:plist];
|
||||
BOOL isSupportZoom = [dic[@"isSupportZoom"] boolValue];
|
||||
UIPinchGestureRecognizer *pinchGestureRecognizer = [[UIPinchGestureRecognizer alloc] init];
|
||||
if (!isSupportZoom) {//电子放大与焦距变倍不共存
|
||||
[_remoteView addGestureRecognizer:pinchGestureRecognizer];
|
||||
}
|
||||
self.pinchGestureRecognizer = pinchGestureRecognizer;
|
||||
|
||||
|
||||
|
||||
|
||||
//右边的画质图标
|
||||
//进入横屏时,显示
|
||||
//退出横屏时,隐藏
|
||||
int rightItemCount = 3;
|
||||
//半透明背景
|
||||
UIView *controllerRightBg = [[UIView alloc] initWithFrame:CGRectMake(5.0, height, CONTROLLER_RIGHT_ITEM_WIDTH, CONTROLLER_RIGHT_ITEM_HEIGHT*rightItemCount)];
|
||||
controllerRightBg.layer.cornerRadius = 1.0f;
|
||||
[controllerRightBg setAlpha:0.5];
|
||||
[controllerRightBg setBackgroundColor:XBlack];
|
||||
self.controllerRightBg = controllerRightBg;
|
||||
[self addSubview:controllerRightBg];
|
||||
[self.controllerRightBg setHidden:YES];
|
||||
|
||||
|
||||
UIView *controllerRight = [[UIView alloc] initWithFrame:CGRectMake(5.0, height, CONTROLLER_RIGHT_ITEM_WIDTH, CONTROLLER_RIGHT_ITEM_HEIGHT*rightItemCount)];
|
||||
self.controllerRight = controllerRight;
|
||||
[self addSubview:controllerRight];
|
||||
[self.controllerRight setHidden:YES];
|
||||
//分隔线
|
||||
for (int i=1; i < rightItemCount; i++) {
|
||||
UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(0.0, i*CONTROLLER_RIGHT_ITEM_HEIGHT+1.0*(i-1), CONTROLLER_RIGHT_ITEM_WIDTH, 1.0)];
|
||||
lineView.backgroundColor = XWhite;
|
||||
[controllerRight addSubview:lineView];
|
||||
|
||||
}
|
||||
|
||||
for(int i=0;i<rightItemCount;i++){
|
||||
TouchButton *button = [self getBottomBarButton];
|
||||
button.frame = CGRectMake(0, (CONTROLLER_RIGHT_ITEM_HEIGHT+1.0)*i, CONTROLLER_RIGHT_ITEM_WIDTH, CONTROLLER_RIGHT_ITEM_HEIGHT);
|
||||
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, button.frame.size.width, button.frame.size.height)];
|
||||
label.backgroundColor = [UIColor clearColor];
|
||||
label.textAlignment = NSTextAlignmentCenter;
|
||||
label.textColor = XWhite;
|
||||
label.font = [UIFont boldSystemFontOfSize:16.0];
|
||||
|
||||
if(rightItemCount==2){//NPC
|
||||
//无高清
|
||||
if(i==0){
|
||||
//label.text = NSLocalizedString(@"SD", nil);
|
||||
label.text = NSLocalizedString(@"标清", nil);
|
||||
label.tag = CONTROLLER_LABEL_TAG_SD;
|
||||
button.tag = CONTROLLER_BTN_TAG_SD;
|
||||
}else if(i==1){
|
||||
//label.text = NSLocalizedString(@"LD", nil);
|
||||
label.text = NSLocalizedString(@"流畅", nil);
|
||||
label.tag = CONTROLLER_LABEL_TAG_LD;
|
||||
label.textColor = XBlue;
|
||||
button.tag = CONTROLLER_BTN_TAG_LD;
|
||||
}
|
||||
}else if(rightItemCount==3){//IPC
|
||||
//有高清
|
||||
if(i==0){
|
||||
//label.text = NSLocalizedString(@"HD", nil);
|
||||
label.text = NSLocalizedString(@"高清", nil);
|
||||
label.tag = CONTROLLER_LABEL_TAG_HD;
|
||||
button.tag = CONTROLLER_BTN_TAG_HD;
|
||||
}else if(i==1){
|
||||
label.text = NSLocalizedString(@"标清", nil);
|
||||
//label.text = NSLocalizedString(@"SD", nil);
|
||||
label.tag = CONTROLLER_LABEL_TAG_SD;
|
||||
label.textColor = XBlue;
|
||||
button.tag = CONTROLLER_BTN_TAG_SD;
|
||||
}else if(i==2){
|
||||
label.text = NSLocalizedString(@"流畅", nil);
|
||||
//label.text = NSLocalizedString(@"LD", nil);
|
||||
label.tag = CONTROLLER_LABEL_TAG_LD;
|
||||
button.tag = CONTROLLER_BTN_TAG_LD;
|
||||
//
|
||||
|
||||
}
|
||||
}
|
||||
[button addSubview:label];
|
||||
|
||||
[button addTarget:self action:@selector(onControllerBtnPress:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
[controllerRight addSubview:button];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//进入横屏时,显示
|
||||
//退出横屏时,隐藏
|
||||
//底部半透明块
|
||||
UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0.0, height-BOTTOM_BAR_HEIGHT, width, BOTTOM_BAR_HEIGHT)];
|
||||
[bottomView setAlpha:0.5];
|
||||
[bottomView setBackgroundColor:XBlack];
|
||||
self.bottomView = bottomView;
|
||||
[self addSubview:bottomView];
|
||||
[self.bottomView setHidden:YES];
|
||||
|
||||
|
||||
UIView *bottomBarView = [[UIView alloc] initWithFrame:CGRectMake(0.0, height-BOTTOM_BAR_HEIGHT, width, BOTTOM_BAR_HEIGHT)];
|
||||
self.bottomBarView = bottomBarView;
|
||||
[self addSubview:bottomBarView];
|
||||
[self.bottomBarView setHidden:YES];
|
||||
//左边的画质图标
|
||||
//由于要隐藏掉此处改为暂停按钮
|
||||
TouchButton *resolutionButton = [self getBottomBarButton];
|
||||
[resolutionButton setFrame:CGRectMake(5.0, (BOTTOM_BAR_HEIGHT-RESOLUTION_BTN_H)/2.0, CONTROLLER_RIGHT_ITEM_WIDTH, RESOLUTION_BTN_H)];
|
||||
resolutionButton.tag = CONTROLLER_BTN_TAG_RESOLUTION;
|
||||
if (rightItemCount == 2) {
|
||||
[resolutionButton setTitle:NSLocalizedString(@"LD", nil) forState:UIControlStateNormal];
|
||||
}else{
|
||||
[resolutionButton setTitle:NSLocalizedString(@"SD", nil) forState:UIControlStateNormal];
|
||||
}
|
||||
|
||||
[resolutionButton setBackgroundImage:LXImageWithImageName(@"ic_ctl_resolution.png") forState:UIControlStateNormal];
|
||||
[resolutionButton addTarget:self action:@selector(selectResolutionClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
//暂时隐藏只选择高清 现在又放出来了
|
||||
[bottomBarView addSubview:resolutionButton];
|
||||
|
||||
|
||||
|
||||
|
||||
//全屏暂停回来 openGlView 出现问题scale改变?
|
||||
|
||||
// _HorizontalStopBtn=[UIButton buttonWithType:UIButtonTypeCustom];
|
||||
//
|
||||
// _HorizontalStopBtn.frame = CGRectMake(5.0, (BOTTOM_BAR_HEIGHT-RESOLUTION_BTN_H)/2.0, CONTROLLER_LEFT_ITEM_WIDTH, RESOLUTION_BTN_H);
|
||||
// _HorizontalStopBtn.tag =VT_STOPBTN_TAG;
|
||||
// [_HorizontalStopBtn setBackgroundImage:LXImageWithImageName(@"monitor_stop_h.png") forState:UIControlStateNormal];
|
||||
// [_HorizontalStopBtn addTarget:self action:@selector(HorizontalStopBtnPress:) forControlEvents:UIControlEventTouchUpInside];
|
||||
// [bottomBarView addSubview:_HorizontalStopBtn];
|
||||
//
|
||||
|
||||
//右边的切换屏幕图标
|
||||
TouchButton *switchScreenButton = [self getBottomBarButton];
|
||||
[switchScreenButton setFrame:CGRectMake(width-CONTROLLER_BTN_H_W-5.0, (BOTTOM_BAR_HEIGHT-CONTROLLER_BTN_H_W)/2.0, CONTROLLER_BTN_H_W, CONTROLLER_BTN_H_W)];
|
||||
switchScreenButton.tag = SWITCH_SCREEN_BUTTON_H_TAG;
|
||||
[switchScreenButton setBackgroundImage:LXImageWithImageName(@"monitor_half_screen.png") forState:UIControlStateNormal];
|
||||
[switchScreenButton addTarget:self action:@selector(onVerticalBtnPress:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[bottomBarView addSubview:switchScreenButton];
|
||||
|
||||
//右边的挂断图标
|
||||
TouchButton *hungUpButton = [self getBottomBarButton];
|
||||
[hungUpButton setFrame:CGRectMake(switchScreenButton.frame.origin.x-CONTROLLER_BTN_H_W-5.0, (BOTTOM_BAR_HEIGHT-CONTROLLER_BTN_H_W)/2.0, CONTROLLER_BTN_H_W, CONTROLLER_BTN_H_W)];
|
||||
hungUpButton.tag = CONTROLLER_BTN_TAG_HUNGUP;
|
||||
[hungUpButton setBackgroundImage:LXImageWithImageName(@"ic_ctl_new_hungup.png") forState:UIControlStateNormal];
|
||||
[hungUpButton addTarget:self action:@selector(onControllerBtnPress:) forControlEvents:UIControlEventTouchUpInside];
|
||||
// [bottomBarView addSubview:hungUpButton];
|
||||
|
||||
//布防撤防、声音开关、截图开关、按住说话开关、开门按钮
|
||||
UIView *controllBar = [[UIView alloc] initWithFrame:CGRectMake(CONTROLLER_RIGHT_ITEM_WIDTH+5.0, 0.0, width-CONTROLLER_RIGHT_ITEM_WIDTH-5.0-PUBLIC_WIDTH_OR_HEIGHT*2-5.0*2, PUBLIC_WIDTH_OR_HEIGHT)];
|
||||
controllBar.backgroundColor = [UIColor clearColor];
|
||||
self.controllBar = controllBar;
|
||||
|
||||
int btnCount = CONTROLLER_BTN_COUNT;
|
||||
|
||||
CGFloat firstControllerBtnX = (controllBar.frame.size.width-PUBLIC_WIDTH_OR_HEIGHT*btnCount)/2.0;
|
||||
for(int i=0;i<btnCount;i++){
|
||||
TouchButton *controllerBtn = [self getBottomBarButton];
|
||||
controllerBtn.frame = CGRectMake(PUBLIC_WIDTH_OR_HEIGHT*i+firstControllerBtnX, (BOTTOM_BAR_HEIGHT-CONTROLLER_BTN_H_W)/2.0, CONTROLLER_BTN_H_W,CONTROLLER_BTN_H_W);
|
||||
|
||||
if(i==0){//布防撤防
|
||||
_btnDefence = controllerBtn;
|
||||
_btnDefence.hidden = YES;
|
||||
//LXImageWithImageName(@"long_press_lock.png")
|
||||
controllerBtn.tag = CONTROLLER_BTN_TAG_DEFENCE_LOCK;
|
||||
// if ([AppDelegate sharedDefault].mainController.contact.defenceState == DEFENCE_STATE_ON || [AppDelegate sharedDefault].contact.defenceState == DEFENCE_STATE_ON) {
|
||||
// [controllerBtn setBackgroundImage:LXImageWithImageName(@"ic_ctl_lock_on.png") forState:UIControlStateNormal];
|
||||
// self.isDefenceOn = YES;
|
||||
// }else if([AppDelegate sharedDefault].mainController.contact.defenceState == DEFENCE_STATE_OFF || [AppDelegate sharedDefault].contact.defenceState == DEFENCE_STATE_OFF){
|
||||
// [controllerBtn setBackgroundImage:LXImageWithImageName(@"ic_ctl_lock_off.png") forState:UIControlStateNormal];
|
||||
// self.isDefenceOn = NO;
|
||||
// }
|
||||
}else if(i==1){//声音开关
|
||||
controllerBtn.tag = CONTROLLER_BTN_TAG_SOUND;
|
||||
[controllerBtn setBackgroundImage:LXImageWithImageName(@"ic_ctl_new_sound_on.png") forState:UIControlStateNormal];
|
||||
controllerBtn.hidden = YES;
|
||||
}else if(i==2){//按住说话开关
|
||||
controllerBtn.tag = CONTROLLER_BTN_TAG_PRESS_TALK;
|
||||
[controllerBtn setBackgroundImage:LXImageWithImageName(@"ic_ctl_new_send_audio.png") forState:UIControlStateNormal];
|
||||
[controllerBtn setBackgroundImage:LXImageWithImageName(@"ic_ctl_new_send_audio_p.png") forState:UIControlStateHighlighted];
|
||||
controllerBtn.hidden = YES;
|
||||
}else if(i==3){//截图开关
|
||||
controllerBtn.tag = CONTROLLER_BTN_TAG_SCREENSHOT;
|
||||
[controllerBtn setBackgroundImage:LXImageWithImageName(@"ic_ctl_new_screenshot.png") forState:UIControlStateNormal];
|
||||
controllerBtn.hidden = YES;
|
||||
}else if(i==4){//输出6秒高电平脉冲按钮
|
||||
controllerBtn.tag = CONTROLLER_BTN_TAG_GPIO1_0;
|
||||
[controllerBtn setBackgroundImage:LXImageWithImageName(@"long_press_lock.png") forState:UIControlStateNormal];
|
||||
controllerBtn.hidden = YES;
|
||||
|
||||
}
|
||||
|
||||
if(i==2){
|
||||
//对讲按钮
|
||||
|
||||
}else{
|
||||
[controllerBtn addTarget:self action:@selector(onControllerBtnPress:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
|
||||
[controllBar addSubview:controllerBtn];
|
||||
}
|
||||
|
||||
[bottomBarView addSubview:controllBar];
|
||||
|
||||
|
||||
//button arrow
|
||||
//进入横屏时,显示
|
||||
//退出横屏时,隐藏
|
||||
CGFloat customBorderButtonY = (height - CUSTOM_BORDER_BUTTON_HEIGHT)/2.0;
|
||||
|
||||
CustomBorderButton *customBorderButton=[CustomBorderButton buttonWithType:UIButtonTypeCustom];
|
||||
customBorderButton.frame = CGRectMake(0, customBorderButtonY, CUSTOM_BORDER_BUTTON_WIDTH, CUSTOM_BORDER_BUTTON_HEIGHT);
|
||||
|
||||
[customBorderButton setNeedLineTop:true left:true bottom:true right:true];
|
||||
[customBorderButton setLineColorTop:[UIColor blackColor] left:[UIColor clearColor] bottom:[UIColor blackColor] right:[UIColor blackColor]];//用同一色边线
|
||||
[customBorderButton setLineWidthTop:2.0 left:2.0 bottom:2.0 right:2.0];//设置线的粗细,这里可以随意调整
|
||||
|
||||
[customBorderButton setRadiusTopLeft:0 topRight:8.0 bottomLeft:0 bottomRight:8.0];//边线加弧度
|
||||
[customBorderButton setClipsToBoundsWithBorder:true];//裁剪掉边线外面的区域
|
||||
|
||||
[customBorderButton setFillColor:[UIColor darkGrayColor]];//增加内部填充颜色
|
||||
[customBorderButton setAlpha:0.5];
|
||||
[customBorderButton setOpaque:YES];
|
||||
|
||||
|
||||
[customBorderButton setImage:[UIImage imageNamed:@"button_right"] forState:UIControlStateNormal];
|
||||
[customBorderButton setImage:[UIImage imageNamed:@"button_right_selected"] forState:UIControlStateHighlighted];
|
||||
[customBorderButton addTarget:self action:@selector(showLeftView:) forControlEvents:UIControlEventTouchUpInside];
|
||||
self.customBorderButton = customBorderButton;
|
||||
|
||||
//左侧界面
|
||||
//进入横屏时,显示
|
||||
//退出横屏时,隐藏
|
||||
CGFloat leftViewY = (height - LEFTVIEW_HEIGHT)/2.0;
|
||||
CustomView *leftView = [[CustomView alloc] initWithFrame:CGRectMake(-LEFTVIEW_WIDTH, leftViewY, LEFTVIEW_WIDTH, LEFTVIEW_HEIGHT)];
|
||||
[leftView setNeedLineTop:true left:true bottom:true right:true];
|
||||
|
||||
[leftView setLineColorTop:[UIColor blackColor] left:[UIColor blackColor] bottom:[UIColor blackColor] right:[UIColor blackColor]];//用同一色边线
|
||||
[leftView setLineWidthTop:2.0 left:2.0 bottom:2.0 right:2.0];//设置线的粗细,这里可以随意调整
|
||||
[leftView setRadiusTopLeft:8.0 topRight:8.0 bottomLeft:8.0 bottomRight:8.0];//边线加弧度
|
||||
[leftView setClipsToBoundsWithBorder:true];//裁剪掉边线外面的区域
|
||||
|
||||
[leftView setFillColor:[UIColor darkGrayColor]];//增加内部填充颜色
|
||||
[leftView setAlpha:0.5];
|
||||
[leftView setOpaque:YES];
|
||||
self.leftView = leftView;
|
||||
//[self.leftView setHidden:YES];
|
||||
|
||||
|
||||
CGFloat xSpace = 4.0;
|
||||
CGFloat ySpace = 4.0;
|
||||
CGFloat numLabelW = 12.0;
|
||||
CGFloat buttonW = (leftView.frame.size.width - numLabelW - xSpace*4)/2.0;
|
||||
CGFloat buttonH = (leftView.frame.size.height - ySpace*4)/3.0;
|
||||
int tag = 10;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
|
||||
UIButton *onButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
onButton.frame = CGRectMake(xSpace, (buttonH+ySpace)*i+ySpace, buttonW, buttonH);
|
||||
onButton.tag = tag++;
|
||||
[onButton setTitle:@"ON" forState:UIControlStateNormal];
|
||||
[onButton setTitleColor:XWhite forState:UIControlStateNormal];
|
||||
|
||||
onButton.titleLabel.font = XFontBold_12;
|
||||
[onButton addTarget:self action:@selector(onOrOffButtonClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self.leftView addSubview:onButton];
|
||||
|
||||
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(2*xSpace+buttonW, (buttonH+ySpace)*i+ySpace, numLabelW, buttonH)];
|
||||
label.backgroundColor = [UIColor clearColor];
|
||||
label.textColor = XWhite;
|
||||
label.text = [NSString stringWithFormat:@"%d",i + 1];
|
||||
label.font = XFontBold_12;
|
||||
label.textAlignment = NSTextAlignmentCenter;
|
||||
[self.leftView addSubview:label];
|
||||
|
||||
|
||||
UIButton *offButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
offButton.frame = CGRectMake(3*xSpace+buttonW +numLabelW, (buttonH+ySpace)*i+ySpace, buttonW, buttonH);
|
||||
offButton.tag = tag++;
|
||||
[offButton setTitle:@"OFF" forState:UIControlStateNormal];
|
||||
[offButton setTitleColor:XWhite forState:UIControlStateNormal];
|
||||
|
||||
offButton.titleLabel.font = XFontBold_12;
|
||||
[offButton addTarget:self action:@selector(onOrOffButtonClick:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
[self.leftView addSubview:offButton];
|
||||
|
||||
}
|
||||
|
||||
|
||||
//右侧,灯控制按钮
|
||||
//进入横屏时,显示,并调整frame
|
||||
//退出横屏时,隐藏
|
||||
//提示器
|
||||
UIActivityIndicatorView *progressView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
|
||||
progressView.frame = CGRectMake(self.remoteView.frame.size.width-30.0-20.0, (self.remoteView.frame.size.height-30.0)/2, 30.0, 30.0);
|
||||
[self.remoteView addSubview:progressView];
|
||||
self.progressView = progressView;
|
||||
[self.progressView setHidden:YES];
|
||||
|
||||
//若设备支持灯设备时,则显示开关;若不支持,则隐藏
|
||||
UIButton *lightButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
lightButton.frame = CGRectMake(self.remoteView.frame.size.width-30.0-20.0, (self.remoteView.frame.size.height-30.0)/2, 30.0, 30.0);
|
||||
lightButton.backgroundColor = [UIColor clearColor];
|
||||
[lightButton setBackgroundImage:[UIImage imageNamed:@"lighton.png"] forState:UIControlStateNormal];
|
||||
[lightButton addTarget:self action:@selector(btnClickToSetLightState:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self.remoteView addSubview:lightButton];
|
||||
[lightButton setHidden:YES];
|
||||
self.lightButton = lightButton;
|
||||
|
||||
|
||||
//进入横屏时,显示
|
||||
//退出横屏时,隐藏
|
||||
//焦距控件
|
||||
//宽、高
|
||||
CGFloat focalLengthView_w = 40.0;
|
||||
CGFloat focalLengthView_h = 180.0;
|
||||
//焦距控件与屏幕右边框的间距
|
||||
CGFloat space_FocalLView_Screen = (width - self.remoteView.frame.size.width)/2+20+focalLengthView_w;
|
||||
UIView *focalLengthView = [[UIView alloc] initWithFrame:CGRectMake(width-space_FocalLView_Screen, height-self.bottomBarView.frame.size.height-20.0-focalLengthView_h, focalLengthView_w, focalLengthView_h)];
|
||||
if (!isSupportZoom) {//电子放大与焦距变焦不共存
|
||||
[self addSubview:focalLengthView];
|
||||
}
|
||||
[focalLengthView setHidden:YES];
|
||||
self.focalLengthView = focalLengthView;
|
||||
|
||||
//焦距伸长按钮
|
||||
//宽、高
|
||||
CGFloat elongationButton_w = 34.0;
|
||||
CGFloat elongationButton_h = elongationButton_w*(46/43);
|
||||
UIButton *elongationButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
elongationButton.frame = CGRectMake((focalLengthView_w-elongationButton_w)/2, 0.0, elongationButton_w, elongationButton_h);
|
||||
[elongationButton setBackgroundImage:[UIImage imageNamed:@"monitor_localLenght_zoom_normal.png"] forState:UIControlStateNormal];
|
||||
[elongationButton setBackgroundImage:[UIImage imageNamed:@"monitor_localLenght_zoom_highlighted.png"] forState:UIControlStateHighlighted];
|
||||
elongationButton.tag = FocalLength_Elongation_btnTag;
|
||||
[elongationButton addTarget:self action:@selector(btnClickToChangeFocalLength:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self.focalLengthView addSubview:elongationButton];
|
||||
//拖动条
|
||||
UISlider *focalLengthSlider = [[UISlider alloc] initWithFrame:CGRectMake(0.0, 0.0, focalLengthView_h-elongationButton_h*2, 30.0)];
|
||||
focalLengthSlider.center = CGPointMake(self.focalLengthView.center.x-self.focalLengthView.frame.origin.x, self.focalLengthView.center.y-self.focalLengthView.frame.origin.y);
|
||||
//设置旋转90度
|
||||
focalLengthSlider.transform = CGAffineTransformMakeRotation(90*M_PI/180);
|
||||
focalLengthSlider.minimumValue = 1.0;
|
||||
focalLengthSlider.maximumValue = 15.0;
|
||||
focalLengthSlider.value = 7.5;
|
||||
focalLengthSlider.continuous = NO;//在手指离开的时候触发一次valueChange事件,而不是在拖动的过程中不断触发valueChange事件
|
||||
focalLengthSlider.tag = FocalLength_Change_sliderTag;
|
||||
[focalLengthSlider addTarget:self action:@selector(btnClickToChangeFocalLength:) forControlEvents:UIControlEventValueChanged];
|
||||
[self.focalLengthView addSubview:focalLengthSlider];
|
||||
//焦距变短按钮
|
||||
//宽、高
|
||||
CGFloat shortenButton_w = elongationButton_w;
|
||||
CGFloat shortenButton_h = elongationButton_h;
|
||||
UIButton *shortenButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
shortenButton.frame = CGRectMake((focalLengthView_w-shortenButton_w)/2, focalLengthView_h-shortenButton_h, shortenButton_w, shortenButton_h);
|
||||
[shortenButton setBackgroundImage:[UIImage imageNamed:@"monitor_localLenght_narrow_normal.png"] forState:UIControlStateNormal];
|
||||
[shortenButton setBackgroundImage:[UIImage imageNamed:@"monitor_localLenght_narrow_highlighted.png"] forState:UIControlStateHighlighted];
|
||||
shortenButton.tag = FocalLength_Shorten_btnTag;
|
||||
[shortenButton addTarget:self action:@selector(btnClickToChangeFocalLength:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self.focalLengthView addSubview:shortenButton];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (TouchButton *)getBottomBarButton//重新调整监控画面
|
||||
{
|
||||
TouchButton *button = [TouchButton buttonWithType:UIButtonTypeCustom];
|
||||
[button setFrame:CGRectMake(0.0, 0.0, 50.0, 50.0)];
|
||||
return button;
|
||||
}
|
||||
|
||||
#pragma mark - 初始化设备 p2pConnect
|
||||
|
||||
-(void)connectDevice{
|
||||
|
||||
//LoginResult *loginResult = [UDManager getLoginInfo];
|
||||
//8225账号
|
||||
// NSString * P2PVerifyCode1 = @"1528438234";
|
||||
// NSString * P2PVerifyCode2 = @"992805759";
|
||||
// NSString *UserID = @"-2144354932";
|
||||
|
||||
UserModel *model=[[DataCenter defaultDtacenter] valueForKey:@"UserLogIn"];
|
||||
NSString *userIDName=[NSString stringWithFormat:@"%d",(int)[model.gwellUserID integerValue]&0x7fffffff];
|
||||
|
||||
|
||||
//初始化设备
|
||||
if (!_isInItDevice) {
|
||||
NSLog(@"正在初始化设备");
|
||||
_isInItDevice = [[P2PClient sharedClient] p2pConnectWithId:userIDName codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2];
|
||||
|
||||
// _isInItDevice = [[P2PClient sharedClient] p2pConnectWithId:model.gwellUserID codeStr1:model.P2PVerifyCode1 codeStr2:model.P2PVerifyCode2];
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(_isInItDevice){
|
||||
|
||||
NSLog(@"p2pConnect success. 成功 可以操作设备了");
|
||||
//成功 可以操作设备了
|
||||
usleep(600000);
|
||||
[self startMonitor];
|
||||
|
||||
}else{//new added
|
||||
NSLog(@"p2pConnect failure.失败,不能操作设备");
|
||||
//[self connectDevice];
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-(void)startMonitor{
|
||||
|
||||
if (_isReject&&_isInItDevice) {
|
||||
NSLog(@"发送呼叫命令");
|
||||
|
||||
[[P2PClient sharedClient] setIsBCalled:NO];
|
||||
[[P2PClient sharedClient] setP2pCallState:P2PCALL_STATUS_CALLING];
|
||||
|
||||
|
||||
//Contact *contact = self.deviceArr[0];
|
||||
NSString *newPassword = GIWEI_INITPASS;
|
||||
NSString *cameraPass = [Utils GetTreatedPassword:newPassword];
|
||||
NSString *cameraId = @"3573889";
|
||||
|
||||
[[P2PClient sharedClient] p2pCallWithId:cameraId password:cameraPass callType:P2PCALL_TYPE_MONITOR];
|
||||
//[[P2PClient sharedClient] p2pCallWithId:self.contact.cameraId password:self.contact.cameraPass callType:P2PCALL_TYPE_MONITOR];
|
||||
|
||||
//NSLog(@"contact.contactPassword%@",self.contact.cameraPass);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - 协议的实现
|
||||
- (void)P2PClientCalling:(nullable NSDictionary*)info{
|
||||
|
||||
NSLog(@"正在呼叫");
|
||||
}
|
||||
- (void)P2PClientReject:(nullable NSDictionary*)info{
|
||||
|
||||
_isReject=YES;
|
||||
_isOkRenderVideoFrame = NO;
|
||||
NSLog(@"视频挂断");
|
||||
|
||||
//[self addLogs:@"视频挂断"];
|
||||
|
||||
while (_isPlaying) {
|
||||
usleep(50*1000);
|
||||
}
|
||||
|
||||
|
||||
if (self.isIntoMonitorFromMonitor) {
|
||||
self.isIntoMonitorFromMonitor = NO;
|
||||
[self hiddenMonitoringUI:NO callErrorInfo:nil isReCall:YES];
|
||||
// [self monitorP2PCall];
|
||||
}else{
|
||||
[self hiddenMonitoringUI:NO callErrorInfo:info isReCall:NO];
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
- (void)P2PClientAccept:(nullable NSDictionary*)info{
|
||||
|
||||
NSLog(@"接收数据");
|
||||
}
|
||||
- (void)P2PClientReady:(nullable NSDictionary*)info{
|
||||
|
||||
NSLog(@"准备就绪");
|
||||
[[P2PClient sharedClient] setP2pCallState:P2PCALL_STATUS_READY_P2P];
|
||||
|
||||
if([[P2PClient sharedClient] p2pCallType]==P2PCALL_TYPE_MONITOR){
|
||||
//连接就绪之后就开始启动渲染
|
||||
[self monitorStartRender];
|
||||
}
|
||||
}
|
||||
#pragma mark - 准备渲染监控界面
|
||||
-(void)monitorStartRender{
|
||||
//[self addLogs:@"渲染>>>你可以看到画面了"];
|
||||
_isReject = NO;
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
[self renderView];
|
||||
});
|
||||
//[[PAIOUnit sharedUnit] setMuteAudio:YES];
|
||||
// [[PAIOUnit sharedUnit] setSpeckState:YES];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - 开始渲染监控画面
|
||||
|
||||
|
||||
- (void)renderView
|
||||
{
|
||||
_isPlaying = YES;
|
||||
|
||||
/* GAVFrame * m_pAVFrame ;
|
||||
|
||||
while (!self.isReject)
|
||||
{
|
||||
|
||||
NSLog(@" while 渲染监控画面");
|
||||
if(fgGetVideoFrameToDisplay(&m_pAVFrame))
|
||||
{
|
||||
|
||||
if (!_isOkRenderVideoFrame) {
|
||||
_isOkRenderVideoFrame = YES;
|
||||
_isOkFirstRenderVideoFrame = YES;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
//隐藏监控连接中的UI
|
||||
[self hiddenMonitoringUI:YES callErrorInfo:nil isReCall:NO];
|
||||
[self didHiddenMonitorUIWith:YES];
|
||||
|
||||
|
||||
});
|
||||
//设置默认高清
|
||||
[self setGaoQingHuoBiaoQing];
|
||||
|
||||
}
|
||||
|
||||
[self.remoteView render:m_pAVFrame];
|
||||
vReleaseVideoFrame();
|
||||
}
|
||||
usleep(10000);
|
||||
}
|
||||
|
||||
|
||||
_isPlaying = NO;
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - 设置标清或高清
|
||||
//由于要隐藏掉 画质选项卡 这里重写方法 设置视频默认高清 或标清
|
||||
|
||||
-(void)setGaoQingHuoBiaoQing{
|
||||
BOOL is16B9 = [[P2PClient sharedClient] is16B9];
|
||||
BOOL is960P = [[P2PClient sharedClient] is960P];
|
||||
//右边的画质图标
|
||||
int rightItemCount = 0;
|
||||
if(is16B9 || is960P){
|
||||
rightItemCount = 3;
|
||||
}else{
|
||||
rightItemCount = 2;
|
||||
}
|
||||
|
||||
//设置高清
|
||||
if (rightItemCount==3) {
|
||||
|
||||
[[P2PClient sharedClient] sendCommandType:USR_CMD_VIDEO_CTL andOption:7];
|
||||
[self updateRightButtonState:CONTROLLER_BTN_TAG_HD];
|
||||
|
||||
}else if (rightItemCount == 2){
|
||||
|
||||
//设置标清
|
||||
|
||||
[[P2PClient sharedClient] sendCommandType:USR_CMD_VIDEO_CTL andOption:5];
|
||||
[self updateRightButtonState:CONTROLLER_BTN_TAG_SD];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - 设置高清、标清选中
|
||||
-(void)updateRightButtonState:(NSInteger)tag{
|
||||
|
||||
for(UIView *view in self.controllerRight.subviews){
|
||||
UILabel *labelHD = (UILabel *)[view viewWithTag:CONTROLLER_LABEL_TAG_HD];
|
||||
if (labelHD) {
|
||||
labelHD.textColor = XWhite;
|
||||
}
|
||||
UILabel *labelSD = (UILabel *)[view viewWithTag:CONTROLLER_LABEL_TAG_SD];
|
||||
if (labelSD) {
|
||||
labelSD.textColor = XWhite;
|
||||
}
|
||||
UILabel *labelLD = (UILabel *)[view viewWithTag:CONTROLLER_LABEL_TAG_LD];
|
||||
if (labelLD) {
|
||||
labelLD.textColor = XWhite;
|
||||
}
|
||||
}
|
||||
UIButton *button = (UIButton*)[self.controllerRight viewWithTag:tag];
|
||||
|
||||
|
||||
//重新调整监控画面
|
||||
UIButton *rButton = (UIButton *)[self.bottomBarView viewWithTag:CONTROLLER_BTN_TAG_RESOLUTION];
|
||||
if (tag == CONTROLLER_BTN_TAG_HD) {
|
||||
UILabel *label = (UILabel *)[button viewWithTag:CONTROLLER_LABEL_TAG_HD];
|
||||
label.textColor = XBlue;
|
||||
//[rButton setTitle:NSLocalizedString(@"HD", nil) forState:UIControlStateNormal];
|
||||
[rButton setTitle:NSLocalizedString(@"高清", nil) forState:UIControlStateNormal];
|
||||
}else if(tag == CONTROLLER_BTN_TAG_SD){
|
||||
UILabel *label = (UILabel *)[button viewWithTag:CONTROLLER_LABEL_TAG_SD];
|
||||
label.textColor = XBlue;
|
||||
[rButton setTitle:NSLocalizedString(@"标清", nil) forState:UIControlStateNormal];
|
||||
//[rButton setTitle:NSLocalizedString(@"SD", nil) forState:UIControlStateNormal];
|
||||
}else if (tag == CONTROLLER_BTN_TAG_LD){
|
||||
UILabel *label = (UILabel *)[button viewWithTag:CONTROLLER_LABEL_TAG_LD];
|
||||
label.textColor = XBlue;
|
||||
[rButton setTitle:NSLocalizedString(@"流畅", nil) forState:UIControlStateNormal];
|
||||
//[rButton setTitle:NSLocalizedString(@"LD", nil) forState:UIControlStateNormal];
|
||||
}
|
||||
|
||||
[self didHiddenResolutionInterface];
|
||||
}
|
||||
|
||||
-(void)didHiddenResolutionInterface{
|
||||
[UIView animateWithDuration:0.2 animations:^{
|
||||
CGRect controllerRight = self.controllerRight.frame;
|
||||
controllerRight.origin.y = _horizontalScreenH;
|
||||
self.controllerRight.frame = controllerRight;
|
||||
self.controllerRightBg.frame = controllerRight;
|
||||
|
||||
} completion:^(BOOL finished) {
|
||||
self.isAlreadyShowResolution = NO;
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - 隐藏监控连接中的UI
|
||||
-(void)hiddenMonitoringUI:(BOOL)isHidden callErrorInfo:(NSDictionary*)info isReCall:(BOOL)isReCall{
|
||||
if (isHidden) {
|
||||
[self.yProgressView stop];
|
||||
[self.yProgressView setHidden:YES];
|
||||
//连接不上原因文字 暂时不用
|
||||
// [self.labelTip setHidden:YES];
|
||||
|
||||
[self.promptButton setEnabled:NO];
|
||||
[self.promptButton setHidden:YES];
|
||||
|
||||
[self.stopBtnH setEnabled:YES];
|
||||
|
||||
}else{
|
||||
if (isReCall) {
|
||||
|
||||
self.yProgressView.backgroundView.image = LXImageWithImageName(@"monitor_press.png");
|
||||
[self.yProgressView start];
|
||||
|
||||
// self.labelTip.text = [NSString stringWithFormat:@"%@",NSLocalizedString(@"monitor_out_prompt", nil)];
|
||||
[self.promptButton setEnabled:NO];
|
||||
//self.stopImageViewH.image = LXImageWithImageName(@"monitor_stop_h.png");
|
||||
[self.stopBtnH setBackgroundImage:LXImageWithImageName(@"monitor_stop_h.png") forState:UIControlStateNormal];
|
||||
|
||||
// 禁用 底部栏暂停按钮
|
||||
[self.stopBtnH setEnabled:NO];
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
if (_isStop) {
|
||||
//暂停
|
||||
self.yProgressView.angle = 0.0f;
|
||||
self.yProgressView.backgroundView.image = LXImageWithImageName(@"ifishCamera_start");
|
||||
//int errorFlag = [[info objectForKey:@"errorFlag"] intValue];
|
||||
// self.labelTip.text = [self getCallErrorStringWith:errorFlag];
|
||||
//self.stopImageViewH.image = LXImageWithImageName(@"monitor_on_h.png");
|
||||
[self.stopBtnH setBackgroundImage:LXImageWithImageName(@"monitor_on_h.png") forState:UIControlStateNormal];
|
||||
|
||||
}else{
|
||||
self.yProgressView.angle = 0.0f;
|
||||
self.yProgressView.backgroundView.image = LXImageWithImageName(@"ifishCamera_start");
|
||||
//int errorFlag = [[info objectForKey:@"errorFlag"] intValue];
|
||||
//int errorFlag = CALL_ERROR_HANGUP ;
|
||||
// self.labelTip.text = [self getCallErrorStringWith:errorFlag];
|
||||
|
||||
[self.stopBtnH setBackgroundImage:LXImageWithImageName(@"monitor_on_h.png") forState:UIControlStateNormal];
|
||||
|
||||
}
|
||||
|
||||
self.yProgressView.angle = 0.0f;
|
||||
[self.yProgressView stop];
|
||||
|
||||
//int errorFlag = [[info objectForKey:@"errorFlag"] intValue];
|
||||
//self.labelTip.text = [self getCallErrorStringWith:errorFlag];
|
||||
|
||||
[self.promptButton setEnabled:YES];
|
||||
[self.stopBtnH setEnabled:YES];
|
||||
|
||||
}
|
||||
|
||||
[self.yProgressView setHidden:NO];
|
||||
|
||||
// [self.labelTip setHidden:NO];
|
||||
|
||||
[self.promptButton setHidden:NO];
|
||||
[self.canvasView bringSubviewToFront:self.promptButton];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)didHiddenMonitorUIWith:(BOOL)isAfterRender{
|
||||
if (!isAfterRender) {
|
||||
|
||||
[self.controllerRightBg setAlpha:0.0];
|
||||
[self.controllerRight setAlpha:0.0];
|
||||
[self.bottomView setAlpha:0.0];
|
||||
[self.bottomBarView setAlpha:0.0];
|
||||
[self.customBorderButton setAlpha:0.0];
|
||||
[self.leftView setAlpha:0.0];
|
||||
[self.focalLengthView setAlpha:0.0];
|
||||
[self.pressView setAlpha:0.0];
|
||||
|
||||
|
||||
}else{
|
||||
[self.controllerRightBg setAlpha:0.5];
|
||||
[self.controllerRight setAlpha:1.0];
|
||||
[self.bottomView setAlpha:0.5];
|
||||
[self.bottomBarView setAlpha:1.0];
|
||||
[self.customBorderButton setAlpha:0.5];
|
||||
[self.leftView setAlpha:0.5];
|
||||
[self.focalLengthView setAlpha:1.0];
|
||||
[self.pressView setAlpha:1.0];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - 点击手势(单击)
|
||||
|
||||
|
||||
-(void)onSingleTap
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - openGLViewDelegate
|
||||
|
||||
-(void)onScreenShotted:(UIImage*)image
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
-79
@@ -1,79 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12121" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="IfishP2PVideoPlayView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="180"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Rqq-4f-ctH">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="180"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="WZn-QN-Ofd">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="180"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
</button>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="KhV-XU-A6Q" customClass="ProgressImageView">
|
||||
<rect key="frame" x="135" y="64" width="50" height="50"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
</imageView>
|
||||
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="vyn-Jm-LDF" customClass="OpenGLView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="180"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<view alpha="0.5" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bBc-Xz-ZzV">
|
||||
<rect key="frame" x="0.0" y="144" width="320" height="36"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gek-5l-Orh">
|
||||
<rect key="frame" x="8" y="7" width="24" height="22"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<state key="normal" backgroundImage="monitor_stop_h.png"/>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="uPB-Ne-IO9">
|
||||
<rect key="frame" x="286" y="5" width="26" height="26"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<state key="normal" backgroundImage="monitor_switch_screen_img_h.png"/>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<gestureRecognizers/>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<connections>
|
||||
<outlet property="canvasView" destination="Rqq-4f-ctH" id="Zfd-bY-3al"/>
|
||||
<outlet property="midToolHView" destination="bBc-Xz-ZzV" id="h13-hh-vgr"/>
|
||||
<outlet property="promptButton" destination="WZn-QN-Ofd" id="TSg-yd-YjJ"/>
|
||||
<outlet property="remoteView" destination="vyn-Jm-LDF" id="0CE-M1-Fdo"/>
|
||||
<outlet property="stopBtnH" destination="gek-5l-Orh" id="3rL-UF-6Lh"/>
|
||||
<outlet property="switchScreenButtonH" destination="uPB-Ne-IO9" id="U6m-yX-OiT"/>
|
||||
<outlet property="yProgressView" destination="KhV-XU-A6Q" id="p87-Hy-cqD"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="-332" y="-226"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="monitor_stop_h.png" width="46" height="68"/>
|
||||
<image name="monitor_switch_screen_img_h.png" width="90" height="68"/>
|
||||
</resources>
|
||||
<simulatedMetricsContainer key="defaultSimulatedMetrics">
|
||||
<simulatedStatusBarMetrics key="statusBar"/>
|
||||
<simulatedOrientationMetrics key="orientation"/>
|
||||
<simulatedScreenMetrics key="destination" type="retina4_7.fullscreen"/>
|
||||
</simulatedMetricsContainer>
|
||||
</document>
|
||||
@@ -1,14 +0,0 @@
|
||||
//
|
||||
// WoDeKanKanViewCell.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/11/9.
|
||||
// Copyright © 2016年 lianxiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface WoDeKanKanViewCell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet UIButton *editBtn;
|
||||
|
||||
@end
|
||||
@@ -1,24 +0,0 @@
|
||||
//
|
||||
// WoDeKanKanViewCell.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/11/9.
|
||||
// Copyright © 2016年 lianxiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WoDeKanKanViewCell.h"
|
||||
|
||||
@implementation WoDeKanKanViewCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,108 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11542" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_0" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11524"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="WoDeKanKanViewCell" id="KGk-i7-Jjw" customClass="WoDeKanKanViewCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="210"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="209"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<imageView contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="kankan_listbanner.jpg" translatesAutoresizingMaskIntoConstraints="NO" id="bJs-Is-3Jm">
|
||||
<rect key="frame" x="8" y="8" width="304" height="170"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
</imageView>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="kankanlook_icon_attention.png" translatesAutoresizingMaskIntoConstraints="NO" id="cJK-on-p4b">
|
||||
<rect key="frame" x="8" y="186" width="12" height="12"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
</imageView>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="kankanlook_icon_sentiment.png" translatesAutoresizingMaskIntoConstraints="NO" id="mCQ-ze-x6U">
|
||||
<rect key="frame" x="74" y="186" width="12" height="12"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
</imageView>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="kankanlook_icon_active.png" translatesAutoresizingMaskIntoConstraints="NO" id="jvh-za-aWz">
|
||||
<rect key="frame" x="146" y="186" width="12" height="12"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="10000人关注" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fd3-BS-Gaf">
|
||||
<rect key="frame" x="22" y="183" width="44" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="7"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="100人气" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nSG-KF-SM0">
|
||||
<rect key="frame" x="94" y="182" width="38" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="7"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="活跃度:优" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="HsV-mT-5eu">
|
||||
<rect key="frame" x="166" y="183" width="42" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="7"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="kankanlook_icon_clock.png" translatesAutoresizingMaskIntoConstraints="NO" id="Aho-Ot-rEi">
|
||||
<rect key="frame" x="250" y="186" width="12" height="12"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="已开播10天" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PLz-E0-k1v">
|
||||
<rect key="frame" x="270" y="183" width="42" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="7"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="dDY-xU-j3a">
|
||||
<rect key="frame" x="22" y="155" width="12" height="13"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.40784313725490196" green="0.65490196078431373" blue="0.99215686274509807" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="right" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0L3-IR-bvv">
|
||||
<rect key="frame" x="232" y="26" width="65" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.40318834460000003" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="10"/>
|
||||
<state key="normal" title="编辑资料"/>
|
||||
</button>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="kankanlook_icon_editor.png" translatesAutoresizingMaskIntoConstraints="NO" id="D6S-Uh-hl4">
|
||||
<rect key="frame" x="232" y="27" width="17" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
</imageView>
|
||||
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="right" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="JFr-4m-Agk">
|
||||
<rect key="frame" x="14" y="152" width="61" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.40318834459459457" colorSpace="calibratedRGB"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="10"/>
|
||||
<state key="normal" title="直播中"/>
|
||||
</button>
|
||||
</subviews>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="editBtn" destination="0L3-IR-bvv" id="ZKB-71-Ook"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="-140" y="-45"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="kankan_listbanner.jpg" width="1080" height="503"/>
|
||||
<image name="kankanlook_icon_active.png" width="9" height="9"/>
|
||||
<image name="kankanlook_icon_attention.png" width="9" height="9"/>
|
||||
<image name="kankanlook_icon_clock.png" width="9" height="9"/>
|
||||
<image name="kankanlook_icon_editor.png" width="10" height="10"/>
|
||||
<image name="kankanlook_icon_sentiment.png" width="8" height="10"/>
|
||||
</resources>
|
||||
</document>
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
//
|
||||
// WoDeKanKanViewController.h
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/11/9.
|
||||
// Copyright © 2016年 lianxiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import "BaseViewController.h"
|
||||
|
||||
@interface WoDeKanKanViewController : BaseViewController
|
||||
|
||||
|
||||
|
||||
@end
|
||||
-136
@@ -1,136 +0,0 @@
|
||||
//
|
||||
// WoDeKanKanViewController.m
|
||||
// Ifish
|
||||
//
|
||||
// Created by imac on 16/11/9.
|
||||
// Copyright © 2016年 lianxiang. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WoDeKanKanViewController.h"
|
||||
#import "WoDeKanKanViewCell.h"
|
||||
#import "MineKankanEditViewController.h"
|
||||
@interface WoDeKanKanViewController ()<UITableViewDelegate,UITableViewDataSource>
|
||||
|
||||
@property(nonatomic,strong)UITableView *tableView;
|
||||
|
||||
@property(nonatomic,strong) NSMutableArray *dataArr;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation WoDeKanKanViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
//
|
||||
[self addTitleViewWithTitle:@"我的看看"];
|
||||
[self creatTab];
|
||||
|
||||
}
|
||||
|
||||
-(void)creatTab{
|
||||
|
||||
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0,0,self.view.frame.size.width,self.view.frame.size.height ) style:UITableViewStylePlain];
|
||||
|
||||
self.tableView.delegate = self;
|
||||
self.tableView.dataSource = self;
|
||||
self.tableView.scrollEnabled = YES;
|
||||
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
self.tableView.showsVerticalScrollIndicator = NO;
|
||||
self.tableView.backgroundColor = TABLE_BACKGROUD_COLOR;
|
||||
[self.view addSubview:self.tableView];
|
||||
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - Table view data source
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
||||
|
||||
return 20;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
|
||||
WoDeKanKanViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"WoDeKanKanViewCell"];
|
||||
if (!cell) {
|
||||
|
||||
cell = [[[NSBundle mainBundle]loadNibNamed:@"WoDeKanKanViewCell" owner:self options:nil]lastObject];
|
||||
|
||||
}
|
||||
|
||||
[cell.editBtn addTarget:self action:@selector(editBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
return cell;
|
||||
|
||||
}
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
||||
|
||||
if (section == 0) {
|
||||
return 0;
|
||||
|
||||
}else{
|
||||
return 20;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
return kScreenSize.width*0.65;
|
||||
|
||||
}
|
||||
|
||||
-(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
||||
UIView*view = nil;
|
||||
|
||||
if (section!=0) {
|
||||
|
||||
view= [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenSize.width, 20)];
|
||||
view.backgroundColor = RGB(242, 242, 242);
|
||||
|
||||
}
|
||||
|
||||
return view;
|
||||
|
||||
}
|
||||
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
// Dispose of any resources that can be recreated.
|
||||
}
|
||||
|
||||
|
||||
-(void)editBtnAction{
|
||||
|
||||
|
||||
MineKankanEditViewController *editVC = [[MineKankanEditViewController alloc] init];
|
||||
|
||||
[self.navigationController pushViewController:editVC animated:YES];
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
#pragma mark - Navigation
|
||||
|
||||
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
||||
// Get the new view controller using [segue destinationViewController].
|
||||
// Pass the selected object to the new view controller.
|
||||
}
|
||||
*/
|
||||
|
||||
@end
|
||||
-1
@@ -23,7 +23,6 @@
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
//[self creatPalyer];
|
||||
self.view.backgroundColor= [UIColor colorWithPatternImage:[UIImage imageNamed:@"enter_background"]];
|
||||
//播放
|
||||
[self.moviePlayer play];
|
||||
|
||||
+4
-7
@@ -8,13 +8,12 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "TouchButton.h"
|
||||
#import "OpenGLView.h"
|
||||
#import "P2PClient.h"
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
#import "CustomBorderButton.h"
|
||||
#import "CustomView.h"
|
||||
#import "ProgressImageView.h"
|
||||
#import "KanHuListModel.h"
|
||||
#import <GWP2P/GWP2P.h>
|
||||
//竖屏
|
||||
#define STOPBTN_TAG 1603227
|
||||
#define SOUND_BUTTON_H_TAG 1603221
|
||||
@@ -34,14 +33,12 @@
|
||||
|
||||
@interface ShopKanHuP2PViewController : BaseViewController <AVCaptureVideoDataOutputSampleBufferDelegate, UIGestureRecognizerDelegate,
|
||||
TouchButtonDelegate,
|
||||
OpenGLViewDelegate,
|
||||
UIScrollViewDelegate,
|
||||
UIAlertViewDelegate,
|
||||
P2PClientDelegate,
|
||||
KanHuBaoGaoViewDelegate>
|
||||
|
||||
|
||||
@property (nonatomic, strong) OpenGLView *remoteView;
|
||||
@property (nonatomic, strong) UIView *remoteView;
|
||||
@property (nonatomic,strong) KanHuListModel *kanHuCamera;
|
||||
@property (nonatomic) BOOL isPlaying;
|
||||
@property (nonatomic) BOOL isReject;
|
||||
@@ -64,7 +61,8 @@
|
||||
@property (nonatomic) BOOL isAlreadyShowResolution;//重新调整监控画面
|
||||
|
||||
@property (nonatomic) BOOL isDefenceOn;//重新调整监控画面
|
||||
|
||||
//监控画面
|
||||
Strong GWP2PVideoPlayer *player;
|
||||
|
||||
@property (assign,nonatomic) BOOL isFullScreen;
|
||||
@property (strong, nonatomic) UIView *fullScreenBgView;
|
||||
@@ -110,7 +108,6 @@
|
||||
@property (assign,nonatomic) BOOL isIntoMonitorFromMonitor;
|
||||
|
||||
//下半部生成报告部分 竖屏显示 全屏时,隐藏
|
||||
//@property (nonatomic,strong) KanHuBaoGaoView *baoGaoToolHView;
|
||||
@property (nonatomic,strong) UIView *HbootmView;
|
||||
@property (nonatomic,strong) NSDictionary*baGaoDic;
|
||||
@property (nonatomic,strong) NSArray *pinFenArray;
|
||||
|
||||
+184
-703
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user