|
|
@@ -144,6 +144,8 @@ ComontAlretViewControllerDelegate>
|
|
|
@property (nonatomic, assign) NSInteger currentTime;
|
|
|
/**定时器计数*/
|
|
|
@property (nonatomic, assign) NSInteger webSocketTime;
|
|
|
+/**定时器计数 任务检测*/
|
|
|
+@property (nonatomic, assign) NSInteger webSocketTaskTime;
|
|
|
|
|
|
/**是否是收入进入云手机*/
|
|
|
@property (nonatomic, assign) BOOL isFirstEnterPhone;
|
|
|
@@ -274,8 +276,7 @@ ComontAlretViewControllerDelegate>
|
|
|
[self connectVideoServer];
|
|
|
[self opencommandChannelManagerrc_openURL];
|
|
|
|
|
|
-// _timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timerChange) userInfo:nil repeats:YES];
|
|
|
-// [[NSRunLoop currentRunLoop] addTimer:_timer forMode:NSRunLoopCommonModes];
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- (void)initData
|
|
|
@@ -337,16 +338,16 @@ ComontAlretViewControllerDelegate>
|
|
|
[[[[UIApplication sharedApplication] keyWindow] viewWithTag:1235] removeFromSuperview];
|
|
|
}
|
|
|
|
|
|
- // 销毁定时器
|
|
|
- [self cancelTimer];
|
|
|
-
|
|
|
[self enablePanRightBack];
|
|
|
+ // 屏幕常亮
|
|
|
+ [UIApplication sharedApplication].idleTimerDisabled = NO;
|
|
|
+ [[UIApplication sharedApplication] setStatusBarHidden:NO];
|
|
|
|
|
|
// 播放器内部页面跳转-不能回收的资源
|
|
|
if (self.isNeedRecyclResource) {
|
|
|
- // 屏幕常亮
|
|
|
- [UIApplication sharedApplication].idleTimerDisabled = NO;
|
|
|
- [[UIApplication sharedApplication] setStatusBarHidden:NO];
|
|
|
+
|
|
|
+ // 销毁定时器
|
|
|
+ [self cancelTimer];
|
|
|
|
|
|
if (USEAAC)
|
|
|
{
|
|
|
@@ -385,11 +386,6 @@ ComontAlretViewControllerDelegate>
|
|
|
forceStartTimer = nil;
|
|
|
}
|
|
|
|
|
|
- if(_timer){
|
|
|
- [_timer invalidate];
|
|
|
- _timer = nil;
|
|
|
- }
|
|
|
-
|
|
|
if(_checkThridConnectTimer){
|
|
|
[_checkThridConnectTimer invalidate];
|
|
|
_checkThridConnectTimer = nil;
|
|
|
@@ -1013,6 +1009,8 @@ ComontAlretViewControllerDelegate>
|
|
|
|
|
|
- (void)liveStreamManagerOutPut:(RCLiveSteamManager *)manager didOutPutVideoPixelBuffer:(CVPixelBufferRef)pixelBuffer {
|
|
|
|
|
|
+ mySelf.concentTime = [iTools getNowTimeStamp];
|
|
|
+
|
|
|
if(!_canShowImgAndVoiceType){
|
|
|
return;
|
|
|
}
|
|
|
@@ -1059,7 +1057,7 @@ ComontAlretViewControllerDelegate>
|
|
|
{
|
|
|
[mySelf showImageUIImageViewWithCIImage:ciImage pixelBufferRef:pixelBuffer];/*使用UIImageView渲染*/
|
|
|
|
|
|
- mySelf.concentTime = [iTools getNowTimeStamp];
|
|
|
+ //mySelf.concentTime = [iTools getNowTimeStamp];
|
|
|
mySelf.isConnectSuccess = YES;
|
|
|
}
|
|
|
}
|
|
|
@@ -1650,7 +1648,6 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//处理相册备份
|
|
|
[[backupsFileManager shareInstance] AutohandlePhotosBackupsFun];
|
|
|
}
|
|
|
@@ -2817,6 +2814,7 @@ static int couneeee = 0;
|
|
|
self.concentTime = [iTools getNowTimeStamp];
|
|
|
self.currentTime = 0;
|
|
|
self.webSocketTime = 0;
|
|
|
+ self.webSocketTaskTime = 0;
|
|
|
|
|
|
_timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timerChange) userInfo:nil repeats:YES];
|
|
|
[[NSRunLoop currentRunLoop] addTimer:_timer forMode:NSRunLoopCommonModes];
|
|
|
@@ -2824,8 +2822,10 @@ static int couneeee = 0;
|
|
|
|
|
|
- (void)cancelTimer {
|
|
|
// 取消定时器
|
|
|
- [_timer invalidate];
|
|
|
- _timer = nil;
|
|
|
+ if(_timer){
|
|
|
+ [_timer invalidate];
|
|
|
+ _timer = nil;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- (void)timerChange {
|
|
|
@@ -2840,11 +2840,24 @@ static int couneeee = 0;
|
|
|
//处理websockt是否断开
|
|
|
self.webSocketTime++;
|
|
|
|
|
|
+ //处理其他任务
|
|
|
+ self.webSocketTaskTime++;
|
|
|
+
|
|
|
if(self.webSocketTime > 8)
|
|
|
{
|
|
|
[self WebSocketNeedRelinkFun];
|
|
|
}
|
|
|
- //HLog(@"webSocketTime %ld",self.webSocketTime);
|
|
|
+
|
|
|
+ if(self.webSocketTaskTime > 10)
|
|
|
+ {
|
|
|
+ self.webSocketTaskTime = 0;
|
|
|
+ [self checkAllTaskFun];
|
|
|
+
|
|
|
+ NSString *commondStr = @"{\"type\":\"forwardMsg\",\"data\":\"offline_notification\"}";
|
|
|
+ [self send_data:commondStr];
|
|
|
+ }
|
|
|
+
|
|
|
+ //HLog(@"webSocketTime %ld",self.webSocketTaskTime);
|
|
|
}
|
|
|
|
|
|
// 3、30s之后 没有收到拉流数据 自动断开链接
|