Procházet zdrojové kódy

1.音频 视频播放失败 提示
2.文件保存到相册失败就保存到文件app
3.下载暂停的不重新启动

huangxiaodong před 1 rokem
rodič
revize
395086071f

+ 4 - 4
创维盒子/双子星云手机.xcodeproj/project.pbxproj

@@ -4943,7 +4943,7 @@
 				CODE_SIGN_ENTITLEMENTS = "计算器.entitlements";
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 2;
 				DEVELOPMENT_TEAM = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -5026,7 +5026,7 @@
 				CODE_SIGN_ENTITLEMENTS = "计算器.entitlements";
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 2;
 				DEVELOPMENT_TEAM = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -5224,7 +5224,7 @@
 				CODE_SIGN_IDENTITY = "Apple Development";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Manual;
-				CURRENT_PROJECT_VERSION = 17;
+				CURRENT_PROJECT_VERSION = 21;
 				DEVELOPMENT_TEAM = "";
 				"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -5305,7 +5305,7 @@
 				CODE_SIGN_IDENTITY = "Apple Development";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Manual;
-				CURRENT_PROJECT_VERSION = 17;
+				CURRENT_PROJECT_VERSION = 21;
 				DEVELOPMENT_TEAM = "";
 				"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (

+ 7 - 0
创维盒子/双子星云手机.xcodeproj/xcshareddata/xcschemes/计算器.xcscheme

@@ -50,6 +50,13 @@
             ReferencedContainer = "container:双子星云手机.xcodeproj">
          </BuildableReference>
       </BuildableProductRunnable>
+      <EnvironmentVariables>
+         <EnvironmentVariable
+            key = "IDEPreferLogStreaming"
+            value = "YES"
+            isEnabled = "YES">
+         </EnvironmentVariable>
+      </EnvironmentVariables>
    </LaunchAction>
    <ProfileAction
       buildConfiguration = "Release"

+ 7 - 0
创维盒子/双子星云手机.xcodeproj/xcshareddata/xcschemes/隐私保护.xcscheme

@@ -70,6 +70,13 @@
             ReferencedContainer = "container:&#x53cc;&#x5b50;&#x661f;&#x4e91;&#x624b;&#x673a;.xcodeproj">
          </BuildableReference>
       </BuildableProductRunnable>
+      <EnvironmentVariables>
+         <EnvironmentVariable
+            key = "IDEPreferLogStreaming"
+            value = "YES"
+            isEnabled = "YES">
+         </EnvironmentVariable>
+      </EnvironmentVariables>
    </LaunchAction>
    <ProfileAction
       buildConfiguration = "Release"

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

@@ -221,6 +221,9 @@
         //fileUrl = @"http://transfertest.armclouding.com:21025/getFiles/L3N0b3JhZ2UvZW11bGF0ZWQvMC9NdXNpYy9vYmoubXAz";
         //fileUrl = @"http://transfertest.armclouding.com:21025/getFiles/L3NkY2FyZC9NdXNpYy9vYmoubXAz";
         
+        //fileUrl = @"http://testprivacy.phone.armclouding.com:1801/h5/25883214_yinyue.wma";//不支持此媒体的格式
+        //fileUrl = @"http://testprivacy.phone.armclouding.com:1801/h5/ffgfge.m4a";//可以播放
+        //fileUrl = @"http://testprivacy.phone.armclouding.com:1801/h5/j14_yinyue.ogg";//不支持此媒体的格式
         
 //        fileUrl  = [fileUrl stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
         
@@ -294,7 +297,9 @@
 //        return;
         [[DFPlayer sharedPlayer] df_playWithAudioId:player.currentAudioModel.audioId];
     }else{
-        NSLog(@"状态码:%lu",(unsigned long)statusCode);
+        HLog(@"状态码:%lu",(unsigned long)statusCode);
+        [[iToast makeText:NSLocalizedString(@"play_video_fail_tip",nil)] show];
+        [[DFPlayer sharedPlayer] df_pause];
     }
 }
 

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

@@ -68,6 +68,15 @@
     
 //    self.player.orientationObserver.supportInterfaceOrientation = ZFInterfaceOrientationMaskLandscape;
 //    [self.player rotateToOrientation:UIInterfaceOrientationLandscapeRight animated:NO completion:nil];
