|
@@ -157,8 +157,7 @@ UIDocumentPickerDelegate>
|
|
|
|
|
|
@property (nonatomic, copy) NSString*LogoutTimerStr;//单点登出时间
|
|
|
@property (nonatomic, assign) BOOL needShowLogoutDelayType;//是否是延时显示单点登出
|
|
|
-@property (nonatomic, assign) BOOL isRebootIngType;//是否为重启中
|
|
|
-@property (nonatomic, assign) BOOL isResetingType;//是否为恢复出厂中
|
|
|
+
|
|
|
@end
|
|
|
|
|
|
@implementation PlayerViewController
|
|
@@ -561,8 +560,6 @@ UIDocumentPickerDelegate>
|
|
|
mPlayerView.delegate = self;
|
|
|
|
|
|
|
|
|
- deviceShareStates = 2;
|
|
|
-
|
|
|
[self.view addSubview:mPlayerView];
|
|
|
|
|
|
[mPlayerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
@@ -844,21 +841,17 @@ UIDocumentPickerDelegate>
|
|
|
}
|
|
|
|
|
|
//重启后重连 出来的
|
|
|
- if(_isRebootIngType && !forceStartTimer){
|
|
|
+ if([webSocketManager shareInstance].isRebootIngType && !forceStartTimer){
|
|
|
mainBlock(^{
|
|
|
[[iToast makeText:NSLocalizedString(@"player_link_reboot_suc_Tips",nil)] show];
|
|
|
});
|
|
|
- _isRebootIngType = NO;
|
|
|
- //[self opencommandChannelManagerrc_openURL];
|
|
|
}
|
|
|
|
|
|
//重启后重连 出来的
|
|
|
- if(_isResetingType){
|
|
|
+ if([webSocketManager shareInstance].isResetingType){
|
|
|
mainBlock(^{
|
|
|
[[iToast makeText:NSLocalizedString(@"my_set_no_Restore_Factory_ok_tips",nil)] show];
|
|
|
});
|
|
|
- _isResetingType = NO;
|
|
|
- //[self opencommandChannelManagerrc_openURL];
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1175,17 +1168,6 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
|
|
|
NSString *dataStr = [RCCommandHelp commandResolution500WithType:(NSUInteger)BITRATE_WIFI_HD];
|
|
|
[self.liveStreamManager rc_sendJsonData:[dataStr UTF8String]];
|
|
|
|
|
|
-// // 20210305 因为安卓做了分辨率适应 而iOS不需要 所以现在指定接收码率 这个就不用修改对应触摸点的范围比例了 W_PHONE H_PHONE
|
|
|
-// // 发送数据
|
|
|
-// if ([deviceModel.buyVipType isEqualToString:CloudPhoneTypeWuJiPro]) {
|
|
|
-// NSString *commondStr = @"{\"data\":{\"height\":1920,\"width\":1080},\"type\":\"setPhoneSize\"}";
|
|
|
-// [self send_data:commondStr];
|
|
|
-// }
|
|
|
-//
|
|
|
-// //记录推流开始时间
|
|
|
-// NSString *connectedDataStr = [RCCommandHelp commandConnectedWithDeviceId:deviceId];
|
|
|
-// [self send_data:connectedDataStr];
|
|
|
-
|
|
|
[connectLock unlock];
|
|
|
}
|
|
|
|
|
@@ -1313,46 +1295,6 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-//#pragma mark 重启盒子
|
|
|
-// //{"type":"reboot"}
|
|
|
-// nextVC.needToReboot = ^{
|
|
|
-// [weakSelf needToRebootFun];
|
|
|
-// };
|
|
|
-//
|
|
|
-//#pragma mark TV投屏
|
|
|
-// nextVC.needToTVP2P = ^{
|
|
|
-// NSString *commondStr = @"{\"type\":\"wakeupTV\"}";
|
|
|
-// [weakSelf send_data:commondStr];
|
|
|
-// };
|
|
|
-//#pragma mark 关闭TV投屏
|
|
|
-// nextVC.closeTVP2P = ^{
|
|
|
-// NSString *commondStr = @"{\"type\":\"TvOff\"}";
|
|
|
-// [weakSelf send_data:commondStr];
|
|
|
-// };
|
|
|
-//
|
|
|
-//#pragma mark 恢复出厂盒子
|
|
|
-// nextVC.needToReset = ^{
|
|
|
-// [weakSelf needToResetFun];
|
|
|
-// };
|
|
|
-//
|
|
|
-//#pragma mark 恢复出厂盒子 ok
|
|
|
-// nextVC.needToResetAndOk = ^{
|
|
|
-// [weakSelf tryAgainInLinkFailFun];
|
|
|
-// [weakSelf startCheckThridRuiYunTimerFun];
|
|
|
-// };
|
|
|
-//
|
|
|
-
|
|
|
-//#pragma mark 获取云机版本信息
|
|
|
-// nextVC.getSysInfo = ^{
|
|
|
-// NSString *commondStr = @"{\"type\":\"getSysInfo\"}";
|
|
|
-// [weakSelf send_data:commondStr];
|
|
|
-// };
|
|
|
-
|
|
|
-//#pragma mark 获取TV投屏状态
|
|
|
-// nextVC.getTvStatus = ^{
|
|
|
-// NSString *commondStr = @"{\"type\":\"TvStatus\"}";
|
|
|
-// [weakSelf send_data:commondStr];
|
|
|
-// };
|
|
|
}
|
|
|
|
|
|
#pragma mark 退出云机
|
|
@@ -1441,7 +1383,7 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
|
|
|
//最后一帧 没显示正在重启问题
|
|
|
_canShowImgAndVoiceType = YES;
|
|
|
|
|
|
- _isRebootIngType = YES;
|
|
|
+ [webSocketManager shareInstance].isRebootIngType = YES;
|
|
|
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(30 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
// [self reconnectDevice];
|
|
|
// });
|
|
@@ -1477,7 +1419,7 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
|
|
|
|
|
|
//最后一帧 没显示正在重启问题
|
|
|
//self->_canShowImgAndVoiceType = YES;
|
|
|
- _isResetingType = YES;
|
|
|
+ [webSocketManager shareInstance].isResetingType = YES;
|
|
|
|
|
|
//添加到任务监听
|
|
|
//[self addCommandSendTaskFunWithType:@"reset" WithCommandStr:commondStr];
|
|
@@ -1627,79 +1569,6 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
|
|
|
{
|
|
|
mPlayerView.controlBtn.hidden = isHide;
|
|
|
}
|
|
|
-#pragma mark - PlayerControlViewDelegate---控制器按键
|
|
|
-//- (void)stopShareBtnBePressed:(id)sender
|
|
|
-//{
|
|
|
-// HLog(@"__________%s__________",__func__);
|
|
|
-// /*关闭分享成功后调用*/
|
|
|
-// CloudPhoneModel *deviceDcit = [[UseAccountManage shareInstance].cloudPhoneListModel.diskInfo objectAtIndex:phoneIndex];
|
|
|
-// NSString *userCardId = @"";
|
|
|
-// userCardId = [NSString stringWithFormat:@"%ld",deviceDcit.phoneId];
|
|
|
-//
|
|
|
-// NSString *username = deviceDcit.username;
|
|
|
-//
|
|
|
-// if (0 == deviceShareStates || deviceShareStates == 3)/*分享中*/
|
|
|
-// {
|
|
|
-// /*暂停分享*/
|
|
|
-// NSString *reqsturl = [NSString stringWithFormat:SuspendScreenShareAPI,userCardId,username];
|
|
|
-// [[UseAccountManage shareInstance] CommonGetWithCallBackCode:reqsturl Parameters:nil success:^(id _Nonnull responseObject) {
|
|
|
-// SuperModel *mod = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
|
|
|
-// [self removeNewIndicator];
|
|
|
-// NSString *showStr = nil;
|
|
|
-// showStr = mod.msg;
|
|
|
-// if (mod.status && mod.status.integerValue == 0)
|
|
|
-// {
|
|
|
-// deviceDcit.screenShareStatus = 1;
|
|
|
-// self->deviceShareStates = 1;
|
|
|
-// [self->controlView pauseShareView];
|
|
|
-// /*刷新视图 更新设备列表*/
|
|
|
-// deviceDcit.screenShareStatus = self->deviceShareStates;
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// if (mod.msg == nil || [mod.msg isEqualToString:@""])
|
|
|
-// {
|
|
|
-// showStr = @"暂停分享失败";
|
|
|
-// }
|
|
|
-// [[iToast makeText:showStr] show];
|
|
|
-// }
|
|
|
-// }
|
|
|
-// failure:^(NSError * _Nonnull error) {
|
|
|
-// [[iToast makeText:@"暂停分享失败"] show];
|
|
|
-// [self removeNewIndicator];
|
|
|
-// }];
|
|
|
-// }
|
|
|
-// else if (1 == deviceShareStates)/*暂停分享*/
|
|
|
-// {
|
|
|
-// /*开启分享*/
|
|
|
-// NSString *reqsturl = [NSString stringWithFormat:StartAgainScreenShareAPI,userCardId,username];
|
|
|
-// [[UseAccountManage shareInstance] CommonGetWithCallBackCode:reqsturl Parameters:nil success:^(id _Nonnull responseObject) {
|
|
|
-// SuperModel *mod = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
|
|
|
-// [self removeNewIndicator];
|
|
|
-// NSString *showStr = nil;
|
|
|
-// showStr = mod.msg;
|
|
|
-// if (mod.status && mod.status.integerValue == 0)
|
|
|
-// {
|
|
|
-// self->deviceShareStates = 3;
|
|
|
-// deviceDcit.screenShareStatus = self->deviceShareStates;
|
|
|
-// [self->controlView shareingShareView];
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// if (mod.msg == nil || [mod.msg isEqualToString:@""])
|
|
|
-// {
|
|
|
-// showStr = @"开启分享失败";
|
|
|
-// }
|
|
|
-// [[iToast makeText:showStr] show];
|
|
|
-// }
|
|
|
-// }
|
|
|
-// failure:^(NSError * _Nonnull error) {
|
|
|
-// [[iToast makeText:@"开启分享失败"] show];
|
|
|
-// [self removeNewIndicator];
|
|
|
-// }];
|
|
|
-// }
|
|
|
-//}
|
|
|
-
|
|
|
|
|
|
|
|
|
#pragma mark - 新的手势回调委托
|
|
@@ -1804,7 +1673,7 @@ BOOL inReconnect = NO;
|
|
|
}
|
|
|
|
|
|
//重启后重连 出来的 不显示
|
|
|
- if(!self->_isRebootIngType && !self->_isResetingType && ![self isPlayerViewIsTopVCFun]){
|
|
|
+ if(![webSocketManager shareInstance].isRebootIngType && ![webSocketManager shareInstance].isResetingType && ![self isPlayerViewIsTopVCFun]){
|
|
|
/*链接失败*/
|
|
|
//[[iToast makeText:NSLocalizedString(@"player_link_fail_tip",nil)] show];
|
|
|
[self showNetErrorAlertFun:5];
|
|
@@ -1814,28 +1683,9 @@ BOOL inReconnect = NO;
|
|
|
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
- //hxd add 每次重新连接时间 要间隔3秒
|
|
|
-// NSInteger curTryAginTime = [iTools getNowTimeStamp];
|
|
|
-// if(preTryAginTime > 0
|
|
|
-// && (curTryAginTime - preTryAginTime < 3)){
|
|
|
-// return;
|
|
|
-// }
|
|
|
-//
|
|
|
-// if(RCLiveSteamlinkState == ConnectStateConnected){
|
|
|
-// return;
|
|
|
-// }
|
|
|
-//
|
|
|
-// preTryAginTime = curTryAginTime;
|
|
|
|
|
|
reConnectAccount++;
|
|
|
|
|
|
-// mainBlock(^{
|
|
|
-// if(self->linkFailAlretVC && self->linkFailAlretVC.view.tag == 2){
|
|
|
-// [[webSocketManager shareInstance] WebSocketNeedRelinkFun];
|
|
|
-// }
|
|
|
-// });
|
|
|
-
|
|
|
[cachesFileManager writeLogsWithMsg:@"reconnectDevice"];
|
|
|
|
|
|
[self reconnectDevice];
|