0
因此,我正在尝试使用Apple提供的http实况流示例直播视频。该程序编译,但它不会显示我的iPhone上的任何东西。以下是代码:AVFoundation NSURL不显示正确?
谢谢。
NSURL *url = [NSURL URLWithString:@"<#http://developer.apple.com/resources/http-streaming/examples/advanced-stream.html#>"];
/*
// You may find a test stream at <http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8>.
self.playerItem = [AVPlayerItem playerItemWithURL:url];
[playerItem addObserver:self forKeyPath:@"status" options:0 context:&ItemStatusContext];
self.player = [AVPlayer playerWithPlayerItem:playerItem];
*/
/*
self.player = [AVPlayer playerWithURL:url];
[player addObserver:self forKeyPath:@"status" options:0 context:&PlayerStatusContext];
*/
self.playerItem = [AVPlayerItem playerItemWithURL:url];
//(optional) [playerItem addObserver:self forKeyPath:@"status" options:0 context:&ItemStatusContext];
self.player = [AVPlayer playerWithPlayerItem:playerItem];
self.player = [AVPlayer playerWithURL:url];
[player play];
[super viewDidLoad];
我如何使它自动播放?对不起,我是一个noob。 =/ – DasBoot 2012-08-10 04:48:21
我试过youtube,vimeo和其他许多人,它会抛出一个错误:“未知错误:-12939”。我错过了什么?有人可以帮助解决这个问题吗? – Deepukjayan 2012-08-22 12:26:47
您需要链接到正确的视频格式。 – headkit 2012-08-24 11:53:38