+    
+    self.playerManager.playerPlayFailed = ^(id<ZFPlayerMediaPlayback>  _Nonnull asset, id  _Nonnull error) {
+        mainBlock(^{
+            @zf_strongify(self)
+            self.controlView.failBtn.hidden = YES;
+            [[iToast makeText:NSLocalizedString(@"play_video_fail_tip",nil)] show];
+        });
+        
+    };
 }
 
 - (void)viewDidAppear:(BOOL)animated
@@ -79,14 +88,38 @@
     if(!self.playerManager.assetURL){
         NSString *filePath = _VideoDataMode.path;
         NSString *urlStr = ksharedAppDelegate.NASFileByBoxService;
-        //NSString *urlStr = ksharedAppDelegate.NASFileByBoxService;
         NSString *fileUrl = [[NSString alloc] initWithFormat:@"%@getFile?path=%@",urlStr,filePath];
+        
+//        NSString *string = filePath;
+//        NSString *filePathBase64 = [iTools base64UrlEncoder:string];
+//        NSString *fileUrl = [[NSString alloc] initWithFormat:@"%@getFiles/%@",urlStr,filePathBase64];
+        
         NSString *showUrl = [[NSString alloc] initWithFormat:@"%@getThumbnail?path=%@",urlStr,filePath];
-        HLog(@"%@",fileUrl);
+        HLog(@"video url:%@",fileUrl);
         //fileUrl = @"http://transfertest.armclouding.com:10010/getFile?path=/sdcard/bb.mp4";
-        //fileUrl = @"http://m10.music.126.net/20240527160012/d3f165dc686ac01afd4497400b2c2c58/ymusic/5353/0f0f/0358/d99739615f8e5153d77042092f07fd77.mp3";
+        
+        //fileUrl = @"http://testprivacy.phone.armclouding.com:1801/h5/123.mp4";//可以播放
+        //fileUrl = @"http://testprivacy.phone.armclouding.com:1801/h5/movTest.mov";//可以播放
+        //fileUrl = @"http://testprivacy.phone.armclouding.com:1801/h5/yinwei4.mp4";//可以播放
+        //fileUrl = @"http://testprivacy.phone.armclouding.com:1801/h5/fuchouzhe2.mp4";//可以播放
+        //fileUrl = @"http://testprivacy.phone.armclouding.com:1801/h5/fuchouzhe.m4v";//可以播放
+        
+        //fileUrl = @"http://testprivacy.phone.armclouding.com:1801/h5/qisheng.ts";//加载失败
+        //fileUrl = @"http://testprivacy.phone.armclouding.com:1801/h5/wmvTest.wmv";//加载失败
+        //fileUrl = @"http://testprivacy.phone.armclouding.com:1801/h5/复仇者联盟.3gp";//加载失败
+        //fileUrl = @"http://testprivacy.phone.armclouding.com:1801/h5/fuchouzhe3.mpeg";//加载失败
+        //fileUrl = @"http://testprivacy.phone.armclouding.com:1801/h5/fuchouzhe4.mpg";//加载失败
+        //fileUrl = @"http://testprivacy.phone.armclouding.com:1801/h5/fuchouzhe5.rm";//加载失败
+        //fileUrl = @"http://testprivacy.phone.armclouding.com:1801/h5/fuchouzhe5.vob";//加载失败
+        //fileUrl = @"http://testprivacy.phone.armclouding.com:1801/h5/gamemkv.mkv";//加载失败
+        //fileUrl = @"http://testprivacy.phone.armclouding.com:1801/h5/j14_yinyue.ogg";//
+        
+        //fileUrl = @"http://file.phone.androidscloud.com:8210/document/newFile/download/1/ikIm5C0KjKNvusTF6tIH/LowLevelMultipartUpload_45050149837826456388";//可以播放
+        //fileUrl = @"http://testprivacy.phone.armclouding.com:1801/h5/我的视频.mp4";
+        
         fileUrl = [fileUrl  stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
         showUrl = [showUrl  stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+        //HLog(@"video url:%@",fileUrl);
         
         NSURL * sourceMovieURL= [NSURL URLWithString:fileUrl];
         

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

@@ -648,8 +648,9 @@
     if (item.downloadStatus != YCDownloadStatusDownloading) {
         return;
     }
-    
-    [self downloadItem:item downloadedSize:item.downloadedSize totalSize:item.fileSize];
+    mainBlock(^{
+        [self downloadItem:item downloadedSize:item.downloadedSize totalSize:item.fileSize];
+    });
 }
 
 #pragma mark 下载代理

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

@@ -782,7 +782,8 @@
     NSArray *allDownItemArr = [YCDownloadManager downloadList];
     for (YCDownloadItem *item in allDownItemArr) {
         if (item.downloadStatus != YCDownloadStatusFailed
-            && item.downloadStatus != YCDownloadStatusFinished) {
+            && item.downloadStatus != YCDownloadStatusFinished
+            && item.downloadStatus != YCDownloadStatusPaused) {
             //[YCDownloadManager startDownloadWithItem:item];
             [YCDownloadManager resumeDownloadWithItem:item];
         }

+ 20 - 8
创维盒子/双子星云手机/CloudPlayer/PlayerViewController+downloadNasFile.m

@@ -27,17 +27,26 @@
     NSArray *nameArr= [urlString componentsSeparatedByString:@"."];
     NSString * pathStr= item.savePath;
     
-    
+    NSString *addFileName = @"";
     if (![item.downloadURL containsString:@".quicktime"]
-        && [pathStr containsString:@".quicktime"]) {
+        && [pathStr containsString:@".quicktime"])
+    {
+        addFileName = @".quicktime";
+    }
+    else if (![item.downloadURL containsString:@".octet-stream"]
+             && [pathStr containsString:@".octet-stream"])
+     {
+         addFileName = @".octet-stream";
+     }
+    
+    if(addFileName.length >0)
+    {
         //文件名被添加了 .quicktime
         
         NSError *error = nil;
         NSFileManager *fileManager = [NSFileManager defaultManager];
-          
         // 新文件名路径
-        NSString *newFilePath = [pathStr stringByReplacingOccurrencesOfString:@".quicktime" withString:@""];
-          
+        NSString *newFilePath = [pathStr stringByReplacingOccurrencesOfString:addFileName withString:@""];
         // 尝试移动(即重命名)文件
         BOOL success = [fileManager moveItemAtPath:pathStr toPath:newFilePath error:&error];
           
@@ -49,7 +58,6 @@
         }
     }
     
-    
     HLog(@"%@,",pathStr);
     if (nameArr.count >= 2) {
         NSString *lastName = nameArr.lastObject;
@@ -94,6 +102,9 @@
              
          } else {
              HLog(@"未能将图片保存至相册");
+             mainBlock(^{
+                 [self loadOtherDataFinishedBy:fullPath];
+             });
          }
          
     }];
