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

Not able to get video thumbnail using normal approach when play from Data #48

Open
ghost opened this issue Oct 9, 2023 · 0 comments
Open

Comments

@ghost
Copy link

ghost commented Oct 9, 2023

Dear Team,

Thank you for your work. Your repository helps us a lot.
We used the CachingPlayerItem to play from Data. However, it is not able to get a thumbnail from the video using the normal approach. Please advise, thank you.

Assuming "playerItem" is a CachingPlayerItem initialized from Data
Normal Approach:
let player = AVPlayer(playerItem: playerItem)
let asset = player.currentItem?.asset ?? AVAsset()
let imageGenerator = AVAssetImageGenerator(asset: asset)
then I should be able to get a CGImage from imageGenerator.copyCGImage(at: .zero, actualTime:nil)

Waiting for your reply

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

0 participants