|
@@ -6,6 +6,11 @@
|
|
|
//
|
|
|
|
|
|
#import "videoPlayByAVPlayerViewController.h"
|
|
|
+#import "previewVideoPortraitTopMoreView.h"
|
|
|
+#import "editShareView.h"
|
|
|
+#import "uploadFileRecordViewController.h"
|
|
|
+#import "previewVideoLandscapeTopMoreView.h"
|
|
|
+#import "UIInterface+HXRotation.h"
|
|
|
|
|
|
//#import <ZFPlayer/ZFAVPlayerManager.h>
|
|
|
//#import <ZFPlayer/ZFIJKPlayerManager.h>
|
|
@@ -28,8 +33,16 @@
|
|
|
|
|
|
@property (nonatomic, strong)UIView *bgView;
|
|
|
@property (nonatomic, strong)UIButton *portraitBackBtn;
|
|
|
+
|
|
|
@property (nonatomic, strong)UIButton *portraitToLandScapeBtn;
|
|
|
+@property (nonatomic, strong)UIButton *portraitTopMoreBtn;
|
|
|
+@property (nonatomic, strong)previewVideoPortraitTopMoreView *previewVideoPortraitTopMoreV;
|
|
|
+
|
|
|
+
|
|
|
@property (nonatomic, strong)UIButton *landScapeToPortraitBtn;
|
|
|
+@property (nonatomic, strong)UIButton *landScapeTopMoreBtn;
|
|
|
+@property (nonatomic, strong)previewVideoLandscapeTopMoreView *previewVideoLandscapeTopMoreV;
|
|
|
+
|
|
|
@end
|
|
|
|
|
|
@implementation videoPlayByAVPlayerViewController
|
|
@@ -179,7 +192,10 @@
|
|
|
_controlView.portraitControlView.fullScreenBtn.hidden = YES;
|
|
|
//totalTimeLabel slider
|
|
|
|
|
|
- [_controlView.portraitControlView.topToolView addSubview:self.portraitBackBtn];
|
|
|
+ //隐藏 缓存条
|
|
|
+// _controlView.bottomPgrogress.hidden = YES;
|
|
|
+// _controlView.fastProgressView.hidden = YES;
|
|
|
+
|
|
|
|
|
|
UILabel *titleLab = _controlView.portraitControlView.titleLabel;
|
|
|
titleLab.textAlignment = NSTextAlignmentCenter;
|
|
@@ -203,14 +219,24 @@
|
|
|
make.top.mas_equalTo(titleLabFrame.origin.y);
|
|
|
}];
|
|
|
|
|
|
+ [_controlView.portraitControlView.topToolView addSubview:self.portraitTopMoreBtn];
|
|
|
+ [self.portraitTopMoreBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.right.mas_equalTo(-15);
|
|
|
+ make.width.mas_equalTo(28);
|
|
|
+ make.height.mas_equalTo(28);
|
|
|
+ make.top.mas_equalTo(titleLabFrame.origin.y);
|
|
|
+ }];
|
|
|
+
|
|
|
[_controlView.portraitControlView.topToolView addSubview:self.portraitToLandScapeBtn];
|
|
|
[self.portraitToLandScapeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.right.mas_equalTo(-15);
|
|
|
+ make.right.equalTo(self.portraitTopMoreBtn.mas_left).offset(-10);
|
|
|
make.width.mas_equalTo(28);
|
|
|
make.height.mas_equalTo(28);
|
|
|
make.top.mas_equalTo(titleLabFrame.origin.y);
|
|
|
}];
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+ /*************************************************************************/
|
|
|
|
|
|
//横屏
|
|
|
//_controlView.landScapeControlView.fullScreenBtn.hidden = YES;
|
|
@@ -219,21 +245,34 @@
|
|
|
titleLabInlandScape.textAlignment = NSTextAlignmentCenter;
|
|
|
titleLabInlandScape.lineBreakMode = NSLineBreakByTruncatingMiddle;
|
|
|
CGRect titleLabFrameInlandScape = titleLabInlandScape.frame;
|
|
|
+ //titleLabInlandScape.backgroundColor = [UIColor greenColor];
|
|
|
|
|
|
[titleLabInlandScape mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.left.mas_equalTo(45);
|
|
|
- make.right.mas_equalTo(-45);
|
|
|
- make.height.mas_equalTo(titleLabFrameInlandScape.size.height);
|
|
|
- make.top.mas_equalTo(titleLabFrameInlandScape.origin.y);
|
|
|
+ make.left.equalTo(_controlView.landScapeControlView.backBtn.mas_right).offset(10);
|
|
|
+ //make.right.mas_equalTo(-45);
|
|
|
+ make.right.mas_equalTo(-25 -90);
|
|
|
+ //make.height.mas_equalTo(titleLabFrameInlandScape.size.height);
|
|
|
+ make.top.equalTo(_controlView.landScapeControlView.backBtn.mas_top).offset(0);
|
|
|
+ make.bottom.equalTo(_controlView.landScapeControlView.backBtn.mas_bottom).offset(0);
|
|
|
}];
|
|
|
|
|
|
+ [_controlView.landScapeControlView.topToolView addSubview:self.landScapeTopMoreBtn];
|
|
|
+ [self.landScapeTopMoreBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.right.mas_equalTo(-15 - 20);
|
|
|
+ make.width.mas_equalTo(28);
|
|
|
+ make.height.mas_equalTo(28);
|
|
|
+ //make.top.mas_equalTo(titleLabFrame.origin.y);
|
|
|
+ make.centerY.equalTo(_controlView.landScapeControlView.backBtn.mas_centerY).offset(0);
|
|
|
+ }];
|
|
|
|
|
|
[_controlView.landScapeControlView.topToolView addSubview:self.landScapeToPortraitBtn];
|
|
|
[self.landScapeToPortraitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.right.mas_equalTo(-15);
|
|
|
+ //make.right.mas_equalTo(-15);
|
|
|
+ make.right.equalTo(self.landScapeTopMoreBtn.mas_left).offset(-20);
|
|
|
make.width.mas_equalTo(28);
|
|
|
make.height.mas_equalTo(28);
|
|
|
- make.top.mas_equalTo(titleLabFrame.origin.y);
|
|
|
+ //make.top.mas_equalTo(titleLabFrame.origin.y);
|
|
|
+ make.centerY.equalTo(_controlView.landScapeControlView.backBtn.mas_centerY).offset(0);
|
|
|
}];
|
|
|
}
|
|
|
|
|
@@ -256,6 +295,16 @@
|
|
|
return _portraitToLandScapeBtn;
|
|
|
}
|
|
|
|
|
|
+- (UIButton*)portraitTopMoreBtn{
|
|
|
+ if (!_portraitTopMoreBtn) {
|
|
|
+ _portraitTopMoreBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
+ [_portraitTopMoreBtn setImage:[UIImage imageNamed:@"nas_preview_more_white"] forState:UIControlStateNormal];
|
|
|
+ [_portraitTopMoreBtn addTarget:self action:@selector(didClickMoreButFun:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ //_portraitTopMoreBtn.backgroundColor = [UIColor greenColor];
|
|
|
+ }
|
|
|
+ return _portraitTopMoreBtn;
|
|
|
+}
|
|
|
+
|
|
|
- (UIButton *)landScapeToPortraitBtn {
|
|
|
if (!_landScapeToPortraitBtn) {
|
|
|
_landScapeToPortraitBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
@@ -266,6 +315,16 @@
|
|
|
return _landScapeToPortraitBtn;
|
|
|
}
|
|
|
|
|
|
+- (UIButton*)landScapeTopMoreBtn{
|
|
|
+ if (!_landScapeTopMoreBtn) {
|
|
|
+ _landScapeTopMoreBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
+ [_landScapeTopMoreBtn setImage:[UIImage imageNamed:@"nas_preview_more_white"] forState:UIControlStateNormal];
|
|
|
+ [_landScapeTopMoreBtn addTarget:self action:@selector(didClickMoreButFun:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ //_portraitTopMoreBtn.backgroundColor = [UIColor greenColor];
|
|
|
+ }
|
|
|
+ return _landScapeTopMoreBtn;
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark 点击返回键
|
|
|
- (void)didClickBackBtnFun
|
|
|
{
|
|
@@ -285,7 +344,65 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-#pragma mark 视频可以播放
|
|
|
+#pragma mark 点击顶部更多 获取 分享 下载 更多
|
|
|
+- (void)didClickMoreButFun:(UIButton*)but
|
|
|
+{
|
|
|
+ if(but ==_portraitTopMoreBtn){
|
|
|
+ _previewVideoPortraitTopMoreV = [[previewVideoPortraitTopMoreView alloc] init];
|
|
|
+ [self.view addSubview:_previewVideoPortraitTopMoreV];
|
|
|
+
|
|
|
+ [_previewVideoPortraitTopMoreV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(0);
|
|
|
+ make.right.mas_equalTo(0);
|
|
|
+ make.bottom.mas_equalTo(0);
|
|
|
+ make.top.mas_equalTo(0);
|
|
|
+ }];
|
|
|
+
|
|
|
+ KWeakSelf
|
|
|
+ _previewVideoPortraitTopMoreV.didClickButtonFun = ^(NSInteger tag) {
|
|
|
+ if(tag == 10){
|
|
|
+ [weakSelf gotoShareViewFun:NO];
|
|
|
+ }
|
|
|
+ else if (tag == 11){
|
|
|
+ [weakSelf gotoDownLoadFileFun:NO];
|
|
|
+ }
|
|
|
+ else if (tag == 12){
|
|
|
+ [weakSelf delFileListFun];
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+ else{
|
|
|
+
|
|
|
+ _previewVideoLandscapeTopMoreV = [[previewVideoLandscapeTopMoreView alloc] init];
|
|
|
+ [_controlView.landScapeControlView addSubview:_previewVideoLandscapeTopMoreV];
|
|
|
+
|
|
|
+ [_previewVideoLandscapeTopMoreV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(0);
|
|
|
+ make.right.mas_equalTo(0);
|
|
|
+ make.bottom.mas_equalTo(0);
|
|
|
+ make.top.mas_equalTo(0);
|
|
|
+ }];
|
|
|
+
|
|
|
+ KWeakSelf
|
|
|
+ _previewVideoLandscapeTopMoreV.didClickButtonFun = ^(NSInteger tag) {
|
|
|
+ if(tag == 10){
|
|
|
+ [weakSelf gotoShareViewFun:YES];
|
|
|
+ }
|
|
|
+ else if (tag == 11){
|
|
|
+ [weakSelf gotoDownLoadFileFun:YES];
|
|
|
+ }
|
|
|
+ else if (tag == 12){
|
|
|
+ [weakSelf delFileListFun];
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+#pragma mark 视频可以播放 加入最近文件
|
|
|
- (void)videoPlayerDidFun{
|
|
|
|
|
|
NASFileAndFolderDataModel *dataModel = _VideoDataMode;
|
|
@@ -303,4 +420,120 @@
|
|
|
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+#pragma mark 用户点击分享
|
|
|
+- (void)gotoShareViewFun:(BOOL)isLandscapeType
|
|
|
+{
|
|
|
+ if(!_VideoDataMode){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ editShareView *editShareV = [[editShareView alloc] init];
|
|
|
+ editShareV.didSelectListArr = [NSMutableArray arrayWithArray:@[_VideoDataMode]];
|
|
|
+ editShareV.shareFileType = @"3";
|
|
|
+ if(isLandscapeType){
|
|
|
+ [_controlView.landScapeControlView addSubview:editShareV];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ [self.view addSubview:editShareV];
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ [editShareV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(0);
|
|
|
+ make.right.mas_equalTo(0);
|
|
|
+ make.bottom.mas_equalTo(0);
|
|
|
+ make.top.mas_equalTo(0);
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark 删除图片
|
|
|
+- (void)showDeleteAlearViewFun
|
|
|
+{
|
|
|
+ NSString *titleStr = NSLocalizedString(@"delete_file_title_msg",nil);
|
|
|
+ NSString *tipStr = NSLocalizedString(@"delete_file_tip_msg",nil);
|
|
|
+
|
|
|
+ KWeakSelf
|
|
|
+ ComontAlretViewController *curAlretVC= [[ComontAlretViewController alloc] initWithTiTle:titleStr
|
|
|
+ msg:tipStr
|
|
|
+ imageStr:nil
|
|
|
+ cancelTitle:NSLocalizedString(@"other_cancel",nil)
|
|
|
+ okTitle:NSLocalizedString(@"other_confirm",nil) isOkBtnHighlight:YES
|
|
|
+ didClickOk:^{
|
|
|
+
|
|
|
+ [weakSelf delFileListFun];
|
|
|
+ } didClickCancel:^{
|
|
|
+
|
|
|
+ }];
|
|
|
+
|
|
|
+ curAlretVC.modalPresentationStyle = UIModalPresentationCustom;
|
|
|
+
|
|
|
+ [self presentViewController:curAlretVC animated:YES completion:^{
|
|
|
+ curAlretVC.view.superview.backgroundColor = [UIColor clearColor];
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+#pragma mark 删除文件数据
|
|
|
+- (void)delFileListFun
|
|
|
+{
|
|
|
+ NSMutableDictionary*paraDict = [NSMutableDictionary new];
|
|
|
+
|
|
|
+ if(_VideoDataMode){
|
|
|
+ NSArray *pathArr = @[_VideoDataMode.path];
|
|
|
+ [paraDict setValue:pathArr forKey:@"path"];
|
|
|
+ }
|
|
|
+
|
|
|
+ [self showNewIndicatorWithCanBack:YES canTouch:NO];
|
|
|
+
|
|
|
+ //NSString*code = [[NSString alloc] initWithFormat:@"delFile?path=%@",paraDict[@"path"]]; //delFile?path=[/storage/emulated/0/Download/IMG_6464.HEIC]
|
|
|
+ KWeakSelf //@"delFile"
|
|
|
+ [[netWorkManager shareInstance] cloudPhonePostCallBackCode:@"delFile" Parameters:paraDict success:^(id _Nonnull responseObject) {
|
|
|
+ [weakSelf removeNewIndicator];
|
|
|
+ SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
|
|
|
+ if(model && model.status == 0){
|
|
|
+ [[iToast makeText:NSLocalizedString(@"delete_file_suc_msg",nil)] show];
|
|
|
+
|
|
|
+ if(weakSelf.didNeedToRegetDataFun){
|
|
|
+ weakSelf.didNeedToRegetDataFun();
|
|
|
+ }
|
|
|
+
|
|
|
+ [weakSelf.navigationController popViewControllerAnimated:YES];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+
|
|
|
+ }
|
|
|
+ } failure:^(NSError * _Nonnull error) {
|
|
|
+ [weakSelf removeNewIndicator];
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark 去下载文件
|
|
|
+- (void)gotoDownLoadFileFun:(BOOL)isLandscapeType
|
|
|
+{
|
|
|
+ if(_VideoDataMode){
|
|
|
+
|
|
|
+ if(isLandscapeType){
|
|
|
+ //切换到竖屏
|
|
|
+ //[self hx_rotateToInterfaceOrientation:UIInterfaceOrientationPortrait];
|
|
|
+ [self.player rotateToOrientation:UIInterfaceOrientationPortrait animated:YES completion:nil];
|
|
|
+ }
|
|
|
+
|
|
|
+ couldPhoneFileModel* fileModel = [couldPhoneFileModel new];
|
|
|
+ fileModel.fileType = @"video";
|
|
|
+ fileModel.path = _VideoDataMode.path;
|
|
|
+ fileModel.name = _VideoDataMode.name;
|
|
|
+ fileModel.length = _VideoDataMode.size;
|
|
|
+
|
|
|
+ NSMutableArray *arr = [NSMutableArray new];
|
|
|
+ [arr addObject:fileModel];
|
|
|
+
|
|
|
+ uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
|
|
|
+ [self.navigationController pushViewController:vc animated:YES];
|
|
|
+ vc.isDownloadingType = YES;
|
|
|
+ [vc gotoDownloadFile:arr];
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
@end
|