Priyanka
Priyanka

Reputation: 513

how to play the video in iphone app from the server

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

Answers (1)

Skotch
Skotch

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

Related Questions