//播放监听,可以监听到播放完毕,每秒处发一次,从播放后的第一秒触发,不是一播放就出发
WeakObj(self)
WeakObj(_voicePlayer)
self.listenNer = [_voicePlayer addPeriodicTimeObserverForInterval:CMTimeMakeWithSeconds(1, NSEC_PER_SEC) queue:NULL usingBlock:^(CMTime time) {
//进度 当前时间/总时间
CGFloat progress = CMTimeGetSeconds(_voicePlayerWeak.currentItem.currentTime) / CMTimeGetSeconds(_voicePlayerWeak.currentItem.duration);
if (progress == 1.0f) {
//播放百分比为1表示已经播放完毕
//接着播放下一条录音
[selfWeak playWithNext];
}
}];
更多问题,加QQ群讨论:565191947
最后
以上就是顺利母鸡最近收集整理的关于ios avplayer播放完毕监听的全部内容,更多相关ios内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复