Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

正常播放后断开网络,点击重新加载导致闪退 #19

Open
hootigger opened this issue May 10, 2021 · 0 comments
Open

正常播放后断开网络,点击重新加载导致闪退 #19

hootigger opened this issue May 10, 2021 · 0 comments

Comments

@hootigger
Copy link
Contributor

#18 所描述的情况是弱网导致fail继续播放会导致崩溃,现在测试发现当播放视频正常播放后,断开网络(保证缓冲进度未100%),然后播放到未缓冲的资源时,切换到了 错误控制层,此时点击 重试 会触发崩溃.

// 重新创建playerItem规避`An AVPlayerItem cannot be associated with more than one instance of AVPlayer`错误.
        if (avPlayerItem != nil && avPlayerItem.status == AVPlayerStatusFailed)
...

之前修复的代码加了fail状态判断,现在发现上述情况是AVPlayerStatusReadyToPlay的状态,所以未重新创建AVPlayerItem导致重复bind.
现在状态判断处理为 if (avPlayerItem != nil && avPlayerItem.status != AVPlayerStatusUnknown)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant