我正在尝试开发一个应该从特定链接流式传输音频的小应用程序。我为此使用 AVPlayer,但我不知道为什么它不起作用。试过谷歌,但那里似乎没有什么相关的。请帮助..谢谢
- (void)viewDidLoad
{
[super viewDidLoad];
NSURL *url = [NSURL URLWithString:@"http://108.166.161.206:8826/stream.mp3"];
self->playerItem = [AVPlayerItem playerItemWithURL:url];
self->player = [AVPlayer playerWithPlayerItem:playerItem];
self->player = [AVPlayer playerWithURL:url];
[player play];
}