Skip to content

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

@hootigger

Description

@hootigger

#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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions