Skip to content

crash when preview a video asset #69

Description

@bingbingBang

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions