neekeetab / CachingPlayerItem

Play and cache media content simultaneously on your iOS device
MIT License
520 stars 89 forks source link

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

Open ghost opened 8 months ago

ghost commented 8 months ago

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