无法让MPMoviePlayerViewController播放我的媒体文件 [英] Cannot get the MPMoviePlayerViewController to play my media file

查看:94
本文介绍了无法让MPMoviePlayerViewController播放我的媒体文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让MPMoviePlayerViewController工作时遇到一些问题。我有两个指向同一Quicktime电影的示例网址。注释掉的URL不起作用;另一个工作正常。

Having some issues getting this MPMoviePlayerViewController to work. I have two sample URLs pointing to the same Quicktime movie. The commented out URL doesn't work; the other one works fine.

我通过Fiddler进行了监控,我在标题/等中看不到任何问题。

I've monitored both via Fiddler and I can't see any issues in headers/etc.

基本上我正试图找出一种方法来播放具有某种安全性的Azure托管媒体文件;要么通过WCF服务。有没有人想到这个?我把头发拉了出来。

Basically I'm trying to figure out a way to play an Azure hosted media file with some sort of security; either via pass through WCF service. Any one have this figured out? I'm pulling my hair out.

//NSString *moviePath = [[NSString alloc] initWithString:@"http://www.nov8rix.com/Services/CPipeline.svc/Media/42"];

NSString *moviePath = [[NSString alloc] initWithString:@"http://nov8rixstorage.blob.core.windows.net/searchpad/tutorial_portrait.mov"];

NSURL *url = [NSURL URLWithString:moviePath];
[url retain];

MPMoviePlayerViewController *mp = [[MPMoviePlayerViewController alloc] initWithContentURL:url];

[self presentMoviePlayerViewControllerAnimated:mp];
[mp release];
[url release];

更新:这是我收到的错误:

Update: This is the error I'm receiving:

NSConcreteNotification 0x892e540 {name = MPMoviePlayerPlaybackDidFinishNotification; object = <MPMoviePlayerController: 0x8921570>; userInfo = {
    MPMoviePlayerPlaybackDidFinishReasonUserInfoKey = 1;
    error = "Error Domain=MediaPlayerErrorDomain Code=-12939 \"The server is not correctly configured.\" UserInfo=0x892ecb0 {NSLocalizedDescription=The server is not correctly configured.}";

网上的简短搜索提到我的问题可能是我的媒体连接不支持字节范围请求。这可能是真的。有没有办法允许使用WCF进行范围请求?

A brief search on the web mentions that my problem may be that my media connection doesn't support byte Range Requests. This is probably true. Is there a way to allow Range Requests with WCF?

推荐答案

我终于让这个工作了!它无法工作的原因是因为我的WCF服务不支持范围请求。显然,iPhone电影流需要范围请求。

Yay I finally got this to work! The reason it was not working was because my WCF services didn't support Range Requests. Apparently iPhone Movie streaming requires range requests.

我改变了我的实现,通过SAS URL直接向Azure blob存储请求。到目前为止工作!

I changed my implementation to make direct requests to the Azure blob storage via SAS URLs. Works so far!

这篇关于无法让MPMoviePlayerViewController播放我的媒体文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