views:

138

answers:

2

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.

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?

A: 

Here is a link to my working code example for playing a video on iOS4 with 3.1.3 backward compatibility.

stitz
This is useful thank you; but it isn't the answer to my issue. I updated my post with the error message from the MPMoviePlayerController
deadcode
A: 

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!

deadcode