Browse Source

1.链接前显示最后一帧 ---暂定一分钟保存一次

huangxiaodong 1 year ago
parent
commit
814f09e435

+ 2 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/cachesFileManager.h

@@ -19,6 +19,8 @@
 //下载文件 图片 DownLoadFile
 #define kSHPath_DownLoadFlie [cachesFileManager getCreateFilePath:[NSString stringWithFormat:@"%@/DownLoadFlie",CachesPatch]]
 
+//云机最后一帧 路径
+#define kSHPath_cloudPhone_last_image [cachesFileManager getCreateFilePath:[NSString stringWithFormat:@"%@/lastImage/111.png",CachesPatch]]
 
 NS_ASSUME_NONNULL_BEGIN
 

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

@@ -38,6 +38,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (void)checkAllTaskFun;
 - (void)getExtraFilesResponseFun:(NSDictionary *)dataDict;
+- (void)saveLastImageFun;
+- (void)readLastImageFun;
 @end
 
 NS_ASSUME_NONNULL_END

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

@@ -20,6 +20,7 @@
 #import "uploadFileManager.h"
 #import "cloudPhoneExtraFileListModel.h"
 #import "AppDelegate.h"
+#import "cachesFileManager.h"
 
 @implementation PlayerViewController (otherDelegate)
 
@@ -379,4 +380,32 @@
     ksharedAppDelegate.cloudPhoneExtraFileListMod = model;
 }
 
+- (void)saveLastImageFun
+{
+    UIImage *image = [UIImage imageWithCIImage:saveCIImage];
+    if(image){   //执行返回最后一帧
+        //[mPlayerView.showImageView setImage:image];
+        
+        NSString *filePath = kSHPath_cloudPhone_last_image;
+        NSString *folderPath = [kSHPath_cloudPhone_last_image stringByDeletingLastPathComponent];
+        [[NSFileManager defaultManager] removeItemAtPath:folderPath error:nil];
+        [cachesFileManager getCreateFilePath:folderPath];
+        NSData*imageData = UIImagePNGRepresentation(image);
+        
+        BOOL ret = [imageData writeToFile:filePath atomically:NO];
+        
+        if (ret) {
+        }
+    }
+}
+
+- (void)readLastImageFun
+{
+    NSString *filePath = kSHPath_cloudPhone_last_image;
+    UIImage *image = [UIImage imageWithContentsOfFile:filePath];
+    if(image && !saveCIImage){
+        [mPlayerView.showImageView setImage:image];
+    }
+}
+
 @end

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

@@ -901,6 +901,8 @@ ComontAlretViewControllerDelegate>
     {
         [mPlayerView setPoMas_makeWithImageRate:ksharedAppDelegate.couldPhone_W_PHONE/ksharedAppDelegate.couldPhone_H_PHONE isOpenVirtual:YES isUsageMode:NO];
     }
+    
+    [self readLastImageFun];
 }
 
 /**
@@ -2870,6 +2872,9 @@ static int  couneeee = 0;
             NSString *commondStr  = @"{\"type\":\"forwardMsg\",\"data\":\"offline_notification\"}";
             [self send_data:commondStr];
             _offlineNotTime = 0;
+            
+            //保存最后一帧
+            [self saveLastImageFun];
         }
     }