objective-c - 视频不播放 ios 6

标签 objective-c ios xcode mpmovieplayercontroller asihttprequest

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

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

我将其传递给 MPMoviePlayerViewController。您认为此网址兼容播放吗?

最佳答案

我查看了该页面的源代码,它是一个 html 页面。我确实找到了一个 html5 源 url。尝试: http://view.vzaar.com/1128188/video

是的,使用上面的 url。我刚刚在 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];

关于objective-c - 视频不播放 ios 6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14054077/

相关文章:

ios - 检查PHFetchResult中是否存在PHAsset

ios - 在 Cocos2D 3.0 中可以删除的情况下检查 CCNode 是否有父节点

ios - 库未加载错误(iOS)

iphone - 更改物体移动的角度 xcode iphone

iOS addChildViewController 与 AdMob [iPhone, Objective-C ]

ios - 如何在 Storyboard 中使用 ViewController 的自定义初始化

iphone - 设置 UIWebView scrollView delegate 导致错误

ios 辅助功能焦点被困在状态栏上

iphone - UILongPressGestureRecognizer - 只识别最后一次按下

iphone - 使用 SQLite Manager 创建索引