当通过AirPlay (使用iOS9.2)从连接到Apple TV的iOS设备播放声音时,声音播放的第一秒左右被切断。这种不受欢迎的行为不是特定于应用程序的,而是系统范围的(例如,苹果的官方应用程序也有这个缺陷)。
请参阅https://forums.developer.apple.com/thread/28086
是否有可以播放完整audio file的解决方案?例如,在播放文件之前添加blank sounds?或者改变API的调用方式?或者我应该等待Apple的官方修复?
发布于 2016-12-26 02:47:34
示例代码:
audioPlayer.actionAtItemEnd = AVPlayerActionAtItemEndNone;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(playEnded:)
name:AVPlayerItemDidPlayToEndTimeNotification
object:[audioPlayer currentItem]];
- (void)playEnded:(NSNotification *)notification
{
// Start the full audio file here
}https://stackoverflow.com/questions/34223288
复制相似问题