我正在使用AVPlayer
它在设备上也可以完美运行,但是突然它停止在设备上运行,而它仍在模拟器上运行。我不明白为什么它停止工作。请检查以下代码
NSURL *url=[NSURL URLWithString:self.urlStr];
self.audioSound = [[AVPlayer alloc] init];
playerItem = [AVPlayerItem playerItemWithURL:url];
[playerItem addObserver:self forKeyPath:@"playbackBufferEmpty" options:NSKeyValueObservingOptionNew context:nil];
[playerItem addObserver:self forKeyPath:@"status" options:0 context:nil];
[self.audioSound replaceCurrentItemWithPlayerItem:playerItem];