Open awnigharbia opened 1 year ago
(copied from my answer to the same question in jhomlala's repo) What worked for me:
In BetterPlayer.m in (void)onReadyToPlay --- if (_player.status != AVPlayerStatusReadyToPlay) { +++ if (_player.currentItem.status != AVPlayerItemStatusReadyToPlay || _player.status != AVPlayerStatusReadyToPlay) {
It's probably more of a bandaid than fixing the root problem. There's some race condition with checking the duration of the AVPlayerItem before the AVPlayerItem is is ready to be played (stated here to not check duration before status ready) that is exposed in iOS17.
The real problem might be more related to the fact that this if doesn't check if AVPlayerItem's status is ready.
else if (context == presentationSizeContext){
[self onReadyToPlay];
}
I don't know enough about the video player stuff to say for sure where the root cause is.
After IOS 17 update. I started to notice some videos have stuck at zero duration of video and everytime you pause and start the video it reset the playback from beginning.
As you can see like this:
Any help would be appreciated.