Просмотр исходного кода

1.【IOS端】视频横屏进行预览,点击分享,选中私密分享后,未弹窗私密弹窗

huangxiaodong месяцев назад: 11
Родитель
Сommit
0da3d7d708

+ 6 - 0
创维盒子/双子星云手机/Class/Set/previewFile/imageDetailsScrollViewController.m

@@ -109,6 +109,9 @@
  
     //结束 设备旋转通知
     [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
+    
+    //切换到竖屏
+    [self hx_rotateToInterfaceOrientation:UIInterfaceOrientationPortrait];
 }
 
 - (BOOL)shouldAutorotate {
@@ -402,6 +405,9 @@
         NSMutableArray *arr = [NSMutableArray new];
         [arr addObject:fileModel];
         
+        //切换到竖屏
+        [self hx_rotateToInterfaceOrientation:UIInterfaceOrientationPortrait];
+
         uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
         [self.navigationController pushViewController:vc animated:YES];
         vc.isDownloadingType = YES;

+ 19 - 0
创维盒子/双子星云手机/Class/Set/previewFile/videoPlayByAVPlayerViewController.m

@@ -45,6 +45,7 @@
 @property(nonatomic,strong)  editShareView *editShareV;
 @property(nonatomic,assign) BOOL isPortraitType;//竖屏状态
 @property(nonatomic,assign) BOOL isCodeSuspendAudioType;//手动暂停播放音乐
+@property(nonatomic,assign) BOOL isCodeSuspendVideoType;//手动暂停播放视频
 @end
 
 @implementation videoPlayByAVPlayerViewController
@@ -165,6 +166,11 @@
 
    //添加 设备旋转 通知
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientChange:)  name:UIDeviceOrientationDidChangeNotification object:nil];
+    
+    if(_isCodeSuspendVideoType){
+        [self.player.currentPlayerManager play];
+    }
+    
 }
 
 - (void)viewWillDisappear:(BOOL)animated {
@@ -178,6 +184,16 @@
  
     //结束 设备旋转通知
     [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
+    
+    if(_controlView.portraitControlView.playOrPauseBtn.selected
+      ||_controlView.landScapeControlView.playOrPauseBtn.selected)
+    {
+        [self.player.currentPlayerManager pause];
+        _isCodeSuspendVideoType = YES;
+    }
+    
+    //切换到竖屏
+    [self hx_rotateToInterfaceOrientation:UIInterfaceOrientationPortrait];
 }
 
 
@@ -653,6 +669,9 @@
         NSMutableArray *arr = [NSMutableArray new];
         [arr addObject:fileModel];
         
+        //切换到竖屏
+        [self hx_rotateToInterfaceOrientation:UIInterfaceOrientationPortrait];
+        
         uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
         [self.navigationController pushViewController:vc animated:YES];
         vc.isDownloadingType = YES;

+ 14 - 3
创维盒子/双子星云手机/Class/Set/previewFile/view/editShareView.m

@@ -546,7 +546,6 @@
 
 - (void)gotoShareFunWith:(NSInteger)tag with:(addShareModel*)model
 {
-    [self removeFromSuperview];
     
     //type1 朋友圈 2 微信好友 3 QQ
     NSInteger shareType = 1;
@@ -561,9 +560,12 @@
     }
     else if(tag == 13){
         [self showSecretShareViewFunwith:model];
-        return;;
+        [self removeFromSuperview];
+        return;
     }
     
+    [self removeFromSuperview];
+    
     NSString *serUrl = shareService;
     NSString *shareUrl = [[NSString alloc] initWithFormat:@"%@%@",serUrl,model.data.token];
     //NSString *shareTitle = [[NSString alloc] initWithFormat:@"Private-X%@",NSLocalizedString(@"common_edit_share",nil)];
@@ -593,7 +595,16 @@
     shareBySecretView *secretView = [[shareBySecretView alloc] init];
     secretView.addShareMod = model;
     secretView.didSelectListArr = _didSelectListArr;
-    [ksharedAppDelegate.window addSubview:secretView];
+    secretView.isPortraitType = _isPortraitType;
+    
+    UIView * curSuperView = [self superview];
+    if(curSuperView){//修复横竖视频播放隐私分享出问题
+        [curSuperView addSubview:secretView];
+    }
+    else{
+        [ksharedAppDelegate.window addSubview:secretView];
+    }
+    
     
     [secretView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(0);

+ 1 - 0
创维盒子/双子星云手机/Class/Set/previewFile/view/shareBySecretView.h

@@ -13,6 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
 @interface shareBySecretView : UIView
 @property (nonatomic, strong)  NSMutableArray*didSelectListArr;//选中的数据
 @property (nonatomic, strong)  addShareModel*addShareMod;//
+@property (nonatomic, assign) BOOL isPortraitType;//竖屏模式
 @end
 
 NS_ASSUME_NONNULL_END

+ 53 - 14
创维盒子/双子星云手机/Class/Set/previewFile/view/shareBySecretView.m

@@ -9,6 +9,7 @@
 #import "shareSecretTableViewCell.h"
 @interface shareBySecretView ()<UITableViewDelegate,UITableViewDataSource>
 @property (nonatomic,strong)UITableView*tableView;
+@property (nonatomic,strong)UIView *whiteBgView;
 @end
 
 
@@ -35,13 +36,13 @@
     
     CGFloat curWhiteBgH = 64 + curTableViewH + 194;
     
-    UIView *whiteBgView = [[UIView alloc] init];
-    whiteBgView.backgroundColor = [UIColor whiteColor];
-    [self addSubview:whiteBgView];
-    whiteBgView.layer.cornerRadius = 8;
-    whiteBgView.layer.masksToBounds = YES;
+    _whiteBgView = [[UIView alloc] init];
+    _whiteBgView.backgroundColor = [UIColor whiteColor];
+    [self addSubview:_whiteBgView];
+    _whiteBgView.layer.cornerRadius = 8;
+    _whiteBgView.layer.masksToBounds = YES;
     
-    [whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+    [_whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(40);
         make.right.mas_equalTo(-40);
         make.centerY.equalTo(self.mas_centerY).offset(-40);
@@ -66,7 +67,7 @@
     titleLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
     titleLabel.font = [UIFont systemFontOfSize:18.0];
     titleLabel.textColor = [UIColor hwColor:@"#151515"];
-    [whiteBgView addSubview:titleLabel];
+    [_whiteBgView addSubview:titleLabel];
     
     [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(15);
@@ -75,7 +76,7 @@
         make.height.mas_equalTo(25);
     }];
     
-    [whiteBgView addSubview:self.tableView];
+    [_whiteBgView addSubview:self.tableView];
     [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(15);
         make.right.mas_equalTo(-15);
@@ -86,7 +87,7 @@
     //文件分享有效期
     UIView *expirationDateBgView = [[UIView alloc] init];
     expirationDateBgView.backgroundColor = [UIColor hwColor:@"#F9F9F9"];
-    [whiteBgView addSubview:expirationDateBgView];
+    [_whiteBgView addSubview:expirationDateBgView];
     expirationDateBgView.layer.cornerRadius = 8;
     expirationDateBgView.layer.masksToBounds = YES;
     
@@ -136,7 +137,7 @@
     //提取码
     UIView *extractCodeBgView = [[UIView alloc] init];
     extractCodeBgView.backgroundColor = [UIColor hwColor:@"#F9F9F9"];
-    [whiteBgView addSubview:extractCodeBgView];
+    [_whiteBgView addSubview:extractCodeBgView];
     extractCodeBgView.layer.cornerRadius = 8;
     extractCodeBgView.layer.masksToBounds = YES;
     
@@ -180,7 +181,7 @@
     cancleButton.titleLabel.font = [UIFont systemFontOfSize:14.0];
     [cancleButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
     cancleButton.tag = 10;
-    [whiteBgView addSubview:cancleButton];
+    [_whiteBgView addSubview:cancleButton];
     cancleButton.layer.cornerRadius = 8;
     cancleButton.layer.masksToBounds = YES;
     cancleButton.backgroundColor = [UIColor hwColor:@"#E3E8F1"];
@@ -188,7 +189,7 @@
     
     [cancleButton mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(30);
-        make.right.equalTo(whiteBgView.mas_centerX).offset(-10);
+        make.right.equalTo(_whiteBgView.mas_centerX).offset(-10);
         make.bottom.mas_equalTo(-30);
         make.height.mas_equalTo(40);
     }];
@@ -214,11 +215,11 @@
     copyButton.clipsToBounds = YES;
     copyButton.tag = 11;
     
-    [whiteBgView addSubview:copyButton];
+    [_whiteBgView addSubview:copyButton];
 
     [copyButton mas_makeConstraints:^(MASConstraintMaker *make) {
         make.right.mas_equalTo(-30);
-        make.left.equalTo(whiteBgView.mas_centerX).offset(10);
+        make.left.equalTo(_whiteBgView.mas_centerX).offset(10);
         make.bottom.mas_equalTo(-30);
         make.height.mas_equalTo(40);
     }];
@@ -363,4 +364,42 @@
     [[iToast makeText:NSLocalizedString(@"copy_share_link_suc_tip",nil)] show];
 }
 
+- (void)setIsPortraitType:(BOOL)isPortraitType
+{
+    _isPortraitType = isPortraitType;
+    
+    NSInteger showCellNum = _didSelectListArr.count >=3 ? 3 :_didSelectListArr.count;
+    
+    CGFloat curTableViewCellH = 70;
+    CGFloat curTableViewH = curTableViewCellH *showCellNum;
+    
+    CGFloat curWhiteBgH = 64 + curTableViewH + 194;
+    
+    if(_isPortraitType){
+        _whiteBgView.layer.cornerRadius = 8;
+        
+        [_whiteBgView mas_remakeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(40);
+            make.right.mas_equalTo(-40);
+            make.centerY.equalTo(self.mas_centerY).offset(-40);
+            make.height.mas_equalTo(curWhiteBgH);
+        }];
+        
+
+    }
+    else{
+        
+        _whiteBgView.layer.cornerRadius = 0;
+        [_whiteBgView mas_remakeConstraints:^(MASConstraintMaker *make) {
+            make.width.mas_equalTo(400);
+            make.right.mas_equalTo(0);
+            make.bottom.mas_equalTo(0);
+            make.height.mas_equalTo(SCREEN_H);
+        }];
+        
+    }
+    
+    
+  
+}
 @end