0

我正在使用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]; 
4

1 回答 1

0

我没有看到任何播放视频的代码,例如[player play];.

你写过这段代码吗?

于 2012-04-09T09:27:39.743 回答