简体   繁体   English

iOS:AVQueuePlayer并不表示已停止播放

[英]iOS: AVQueuePlayer does not indicate that it has stopped playback

I have an AVQueuePlayer which loads URLs to play audio files and it works well for the most part. 我有一个AVQueuePlayer ,它加载URL来播放音频文件,并且在大多数情况下效果很好。 However, I have run into a problem where after the player finishes playing a file (with another file in the queue), it will simply stop playing. 但是,我遇到了一个问题,在播放器完成播放文件(队列中有另一个文件)之后,它只会停止播放。 Normally, the app would be able to use the player's rate , status , and items . 通常,该应用将能够使用播放器的ratestatusitems In this case, I have gone through with the debugger and everything looks normal. 在这种情况下,我经历了调试器,一切看起来都很正常。

Everything appears to be playing, except for the player itself. 除了播放器本身,其他所有内容似乎都在播放。 After forcing the player to play, the player will skip to the next track, indicating that the AVPlayerItem it had was not loaded (I can confirm the audio urls are valid). 强制播放器播放后,播放器将跳到下一首曲目,指示尚未加载它的AVPlayerItem (我可以确认音频URL有效)。

Does anyone have any ideas how I catch this programatically? 有谁知道我如何以编程方式掌握这一点?

You need to have the delegate method: 您需要具有委托方法:

- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag;

Once this method is finished, start the new audio. 此方法完成后,请开始新的音频。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM