tags:

views:

1171

answers:

1

Hi All,

I have a video in my iPhone application documents directory. I am want to play that using mpmovieplayercontroller. can some one post code to do this.

Thanks, Naresh

+1  A: 

Here's a link to the docs for mpmovieplayercontroller: http://developer.apple.com/iphone/library/documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/MPMoviePlayerController/MPMoviePlayerController.html#//apple_ref/occ/instm/MPMoviePlayerController/initWithContentURL:

It's as simple as creating a url to the local file using:

[[NSBundle mainBundle] pathForResource: ofType:]

Then passing this url into:

[[MPMoviePlayerController alloc] initWithContentURL:]
Dan Lorenc