longitachi / ZLPhotoBrowser

Wechat-like image picker. Support select photos, videos, gif and livePhoto. Support edit image and crop video. 微信样式的图片选择器,支持预览/相册内拍照及录视频、拖拽/滑动选择,编辑图片/视频,支持多语言国际化等功能;
MIT License
4.72k stars 953 forks source link

特定机型及系统下,无法成功获取个别视频 #792

Open ElvistLui opened 1 year ago

ElvistLui commented 1 year ago

Issue Description

目前仅在iPhone 11,iOS 15.6下,获取该视频失败,其他视频或系统均没有问题

Description and Steps

index

Info

ZLPhotoBrowser version: e.g. 4.3.7 Device: e.g. iPhone 11 Device version: e.g. iOS 15.6 Xcode version: e.g. Xcode 14.1

Configuration code of ZLPhotoConfiguration

+ (void)selectVideoFor:(UIViewController *)vc asset:(PHAsset *)asset selectedBlock:(void (^)(ZLResultModel * _Nonnull))selectedBlock cancelBlock:(void (^)(void))cancelBlock {

    int maxVideoTime = 60;
    // 配置
    [ZLPhotoConfiguration default].allowMixSelect = NO;
    [ZLPhotoConfiguration default].allowSelectImage = NO;
    [ZLPhotoConfiguration default].allowSelectVideo = YES;
    [ZLPhotoConfiguration default].maxSelectCount = 1;
    [ZLPhotoConfiguration default].maxVideoSelectCount = 1;
    [ZLPhotoConfiguration default].maxEditVideoTime = maxVideoTime;
    [ZLPhotoConfiguration default].maxSelectVideoDuration = 3600; // 暂时显示不能选择超过1小时的视频
    [ZLPhotoConfiguration default].allowEditVideo = YES;
    [ZLPhotoConfiguration default].saveNewImageAfterEdit = YES;
    [ZLPhotoConfiguration default].minRecordDuration = 3;
    [ZLPhotoConfiguration default].maxRecordDuration = 60;
    [ZLPhotoConfiguration default].editAfterSelectThumbnailImage = YES; // 点击视频时,直接点击进入编辑页

    [ZLPhotoUIConfiguration default].languageType = ZLLanguageTypeChineseSimplified;

    ZLPhotoPreviewSheet *ps = [[ZLPhotoPreviewSheet alloc] initWithSelectedAssets:asset ? @[asset] : @[]];
    ps.selectImageBlock = ^(NSArray<ZLResultModel *> * _Nonnull results, BOOL isOriginal) {

        if (selectedBlock) {
            selectedBlock(results.firstObject);
        }
    };
    ps.cancelBlock = ^{

        if (cancelBlock) {
            cancelBlock();
        }
    };
    [ps showPhotoLibraryWithSender:vc];
}