Instance Method


Returns a MPMoviePlayerController object initialized with the movie at the specified URL.


- (instancetype)initWithContentURL:(NSURL *)url;



The location of the movie file. This file must be located either in your app directory or on a remote server.

Return Value

The movie player object.


This method initializes a movie player, but does not prepare it for playback. To prepare a new movie player for playback, call the prepareToPlay method, described in MPMediaPlayback.

To be notified when a new movie player is ready to play, register for the MPMoviePlayerLoadStateDidChangeNotification notification. You can then check load state by accessing the loadState property.

To check for errors in URL loading, register for the MPMoviePlayerPlaybackDidFinishNotification notification. On error, this notification contains an NSError object available using the @"error" key in the notification’s userInfo dictionary.