LePips / VLCUI

VLCKit for SwiftUI
MIT License
38 stars 17 forks source link

enable to fetch thumbnailer preview #20

Open tinuv opened 1 year ago

tinuv commented 1 year ago

These codes are my attempts, and the previews can be obtained and used most of the time, especially when the network conditions are good. However, sometimes they cannot be obtained. I'm not sure if it's an issue with vlckit. I've already applied these codes to my product. You can take these codes as a reference. Once again, thank you for your generous and selfless open sourcing of VLCUI!

tinuv commented 1 year ago

The key to the code is that a new instance of VLCMediaThumbnailer needs to be created each time a preview is fetched. If you only create one instance and then call fetchThumbnail(), it will work the first time but will timeout on subsequent calls.