eroscai / SZAVPlayer

SZAVPlayer is a lightweight audio/video player library, based on AVPlayer and AVAssetResourceLoaderDelegate, pure-Swift. Support cache and video image output.
MIT License
245 stars 32 forks source link

传递URL后Seek到指定的时间节点播放播放器状态提供的不正确 #35

Open zjinhu opened 2 months ago

zjinhu commented 2 months ago
        let config = SZAVPlayerConfig(urlStr: url, uniqueID: nil)
        player.setupPlayer(config: config)
        player.seekPlayerToTime(time: Float64(seconds), completion: nil)

这时候func avplayer(_ avplayer: SZAVPlayer, didChanged status: SZAVPlayerStatus) status只返回loading,而没有playing或者readyToPlay

eroscai commented 1 month ago

你是seekPlayerToTime方法提供的completion里面判断的么?这个方法是用来跳转到指定时间以后停止播放或者自动播放(根据传入autoPlay参数),通常在completion里面去做下一个逻辑处理就好了。