I’ve downloaded a file from a webserver, and saved it in my Documents Directory.
I try and pass the url of the file to MPMoviePlayerViewController using
initWithContentURL:url];
Where the url is created with
[NSURL URLWithString:@"/var/mobile/Applications/7A21A941-A54C-4116-857D-A34EDEE2F2E8/Documents/lesson.m4v"];
However whenever I try to play the video, the MoviePlayer appears for a second, with “loading” then dismisses itself.
Am I doing something wrong with the local file URL?
(The video plays fine when streamed from the webserver)
Thanks
I don’t know why it is dismissing itself, but you actually are using web url instead of fileUrl. You need to initiate it like this:
and pass this url to your MPMovieController