|
|
@@ -140,7 +140,7 @@ ComontAlretViewControllerDelegate>
|
|
|
|
|
|
//音频和图片是否可以刷新
|
|
|
@property (nonatomic, assign) BOOL canShowImgAndVoiceType;
|
|
|
-@property (nonatomic, assign) BOOL isPwdVCShow;//当前是否有密码页面
|
|
|
+
|
|
|
@end
|
|
|
|
|
|
@implementation PlayerViewController
|
|
|
@@ -160,7 +160,6 @@ ComontAlretViewControllerDelegate>
|
|
|
}
|
|
|
canControl = YES;
|
|
|
_canShowImgAndVoiceType = NO;
|
|
|
- _isPwdVCShow = NO;
|
|
|
|
|
|
//[self opencommandChannelManagerrc_openURL];
|
|
|
//[self openbusinessCommandChannelManagerrc_openURL];
|
|
|
@@ -1463,12 +1462,23 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
|
|
|
}
|
|
|
|
|
|
#pragma mark 盒子第一次连接成功 给ws发送信息 单点登录 把其他账号挤下去
|
|
|
-bool didSendfristMsg = NO;
|
|
|
+
|
|
|
- (void)fristConnectNeedGiveAMsgFun{
|
|
|
- if(!didSendfristMsg){
|
|
|
+
|
|
|
+ if([self isPlayerViewIsTopVCFun]){
|
|
|
+ //等下再发
|
|
|
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
+ [self fristConnectNeedGiveAMsgFun];
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!_didSendfristMsg || _isLoginAgainType){
|
|
|
NSString *commondStr = @"{\"type\":\"forwardMsg\",\"data\":\"offline_notification\"}";
|
|
|
[self send_data:commondStr];
|
|
|
- didSendfristMsg = true;
|
|
|
+ _didSendfristMsg = true;
|
|
|
+
|
|
|
+ _isLoginAgainType = false;
|
|
|
//test code
|
|
|
//[self LogoutByOtherFun];
|
|
|
}
|
|
|
@@ -1514,16 +1524,31 @@ bool didSendfristMsg = NO;
|
|
|
[self setShowImgAndVoiceTypeFun:YES];
|
|
|
}
|
|
|
|
|
|
+#pragma mark 判断是否为密码界面登
|
|
|
+- (BOOL)isPlayerViewIsTopVCFun
|
|
|
+{
|
|
|
+ UIViewController*topVc = self.navigationController.viewControllers.lastObject;
|
|
|
+ if(_isPwdVCShow || ![topVc isKindOfClass:[PlayerViewController class]]){
|
|
|
+ return YES;
|
|
|
+ }
|
|
|
+
|
|
|
+ return NO;
|
|
|
+}
|
|
|
+
|
|
|
-(void)setShowImgAndVoiceTypeFun:(bool)isCan
|
|
|
{
|
|
|
if(isCan){//判断当前是否为最前面 才能播放
|
|
|
- UIViewController*topVc = self.navigationController.viewControllers.lastObject;
|
|
|
|
|
|
- if(_isPwdVCShow || ![topVc isKindOfClass:[PlayerViewController class]]){
|
|
|
+ if([self isPlayerViewIsTopVCFun]){
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
_canShowImgAndVoiceType = isCan;
|
|
|
+
|
|
|
+ if(_isLoginAgainType ){
|
|
|
+ [self opencommandChannelManagerrc_openURL];
|
|
|
+ _isLoginAgainType = false;
|
|
|
+ }
|
|
|
}
|
|
|
else{
|
|
|
_canShowImgAndVoiceType = isCan;
|
|
|
@@ -1863,7 +1888,7 @@ BOOL inReconnect = NO;
|
|
|
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setShowImgAndVoiceTypeFun) name:ShowImgAndVoiceNotification object:nil];
|
|
|
|
|
|
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setShowPwdVCTypeFun) name:ShowPwdVCNotification object:nil];
|
|
|
+ //[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setShowPwdVCTypeFun) name:ShowPwdVCNotification object:nil];
|
|
|
}
|
|
|
|
|
|
- (void)removeNSNotification
|