Explorar o código

1.最近文件 视频播放记录

huangxiaodong hai 11 meses
pai
achega
a32d817d2a

+ 4 - 1
创维盒子/双子星云手机/Class/Set/previewFile/videoPlayByAVPlayerViewController.h

@@ -7,10 +7,13 @@
 
 #import "BaseViewController.h"
 #import "NASFilePicModel.h"
+#import "NASFileAndFolderModel.h"
 NS_ASSUME_NONNULL_BEGIN
 
 @interface videoPlayByAVPlayerViewController : BaseViewController
-@property(nonatomic,strong) NASFilePicDataArrModel *VideoDataMode;
+//@property(nonatomic,strong) NASFilePicDataArrModel *VideoDataMode;
+@property(nonatomic,strong) NASFileAndFolderDataModel *VideoDataMode;
+
 @end
 
 NS_ASSUME_NONNULL_END

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

@@ -18,6 +18,7 @@
 #import "ZFPlayerControlView.h"
 #import "ZFPlayerConst.h"
 #import "ZFUtilities.h"
+#import "lastFileManager.h"
 
 
 @interface videoPlayByAVPlayerViewController ()
@@ -77,6 +78,11 @@
         });
         
     };
+    
+    self.playerManager.playerReadyToPlay = ^(id<ZFPlayerMediaPlayback>  _Nonnull asset, NSURL * _Nonnull assetURL) {
+        @zf_strongify(self)
+        [self videoPlayerDidFun];
+    };
 }
 
 - (void)viewDidAppear:(BOOL)animated
@@ -278,4 +284,23 @@
         [self.player rotateToOrientation:UIInterfaceOrientationPortrait animated:YES completion:nil];
     }
 }
+
+#pragma mark 视频可以播放
+- (void)videoPlayerDidFun{
+    
+    NASFileAndFolderDataModel *dataModel = _VideoDataMode;
+    
+    lastFileModel *lastFileMod = [lastFileModel new];
+    lastFileMod.path = dataModel.path;
+    lastFileMod.name = dataModel.name;
+    lastFileMod.time = dataModel.time;
+    lastFileMod.size = dataModel.size;
+    lastFileMod.duration = dataModel.duration;
+    lastFileMod.type = @"jpg";
+    lastFileMod.lastPreTime = [iTools getNowTimeStamp];
+    
+    [[lastFileManager shareManager] saveFileInfoWith:lastFileMod with:dataModel.path];
+
+    
+}
 @end