MPMoviePlayerController stops often

I use MPMoviePlayerController to play remote mp4 files that are not very large, about 20 - 30 MB each. Here's how the player is configured:

player.movieSourceType = MPMovieSourceTypeFile; player.shouldAutoplay = YES; 

The problem is that the player often stops with the following console output:

 Took background task assertion ... for playback stall // stops Ending background task assertion ... for playback stall // resumes 

Perhaps I could perceive this behavior as provided, but, on the other hand, when I try to play a video in another streaming player (for example, GoodPlayer) - it plays beautifully and never stops. So the problem is my approach, not the internet connection.

Is there a way to get MPMoviePlayerController to load smoothly, or do I need to change the components used in my application? If so, which ones would you recommend?

+6
source share
1 answer

Try assigning (declaring) MPMoviePlayerController as @property in your .h file, rather than a local variable.

0
source

Source: https://habr.com/ru/post/952110/


All Articles