Having some issues getting this MPMoviePlayerViewControl开发者_JAVA技巧ler 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.
I've monitored both via Fiddler and I can't see any issues in headers/etc.
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.}";
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?
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.
I changed my implementation to make direct requests to the Azure blob storage via SAS URLs. Works so far!
Thanks for posting your answer. I had the same error with my MPMoviePlayerViewController, and my problem was fixed too when I added support for Range Requests to my php mp4 file streamer. Streaming media to the iPHone requires some specific headers, else you get the "The server is not correctly configured" error.
I found some great hints for php Range Requests support here: fread, (PHP 4, PHP 5), fread — Binary-safe file read
精彩评论