HXPhotoPicker icon indicating copy to clipboard operation
HXPhotoPicker copied to clipboard

如果在录制视频页面,选择相册里的视频,播放以后会造成录制视频页面的相机无法采集画面

Open jozdee opened this issue 3 years ago • 6 comments

版本号 1.HXPhotoPicker版本号:最新 2.手机系统版本号:iOS12 3.手机型号:iPhonex

对需要采集声音,录音的界面影响也很大,选择视频以后,回到录音页面录音页面会闪退,这个框架是否可以开放一些录制相关的操作,换其他相册选取测试没有这个问题呀,大佬有时间帮忙看看

jozdee avatar Dec 29 '20 09:12 jozdee

可以在七牛的demo里面复现,在七牛录制视频页面使用你这个框架去选择视频,然后去编辑,会造成相机页面无法采集https://github.com/pili-engineering/PLShortVideoKit

jozdee avatar Dec 29 '20 09:12 jozdee

我看看

SilenceLove avatar Dec 29 '20 09:12 SilenceLove

我看看

使用七牛PLShortVideoKitDemo 快速替换这个方法,去到编辑页面,再回到录制页面能复现,七牛自带的没有这个问题 // 导入视频

  • (void)importMovieButtonEvent:(id)sender { // PhotoAlbumViewController *photoAlbumViewController = [[PhotoAlbumViewController alloc] init]; // photoAlbumViewController.modalPresentationStyle = UIModalPresentationFullScreen; // [self presentViewController:photoAlbumViewController animated:YES completion:nil]; __weak typeof(self) weakSelf = self; HXPhotoManager *photoPickerIsSingleSelectedManager = [[HXPhotoManager alloc] initWithType:HXPhotoManagerSelectedTypeVideo]; photoPickerIsSingleSelectedManager.configuration.type = HXConfigurationTypeWXChat; photoPickerIsSingleSelectedManager.configuration.singleSelected = YES; photoPickerIsSingleSelectedManager.configuration.lookGifPhoto = YES; photoPickerIsSingleSelectedManager.configuration.singleJumpEdit = YES; photoPickerIsSingleSelectedManager.configuration.photoEditConfigur.onlyCliping = YES; photoPickerIsSingleSelectedManager.configuration.saveSystemAblum = YES; photoPickerIsSingleSelectedManager.configuration.cameraCanLocation = NO; photoPickerIsSingleSelectedManager.configuration.openCamera = NO; photoPickerIsSingleSelectedManager.configuration.cameraCellShowPreview = NO; photoPickerIsSingleSelectedManager.configuration.customCameraType = HXPhotoCustomCameraTypeUnused;

    [self hx_presentSelectPhotoControllerWithManager:photoPickerIsSingleSelectedManager didDone:^(NSArray<HXPhotoModel *> * _Nullable allList, NSArray<HXPhotoModel *> * _Nullable photoList, NSArray<HXPhotoModel *> * _Nullable videoList, BOOL isOriginal, UIViewController * _Nullable viewController, HXPhotoManager * _Nullable manager) {

      HXPhotoModel *videoModel = videoList.firstObject;
      if (videoModel.asset == nil) {
    
      } else {
          // HXPhotoModel也提供直接导出视频地址的方法
          // presetName 导出视频的质量,自己根据需求设置
          [videoModel exportVideoWithPresetName:AVAssetExportPresetMediumQuality startRequestICloud:nil iCloudProgressHandler:nil exportProgressHandler:nil success:^(NSURL * _Nullable videoURL, HXPhotoModel * _Nullable model) {
              // 导出完成, videoURL
              [weakSelf gotoEditorController:videoURL];
          } failed:^(NSDictionary * _Nullable info, HXPhotoModel * _Nullable model) {
    
          }];
      }
    

    } cancel:^(UIViewController * _Nullable viewController, HXPhotoManager * _Nullable manager) { [weakSelf dismissViewControllerAnimated:YES completion:nil]; }];

}

  • (void)gotoEditorController:(NSURL *)url {

    AVAsset *asset = [AVAsset assetWithURL:url]; [asset loadValuesAsynchronouslyForKeys:@[@"duration", @"tracks"] completionHandler:^{ dispatch_async(dispatch_get_main_queue(), ^{ NSMutableDictionary *outputSettings = [[NSMutableDictionary alloc] init]; // 待编辑的原始视频素材 NSMutableDictionary *plsMovieSettings = [[NSMutableDictionary alloc] init]; plsMovieSettings[PLSURLKey] = url; plsMovieSettings[PLSAssetKey] = [AVAsset assetWithURL:url]; plsMovieSettings[PLSStartTimeKey] = [NSNumber numberWithFloat:0.f]; plsMovieSettings[PLSDurationKey] = [NSNumber numberWithFloat:CMTimeGetSeconds(asset.duration)]; plsMovieSettings[PLSVolumeKey] = [NSNumber numberWithFloat:1.0f];

          outputSettings[PLSMovieSettingsKey] = plsMovieSettings;
    
          EditViewController *controller = [[EditViewController alloc] init];
          controller.settings = outputSettings;
    

// controller.fileURLArray = @[url]; controller.modalPresentationStyle = UIModalPresentationFullScreen; [self presentViewController:controller animated:YES completion:nil]; }); }];

}

jozdee avatar Dec 29 '20 09:12 jozdee

网络不行。。。pod一直失败

发自我的iPhone

------------------ 原始邮件 ------------------ 发件人: jozdee <[email protected]> 发送时间: 2020年12月29日 17:54 收件人: SilenceLove/HXPhotoPicker <[email protected]> 抄送: silence <[email protected]>, Comment <[email protected]> 主题: 回复:[SilenceLove/HXPhotoPicker] 如果在录制视频页面,选择相册里的视频,播放以后会造成录制视频页面的相机无法采集画面 (#434)

我看看

使用七牛PLShortVideoKitDemo 快速替换这个方法,去到编辑页面,再回到录制页面能复现,七牛自带的没有这个问题 // 导入视频

(void)importMovieButtonEvent:(id)sender { // PhotoAlbumViewController *photoAlbumViewController = [[PhotoAlbumViewController alloc] init]; // photoAlbumViewController.modalPresentationStyle = UIModalPresentationFullScreen; // [self presentViewController:photoAlbumViewController animated:YES completion:nil]; __weak typeof(self) weakSelf = self; HXPhotoManager *photoPickerIsSingleSelectedManager = [[HXPhotoManager alloc] initWithType:HXPhotoManagerSelectedTypeVideo]; photoPickerIsSingleSelectedManager.configuration.type = HXConfigurationTypeWXChat; photoPickerIsSingleSelectedManager.configuration.singleSelected = YES; photoPickerIsSingleSelectedManager.configuration.lookGifPhoto = YES; photoPickerIsSingleSelectedManager.configuration.singleJumpEdit = YES; photoPickerIsSingleSelectedManager.configuration.photoEditConfigur.onlyCliping = YES; photoPickerIsSingleSelectedManager.configuration.saveSystemAblum = YES; photoPickerIsSingleSelectedManager.configuration.cameraCanLocation = NO; photoPickerIsSingleSelectedManager.configuration.openCamera = NO; photoPickerIsSingleSelectedManager.configuration.cameraCellShowPreview = NO; photoPickerIsSingleSelectedManager.configuration.customCameraType = HXPhotoCustomCameraTypeUnused;

[self hx_presentSelectPhotoControllerWithManager:photoPickerIsSingleSelectedManager didDone:^(NSArray<HXPhotoModel *> * _Nullable allList, NSArray<HXPhotoModel *> * _Nullable photoList, NSArray<HXPhotoModel *> * _Nullable videoList, BOOL isOriginal, UIViewController * _Nullable viewController, HXPhotoManager * _Nullable manager) { HXPhotoModel *videoModel = videoList.firstObject; if (videoModel.asset == nil) { } else { // HXPhotoModel也提供直接导出视频地址的方法 // presetName 导出视频的质量,自己根据需求设置 [videoModel exportVideoWithPresetName:AVAssetExportPresetMediumQuality startRequestICloud:nil iCloudProgressHandler:nil exportProgressHandler:nil success:^(NSURL * _Nullable videoURL, HXPhotoModel * _Nullable model) { // 导出完成, videoURL [weakSelf gotoEditorController:videoURL]; } failed:^(NSDictionary * _Nullable info, HXPhotoModel * _Nullable model) { }]; }
} cancel:^(UIViewController * _Nullable viewController, HXPhotoManager * _Nullable manager) { [weakSelf dismissViewControllerAnimated:YES completion:nil]; }];

}

(void)gotoEditorController:(NSURL *)url {

AVAsset *asset = [AVAsset assetWithURL:url]; [asset loadValuesAsynchronouslyForKeys:@[@"duration", @"tracks"] completionHandler:^{ dispatch_async(dispatch_get_main_queue(), ^{ NSMutableDictionary *outputSettings = [[NSMutableDictionary alloc] init]; // 待编辑的原始视频素材 NSMutableDictionary *plsMovieSettings = [[NSMutableDictionary alloc] init]; plsMovieSettings[PLSURLKey] = url; plsMovieSettings[PLSAssetKey] = [AVAsset assetWithURL:url]; plsMovieSettings[PLSStartTimeKey] = [NSNumber numberWithFloat:0.f]; plsMovieSettings[PLSDurationKey] = [NSNumber numberWithFloat:CMTimeGetSeconds(asset.duration)]; plsMovieSettings[PLSVolumeKey] = [NSNumber numberWithFloat:1.0f]; outputSettings[PLSMovieSettingsKey] = plsMovieSettings; EditViewController *controller = [[EditViewController alloc] init]; controller.settings = outputSettings;

// controller.fileURLArray = @[url]; controller.modalPresentationStyle = UIModalPresentationFullScreen; [self presentViewController:controller animated:YES completion:nil]; }); }];

}

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

SilenceLove avatar Dec 29 '20 10:12 SilenceLove

网络不行。。。pod一直失败 发自我的iPhone ------------------ 原始邮件 ------------------ 发件人: jozdee <[email protected]> 发送时间: 2020年12月29日 17:54 收件人: SilenceLove/HXPhotoPicker <[email protected]> 抄送: silence <[email protected]>, Comment <[email protected]> 主题: 回复:[SilenceLove/HXPhotoPicker] 如果在录制视频页面,选择相册里的视频,播放以后会造成录制视频页面的相机无法采集画面 (#434) 我看看 使用七牛PLShortVideoKitDemo 快速替换这个方法,去到编辑页面,再回到录制页面能复现,七牛自带的没有这个问题 // 导入视频 (void)importMovieButtonEvent:(id)sender { // PhotoAlbumViewController *photoAlbumViewController = [[PhotoAlbumViewController alloc] init]; // photoAlbumViewController.modalPresentationStyle = UIModalPresentationFullScreen; // [self presentViewController:photoAlbumViewController animated:YES completion:nil]; __weak typeof(self) weakSelf = self; HXPhotoManager *photoPickerIsSingleSelectedManager = [[HXPhotoManager alloc] initWithType:HXPhotoManagerSelectedTypeVideo]; photoPickerIsSingleSelectedManager.configuration.type = HXConfigurationTypeWXChat; photoPickerIsSingleSelectedManager.configuration.singleSelected = YES; photoPickerIsSingleSelectedManager.configuration.lookGifPhoto = YES; photoPickerIsSingleSelectedManager.configuration.singleJumpEdit = YES; photoPickerIsSingleSelectedManager.configuration.photoEditConfigur.onlyCliping = YES; photoPickerIsSingleSelectedManager.configuration.saveSystemAblum = YES; photoPickerIsSingleSelectedManager.configuration.cameraCanLocation = NO; photoPickerIsSingleSelectedManager.configuration.openCamera = NO; photoPickerIsSingleSelectedManager.configuration.cameraCellShowPreview = NO; photoPickerIsSingleSelectedManager.configuration.customCameraType = HXPhotoCustomCameraTypeUnused; [self hx_presentSelectPhotoControllerWithManager:photoPickerIsSingleSelectedManager didDone:^(NSArray<HXPhotoModel *> * _Nullable allList, NSArray<HXPhotoModel *> * _Nullable photoList, NSArray<HXPhotoModel *> * _Nullable videoList, BOOL isOriginal, UIViewController * _Nullable viewController, HXPhotoManager * _Nullable manager) { HXPhotoModel *videoModel = videoList.firstObject; if (videoModel.asset == nil) { } else { // HXPhotoModel也提供直接导出视频地址的方法 // presetName 导出视频的质量,自己根据需求设置 [videoModel exportVideoWithPresetName:AVAssetExportPresetMediumQuality startRequestICloud:nil iCloudProgressHandler:nil exportProgressHandler:nil success:^(NSURL * _Nullable videoURL, HXPhotoModel * _Nullable model) { // 导出完成, videoURL [weakSelf gotoEditorController:videoURL]; } failed:^(NSDictionary * _Nullable info, HXPhotoModel * _Nullable model) { }]; } } cancel:^(UIViewController * _Nullable viewController, HXPhotoManager * _Nullable manager) { [weakSelf dismissViewControllerAnimated:YES completion:nil]; }]; } (void)gotoEditorController:(NSURL *)url { AVAsset *asset = [AVAsset assetWithURL:url]; [asset loadValuesAsynchronouslyForKeys:@[@"duration", @"tracks"] completionHandler:^{ dispatch_async(dispatch_get_main_queue(), ^{ NSMutableDictionary *outputSettings = [[NSMutableDictionary alloc] init]; // 待编辑的原始视频素材 NSMutableDictionary *plsMovieSettings = [[NSMutableDictionary alloc] init]; plsMovieSettings[PLSURLKey] = url; plsMovieSettings[PLSAssetKey] = [AVAsset assetWithURL:url]; plsMovieSettings[PLSStartTimeKey] = [NSNumber numberWithFloat:0.f]; plsMovieSettings[PLSDurationKey] = [NSNumber numberWithFloat:CMTimeGetSeconds(asset.duration)]; plsMovieSettings[PLSVolumeKey] = [NSNumber numberWithFloat:1.0f]; outputSettings[PLSMovieSettingsKey] = plsMovieSettings; EditViewController *controller = [[EditViewController alloc] init]; controller.settings = outputSettings; // controller.fileURLArray = @[url]; controller.modalPresentationStyle = UIModalPresentationFullScreen; [self presentViewController:controller animated:YES completion:nil]; }); }]; } — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

有时间帮忙看看,挺奇怪的

jozdee avatar Dec 30 '20 01:12 jozdee

网络不行。。。pod一直失败 发自我的iPhone ------------------ 原始邮件 ------------------ 发件人: jozdee <[email protected]> 发送时间: 2020年12月29日 17:54 收件人: SilenceLove/HXPhotoPicker <[email protected]> 抄送: silence <[email protected]>, Comment <[email protected]> 主题: 回复:[SilenceLove/HXPhotoPicker] 如果在录制视频页面,选择相册里的视频,播放以后会造成录制视频页面的相机无法采集画面 (#434) 我看看 使用七牛PLShortVideoKitDemo 快速替换这个方法,去到编辑页面,再回到录制页面能复现,七牛自带的没有这个问题 // 导入视频 (void)importMovieButtonEvent:(id)sender { // PhotoAlbumViewController *photoAlbumViewController = [[PhotoAlbumViewController alloc] init]; // photoAlbumViewController.modalPresentationStyle = UIModalPresentationFullScreen; // [self presentViewController:photoAlbumViewController animated:YES completion:nil]; __weak typeof(self) weakSelf = self; HXPhotoManager *photoPickerIsSingleSelectedManager = [[HXPhotoManager alloc] initWithType:HXPhotoManagerSelectedTypeVideo]; photoPickerIsSingleSelectedManager.configuration.type = HXConfigurationTypeWXChat; photoPickerIsSingleSelectedManager.configuration.singleSelected = YES; photoPickerIsSingleSelectedManager.configuration.lookGifPhoto = YES; photoPickerIsSingleSelectedManager.configuration.singleJumpEdit = YES; photoPickerIsSingleSelectedManager.configuration.photoEditConfigur.onlyCliping = YES; photoPickerIsSingleSelectedManager.configuration.saveSystemAblum = YES; photoPickerIsSingleSelectedManager.configuration.cameraCanLocation = NO; photoPickerIsSingleSelectedManager.configuration.openCamera = NO; photoPickerIsSingleSelectedManager.configuration.cameraCellShowPreview = NO; photoPickerIsSingleSelectedManager.configuration.customCameraType = HXPhotoCustomCameraTypeUnused; [self hx_presentSelectPhotoControllerWithManager:photoPickerIsSingleSelectedManager didDone:^(NSArray<HXPhotoModel *> * _Nullable allList, NSArray<HXPhotoModel *> * _Nullable photoList, NSArray<HXPhotoModel *> * _Nullable videoList, BOOL isOriginal, UIViewController * _Nullable viewController, HXPhotoManager * _Nullable manager) { HXPhotoModel *videoModel = videoList.firstObject; if (videoModel.asset == nil) { } else { // HXPhotoModel也提供直接导出视频地址的方法 // presetName 导出视频的质量,自己根据需求设置 [videoModel exportVideoWithPresetName:AVAssetExportPresetMediumQuality startRequestICloud:nil iCloudProgressHandler:nil exportProgressHandler:nil success:^(NSURL * _Nullable videoURL, HXPhotoModel * _Nullable model) { // 导出完成, videoURL [weakSelf gotoEditorController:videoURL]; } failed:^(NSDictionary * _Nullable info, HXPhotoModel * _Nullable model) { }]; } } cancel:^(UIViewController * _Nullable viewController, HXPhotoManager * _Nullable manager) { [weakSelf dismissViewControllerAnimated:YES completion:nil]; }]; } (void)gotoEditorController:(NSURL *)url { AVAsset *asset = [AVAsset assetWithURL:url]; [asset loadValuesAsynchronouslyForKeys:@[@"duration", @"tracks"] completionHandler:^{ dispatch_async(dispatch_get_main_queue(), ^{ NSMutableDictionary *outputSettings = [[NSMutableDictionary alloc] init]; // 待编辑的原始视频素材 NSMutableDictionary *plsMovieSettings = [[NSMutableDictionary alloc] init]; plsMovieSettings[PLSURLKey] = url; plsMovieSettings[PLSAssetKey] = [AVAsset assetWithURL:url]; plsMovieSettings[PLSStartTimeKey] = [NSNumber numberWithFloat:0.f]; plsMovieSettings[PLSDurationKey] = [NSNumber numberWithFloat:CMTimeGetSeconds(asset.duration)]; plsMovieSettings[PLSVolumeKey] = [NSNumber numberWithFloat:1.0f]; outputSettings[PLSMovieSettingsKey] = plsMovieSettings; EditViewController *controller = [[EditViewController alloc] init]; controller.settings = outputSettings; // controller.fileURLArray = @[url]; controller.modalPresentationStyle = UIModalPresentationFullScreen; [self presentViewController:controller animated:YES completion:nil]; }); }]; } — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

有时间帮忙看看,挺奇怪的

我这边还会偶尔出现几次,获取到的相册全部显示为空

jozdee avatar Dec 30 '20 02:12 jozdee