heestand-xyz / AsyncGraphics

Edit images and video with Swift concurrency, powered by Metal.
http://async.graphics
MIT License
340 stars 17 forks source link

Video Playback Example throws Error #8

Closed nkleemann closed 8 months ago

nkleemann commented 8 months ago

The example you give here throws errors on the line return GraphicVideoPlayer(url: url, options: options):

1: 'async' call in a function that does not support concurrency. 2: Call can throw, but it is not marked with 'try' and the error is not handled

I could fix error # 2 but struggle with fixing the first error.

I'm on Xcode 15.2, macOS 13.6.4.

heestand-xyz commented 8 months ago

Hi, thanks for reporting the issue. I've fixed it in verison 2.0.3, will be avalible soon! In the new verison the initalizer is not async or throwing, tho you need to call a setup function before playing:

try await videoPlayer.setup()
heestand-xyz commented 8 months ago

Version 2.0.3 is now available and the docs are updated.