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

crash when preview a video asset #69

Open
bingbingBang opened this issue Apr 15, 2023 · 0 comments
Open

crash when preview a video asset #69

bingbingBang opened this issue Apr 15, 2023 · 0 comments

Comments

@bingbingBang
Copy link

When I use FMPhotoPicker select video asset, this method func requestAVAsset(asset: PHAsset, complete: @escaping (AVAsset?) -> Void) always return a nil asset and the player won't be initialized, tap play button and nothing happends , a fews seconds later the app crash because some UI modifications performed from a background thread, I try to fix first problem by adding an option to PHImageManager and it works:

            let manager = PHImageManager.default()
            let option = PHVideoRequestOptions()
            option.isNetworkAccessAllowed = true
            
            manager.requestAVAsset(forVideo: asset, options: option) { asset, audioMix, _ in
                DispatchQueue.main.async {
                    complete(asset)
                }
            }

hope help, and the other problem I took a screenshot for your reference,hope useful:
截屏2023-04-16 00 11 20

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

1 participant