Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reduce iOS AVPlayer start delay

For iOS 10.x and greater to reduce AVPlayer start delay I set: avplayer.automaticallyWaitsToMinimizeStalling = false; and that seemed to fix it for me. This could have other consequences, but I haven't hit those yet.

I got the idea for it from: https://stackoverflow.com/a/50598525/9620547


The asset may not ready once you create it, it may does calculations like duration of movie, be sure to contain all metadata of the movie in the file.


You should try option #7 first, just to see if you can get that working. I suspect that it will not actually work for your needs since the seek time will likely not be fast enough to give you seamless switching between clips. If you try that and it fails, then I would advise that you do option 4/6 and take a look at my iOS library designed specifically for this purpose, just do a quick google search on AVAnimator to find out more. My library makes it possible to implement seamless loops and switching from one clip to another, it is very fast because video has to be decoded into a file before hand. In your case, all 10 video clips would get decoded into files before you begin, but then switching between them would be fast.