Explorar el Código

1.代码暂存

huangxiaodong hace 1 año
padre
commit
d48bf7d6be

+ 2 - 2
创维盒子/双子星云手机/Class/Set/previewFile/previewImageOrVideoViewController.m

@@ -939,8 +939,8 @@
             
             if(row < timeModel.list.count){
                 NASFilePicDataArrModel *dataModel = timeModel.list[row];
-                videoPlayViewController *vc = [videoPlayViewController new];
-                //videoPlayByAVPlayerViewController *vc = [videoPlayByAVPlayerViewController new];
+                //videoPlayViewController *vc = [videoPlayViewController new];
+                videoPlayByAVPlayerViewController *vc = [videoPlayByAVPlayerViewController new];
                 vc.VideoDataMode = dataModel;
                 [self.navigationController pushViewController:vc animated:YES];
             }

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

@@ -74,6 +74,8 @@
     NSString *filePath = _VideoDataMode.path;
     NSString *urlStr = ksharedAppDelegate.NASFileService;
     NSString *fileUrl = [[NSString alloc] initWithFormat:@"%@getFile?path=%@",urlStr,filePath];
+    
+    fileUrl = @"http://transfertest.armclouding.com:10010/getFile?path=/sdcard/bb.mp4";
     fileUrl = [fileUrl  stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
     
     NSURL * sourceMovieURL= [NSURL URLWithString:fileUrl];

+ 2 - 1
创维盒子/双子星云手机/Class/Set/previewFile/videoPlayViewController.m

@@ -119,7 +119,8 @@
     NSString *fileUrl = [[NSString alloc] initWithFormat:@"%@getFile?path=%@",urlStr,filePath];
     fileUrl = [fileUrl  stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
     
-    fileUrl = @"http://transfer.armclouding.com:10010/getFile?path=/storage/006A-A69C/bf0308/Screenrecording_20231101_163026.mp4";
+    //fileUrl = @"http://transfer.armclouding.com:10010/getFile?path=/storage/006A-A69C/bf0308/Screenrecording_20231101_163026.mp4";
+    fileUrl = @"http://transfertest.armclouding.com:10010/getFile?path=/sdcard/bb.mp4";
     NSURL * sourceMovieURL= [NSURL URLWithString:fileUrl];
     
     // 根据URL创建请求

+ 1 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/receiveView/boxDownloadFileRecordCell.m

@@ -306,7 +306,7 @@
     
     _fileNamelabel.text = curShareFileDataModel.fileName;
     
-    
+    //HLog(@"1111111: %@ %@",curShareFileDataModel.fileUrl,curShareFileDataModel.fileSize);
 
 //    //进度设置
 //    CGRect frame = CGRectMake(0, 0, SCREEN_W - 15*2 - 34*2, 2);

+ 42 - 2
创维盒子/双子星云手机/Class/Set/uploadFile/receiveView/receiveView.m

@@ -12,6 +12,7 @@
 #import "boxSaveFileManager.h"
 #import "downStatusModel.h"
 #import "boxDownloadFileManager.h"
+#import "AFHTTPSessionManager.h"
 
 @interface receiveView ()
 {
@@ -139,8 +140,47 @@
 #pragma mark 获取本地数据库数据
 - (void)getAllDataFun{
     
-    [self getBoxDownLoadDataFun];
-    [self getBoxSaveDataFun];
+//    [self getBoxDownLoadDataFun];
+//    [self getBoxSaveDataFun];
+    
+    NSString *urlstr = @"https://media.w3.org/2010/05/sintel/trailer.mp4";
+    NSString *url2 = @"http://transfertest.armclouding.com:11010/getFile?path=/mnt/media_rw/B80050B2005078F8/电影/IMG_0914.MP4";
+    
+//    [[netWorkManager shareInstance] cloudPhoneDownloadCallBackCode:url success:^(id  _Nonnull responseObject) {
+//        
+//    } failure:^(NSError * _Nonnull error) {
+//        
+//    }];
+    
+    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+    NSString *documentDir = [paths lastObject];
+    
+    
+    NSString* encodedUrl = [url2 stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+    NSURL *url = [NSURL URLWithString:encodedUrl];
+    
+    NSURLRequest *request = [NSURLRequest requestWithURL:url];
+    NSURLSessionDownloadTask *task = [[AFHTTPSessionManager manager] downloadTaskWithRequest:request progress:^(NSProgress * _Nonnull downloadProgress) {
+          NSLog(@"%@", [NSString stringWithFormat:@"当前下载进度:%.2f%%",100.0 * downloadProgress.completedUnitCount / downloadProgress.totalUnitCount]);
+        } destination:^NSURL * _Nonnull(NSURL * _Nonnull targetPath, NSURLResponse * _Nonnull response) {
+            NSLog(@"临时文件路径: %@", targetPath);
+            
+            NSString *downloadPath = [[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent: @"Download"];
+            //打开文件管理器
+            NSFileManager *fileManager = [NSFileManager defaultManager];
+            //创建Download目录
+            [fileManager createDirectoryAtPath:downloadPath withIntermediateDirectories:YES attributes:nil error:nil];
+            //拼接文件路径
+            NSString *filePath = [downloadPath stringByAppendingPathComponent:response.suggestedFilename];
+            
+            NSURL *path = [NSURL fileURLWithPath:filePath];
+            [path URLByAppendingPathComponent:response.suggestedFilename];
+            return path;
+        } completionHandler:^(NSURLResponse * _Nonnull response, NSURL * _Nullable filePath, NSError * _Nullable error) {
+            NSLog(@"本地存储路径: %@", filePath);
+        }];
+    
+    [task resume];
 }
 
 #pragma mark 读取保存到盒子的数据库

+ 4 - 0
创维盒子/双子星云手机/CloudPlayer/PlayerViewController+otherDelegate.mm

@@ -564,6 +564,10 @@
 
 - (void)saveLastImageFun
 {
+    if(!saveCIImage){
+        return;
+    }
+    
     UIImage *image = [UIImage imageWithCIImage:saveCIImage];
     if(image){   //执行返回最后一帧
         //[mPlayerView.showImageView setImage:image];