视频没有播放ios 6

时间:2012-12-27 11:39:33

标签: objective-c ios xcode mpmovieplayercontroller asihttprequest

我正在尝试使用MPMoviePlayerViewController从我的网络服务返回的网址播放视频。返回的示例网址是:

http://view.vzaar.com/1128188/player

我传递给MPMoviePlayerViewController。你认为这个网址是否兼容?

2 个答案:

答案 0 :(得分:2)

我查看了该页面的来源,这是一个html页面。我找到了一个html5源网址。尝试: http://view.vzaar.com/1128188/video

是的,上面的网址。我刚刚在xcode中尝试了它,我就让它工作了。

NSURL *url = [[NSURL alloc] initWithString:@"http://view.vzaar.com/1128188/video"];

   self.moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];

   [self.moviePlayer prepareToPlay];
   [self.moviePlayer.view setFrame:self.view.bounds];  // player's frame must match parent's
   [self.view addSubview: self.moviePlayer.view];

   [self.moviePlayer play];

答案 1 :(得分:0)

即可。它无法播放,因为它是嵌入了Flash播放器的HTML页面。更改您的网络服务以直接返回视频,可能在不同的网址中。