Reputation: 513
I want to play the video in iPhone App from a server.
I have kept my video ON FTP
and I am accessing it using: http://www.mysebsiteurl.com/Foldername/videofilename.m4v
But It's not working and if I am trying to play any youtube video it works.
So, can any one tell me any solution for it or provide some sample source code.
Upvotes: 0
Views: 778
Reputation: 3091
iOS does not play .m4v
videos. It will play .mp4
or .mov
among other formats. The documentation for MPMoviePlayerController lists them. Try renaming your video to .mp4
and see if it works then. Also note that iOS will not play DRM protected video.
My code plays videos all of the time, in the .mov
or .mp4
formats. We download them into the Caches directory. You can get the path like this:
NSString *path = nil;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
if ([paths count] > 0) {
path = [paths objectAtIndex:0];
}
Then play your movie using MPMoviePlayerController
Upvotes: 1