@@ -118,10 +129,11 @@
             }
         } else {
             HLog(@"未能将视频保存至相册");
+            mainBlock(^{
+                [self loadOtherDataFinishedBy:fullPath];
+            });
         }
         
-        
-       
     }];
 }
 

+ 1 - 0
创维盒子/双子星云手机/Vendor/ZFPlayer/Classes/AVPlayer/ZFAVPlayerManager.m

@@ -396,6 +396,7 @@ static NSString *const kPresentationSize         = @"presentationSize";
                 self.playState = ZFPlayerPlayStatePlayFailed;
                 self->_isPlaying = NO;
                 NSError *error = self.player.currentItem.error;
+                NSLog(@"%@",error);
                 if (self.playerPlayFailed) self.playerPlayFailed(self, error);
             }
         } else if ([keyPath isEqualToString:kPlaybackBufferEmpty]) {

+ 2 - 1
创维盒子/双子星云手机/zh-Hans.lproj/Localizable.strings

@@ -360,7 +360,7 @@
 "File_backups_Record_tip_Suspend"   = "已暂停";
 "File_backups_set_default_path_tip"   = "请完成备份操作后再更改路径";
 "File_download_Path_default"   = "下载路径  相册";
-"File_download_Path_default_done"   = "下载到:相册";
+"File_download_Path_default_done"   = "下载到:相册或文件";
 "File_download_file_no_data"   = "暂无文件下载";
 "File_upload_Record_did_download"   = "已下载";
 "File_upload_Record_downloading"   = "下载中";
@@ -526,3 +526,4 @@
 "get_sn_msg_202_content" = "检查盒子是否通电通网,若还不能解决,请提供SN联系客服处理!";
 "File_download_Path_other_done"   = "下载到:文件";
 "File_download_error_404"   = "资源已丢失";
+"play_video_fail_tip"   = "不支持该类型文件预览";