Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

从iCloud下载视频时增加进度提示 #1348

Open
Mr-ZNN opened this issue Aug 5, 2020 · 2 comments
Open

从iCloud下载视频时增加进度提示 #1348

Mr-ZNN opened this issue Aug 5, 2020 · 2 comments

Comments

@Mr-ZNN
Copy link

Mr-ZNN commented Aug 5, 2020

问:你希望加什么新功能?
答:从cloud下载视频时增加进度提示

问:微信、QQ等大APP的选择器,是否有这个功能?
答:有

问:这个功能是否适合所有人?如不是,是否要加个属性开关?
答:是

其它你希望补充的内容
目前从iCloud下载视频时无任何交互提示

@Mr-ZNN
Copy link
Author

Mr-ZNN commented Aug 6, 2020

针对于iCloud视频没有进度交互这个问题,我目前是这样处理的。请大佬指正。

原本的代码:
在原来collectionViewCell点击的时候是直接跳转到TZVideoPlayerController
TZVideoPlayerController *videoPlayerVc = [[TZVideoPlayerController alloc] init];
videoPlayerVc.model = model;
[self.navigationController pushViewController:videoPlayerVc animated:YES];

处理后的代码:
ProgressBarShowLoading(@"加载中");
PHVideoRequestOptions * option = [[PHVideoRequestOptions alloc] init];
option.networkAccessAllowed = YES;
option.progressHandler = ^(double progress, NSError * _Nullable error, BOOL * _Nonnull stop, NSDictionary * _Nullable info) {
NSLog(@"下载进度:%f",progress);
NSString * currentPrecentage = [NSString stringWithFormat:@"%.2f%%",progress];
ProgressBarUpdateLoading(@"正在从iCloud下载...", currentPrecentage);
};
[[PHImageManager defaultManager] requestAVAssetForVideo:model.asset options:option resultHandler:^(AVAsset * _Nullable asset, AVAudioMix * _Nullable audioMix, NSDictionary * _Nullable info) {
dispatch_async(dispatch_get_main_queue(), ^{
ProgressBarDismissLoading(@"");
TZVideoPlayerController *videoPlayerVc = [[TZVideoPlayerController alloc] init];
videoPlayerVc.model = model;
[self.navigationController pushViewController:videoPlayerVc animated:YES];
});
}];

@qiangzai
Copy link

我也有此问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants