August Bjornberg
August Bjornberg

Reputation: 4976

AVPlayer, looping video under very heavy load

I'm running a tensorflow calculation on iOS, the calculation takes a few seconds so i thought it would be nice to add a loading animation (AVPlayer). The loading animation plays and loops just fine when the phone is not under heavy load from the tensorflow calculation, but as soon as i start running the calculation the observer for when the video is done simply stop firing, so i can't seek to the beginning and replay it.

Has anyone run into something similar? Is there any clever workarounds for playing media under heavy loads?

Upvotes: 0

Views: 60

Answers (1)

Mohamad Bachir Sidani
Mohamad Bachir Sidani

Reputation: 2099

You should perform the task using dispatch async on a different thread.

Hope this helps!

Upvotes: 1

Related Questions