MPMoviePlayerController plays local file but not deleted via HTTP

I have an mp4 file that, as part of the application, works great with MPMoviePlayerController.

[_mediaPlayer setContentURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] 
                                                    pathForResource:@"movie" 
                                                    ofType:@"mp4"]]];
[_mediaPlayer play];

But as soon as I upload the same file to the web server, it will give me this error:

Error Domain=MediaPlayerErrorDomain Code=2

The safari browser on the same device plays the remote movie - therefore, accessibility is not a problem, I did not find any documentation about what Code 2 tells me. Therefore, I'm stuck.

Is anyone

+5
source share
1 answer

You must use NSURL URLWithString: because you are not using the local file path. (posted as a response from a comment :))

+7

All Articles