I have a mp4 file that as part of the app plays just fine with MPMoviePlayerController.
[_mediaPlayer setContentURL:[NSURL fileURLWithPath:[[NSBundle mainBundle]
pathForResource:@"movie"
ofType:@"mp4"]]];
[_mediaPlayer play];
But once I upload the very same file to a webserver it'll give me that error:
Error Domain=MediaPlayerErrorDomain Code=2
The safari browser on the same device plays the remote movie - so the reachability is not the problem . I didn't find any Documentation about what Code 2 tells me. So I am stuck.
Anyone?
You should use NSURL's URLWithString
: because you aren't using a local file path. (posted as answer from comment :))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With