I am using AVPlayer to play videos in my application. Video playback always works great, unless you pause / resume the video. If the user presses the pause button and then resumes the video, sometimes the sound will be in front of the video.
The video resumes in the right place, but the sound is ahead. As if by pausing the sound continues to work.
When they press the pause button, all I do is call the pause AVPlayer method, and I also tried setting its rate property to 0.0 , which should be exactly the same according to the documentation.
I noticed this behavior only after upgrading from iPhone 6 to iOS 9 . I tested this on the iPhone 6 Simulator using iOS 8.4 , and I can’t recreate this behavior, but there are usually differences when using AVPlayer on a real device compared to the simulator, so I can’t say that I’m 100% sure that I’m directly Now the error cannot be repaired on iOS 8 .
If you look at the iOS 9 release notes and search for “ AVFoundation ” you'll see that some things have changed: https://developer.apple.com/library/prerelease/ios/releasenotes/General/RN-iOSSDK-9.0/
I realized that AVPlayerItem's new property canUseNetworkResourcesForLiveStreamingWhilePaused was the source of this problem, but after testing it does not matter if this value is set to YES or NO , the problem still occurs in both cases.
At this moment, I have no idea why this is happening, but right now I suppose this is an iOS 9 bug.
I hope that I am not the only one who is experiencing this, and that someone has found a solution already or may have an idea of why this is happening. I am open to testing and testing.
Thanks for the help.
source share