1
votes

I'm developing video caching system for AVPlayer using AVAssetResourceLoaderDelegate. But I found out that sometimes media services reset (AVAudioSessionMediaServicesWereResetNotification notification) happens about every 10 seconds, what leads to reinitialization of all AVPlayerItem and AVPlayer objects and stuttering playback.

Have someone faced with the same problem? Probably some threading issues, or AVAssetResourceLoader limitations?

Thanks

1

1 Answers

1
votes

Found solution on this problem.

I was loading values and thumbnail for multiple AVPlayerItems asynchronously in background. The key mistake was that values were requested in thread where AVPlayerItem and its AVAsset were allocated, but thumbnail (using AVAssetImageGenerator) was requested in another thread. When I moved thumbnail request to the same thread as values request media services reset disappeared.