I have a ViewController that plays a movie. If the movie was downloaded (with an ASI-HTTP request), it takes the local version. Otherwise, it transfers it from the Internet. This is the same movie.
Streaming works very well, but playing a local file does not work. Just a black screen and no controls. The file was uploaded correctly. I checked the md5 checksum.
This is Apple QuickTime Video (.mov) of size 1024x5xx.
player = [[MPMoviePlayerController alloc] init]; [player.view setFrame: self.view.bounds]; if (local) { // DOES not work // SHOULD be [NSURL fileURLWithString:...] [player setContentURL: [NSURL URLWithString: @"/path/to/the/movie.mov"]]; } else { // does work [player setContentURL: [NSURL URLWithString: @"http://mydomain.tld/path/to/the/movie.mov"]]; } [self.view addSubview: player.view]; [player play]
I tried with MediaSourceType players. But it did not help. Why is this not working? I have no error messages because I am not getting one ... is there any way to get error messages from it?
Decision
I found my mistake.
I used [NSURL URLWithString: @"/the/path/..."] for the local path.
It works with [NSURL fileURLWithPath: @"/the/path/..."]
source share