123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- //
- // PlayerViewController+otherDelegate.m
- // 隐私保护
- //
- // Created by xd h on 2023/10/13.
- //
- #import "PlayerViewController+otherDelegate.h"
- #import "RCCommandHelp.h"
- #import "couldPhoneBaseInfoModel.h"
- #import "cachesFileManager.h"
- #import "couldphoneSysInfoModel.h"
- #import "TvStatusModel.h"
- #import "HWVersionModel.h"
- #import <MJExtension.h>
- #import "HaveNewVersionView.h"
- #import "connectDeviceManager.h"
- #import "downloadManager.h"
- #import "uploadFileManager.h"
- #import "cloudPhoneExtraFileListModel.h"
- #import "AppDelegate.h"
- #import "cachesFileManager.h"
- #import "extraMediaEventModel.h"
- #import "USBInsertPopView.h"
- #import "commandSendCheckModel.h"
- @implementation PlayerViewController (otherDelegate)
- #pragma mark 需要强制重启
- - (void)updateForceStartFun{
-
-
- NSString* curSn = ksharedAppDelegate.DeviceThirdIdMod.data.changeSn;
-
- NSMutableDictionary *paraDict = [NSMutableDictionary dictionary];
- [paraDict setValue:curSn forKey:@"sn"];
- [paraDict setValue:[NSNumber numberWithBool:YES] forKey:@"isForceStart"];
-
- [[netWorkManager shareInstance] CommonPostCallBackCode:updateForceStart Parameters:paraDict success:^(id _Nonnull responseObject) {
-
- SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
- if (model.status == 0) {
-
- }
- else
- {
-
- }
- } failure:^(NSError * _Nonnull error) {
- HLog(@"%@", error);
- }];
- }
- #pragma mark 保存截图到相册
- - (void)screenShotToPhoneFun
- {
- [[webSocketManager shareInstance] screenshotInCloudPhoneFun];
-
- // CIImage *processedImage = saveCIImage;
- // CIContext *context = [CIContext contextWithOptions:nil];
- // CGImageRef cgiimage = [context createCGImage:processedImage fromRect:processedImage.extent];
- // UIImage *image = [UIImage imageWithCGImage:cgiimage];
- // CGImageRelease(cgiimage);
- //
- // if(!image){
- // self->needScreenShotType = YES;
- // return;
- // }
- //
- // [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
- // //写入图片到相册
- // PHAssetChangeRequest *req = [PHAssetChangeRequest creationRequestForAssetFromImage:image];
- //
- // } completionHandler:^(BOOL success, NSError * _Nullable error) {
- // //NSLog(@"success = %d, error = %@", success, error);
- // if (success) {
- // HLog(@"已将截图图片保存至相册");
- //
- // mainBlock(^{
- // [[iToast makeText:@""] show];
- // });
- //
- // } else {
- // self->needScreenShotType = YES;
- // HLog(@"未能将截图图片保存至相册");
- // }
- // }];
- }
- - (void)saveLastImageFun
- {
- if(!saveCIImage){
- return;
- }
-
- //UIImage *image = [UIImage imageWithCIImage:saveCIImage];
-
- CIImage *processedImage = saveCIImage;
- CIContext *context = [CIContext contextWithOptions:nil];
- CGImageRef cgiimage = [context createCGImage:processedImage fromRect:processedImage.extent];
- UIImage *image = [UIImage imageWithCGImage:cgiimage];
- CGImageRelease(cgiimage);
-
- if(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];
- }
- }
- #pragma mark 重置云机编码
- - (void)reSetResolutionFactorFun
- {
- if([webSocketManager shareInstance].isDiDChangePhoneSizeType){
- CGFloat W = ksharedAppDelegate.couldPhone_W_PHONE;
- CGFloat H = ksharedAppDelegate.couldPhone_H_PHONE;
-
- CGFloat maxH = H > W ? H : W;
-
- NSString *dataStr = [RCCommandHelp commandResolutionFactorWithHeight:maxH];
- [self.liveStreamManager rc_sendJsonData:[dataStr UTF8String]];
-
- [webSocketManager shareInstance].isDiDChangePhoneSizeType = NO;
- }
- }
- @end
|