MPMoviePlayerViewController Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/MediaPlayer.framework |
| Availability | Available in iOS 3.2 and later. |
| Declared in | MPMoviePlayerViewController.h |
Overview
The MPMoviePlayerViewController class implements a simple view controller for displaying full-screen movies. Unlike using an MPMoviePlayerController object on its own to present a movie immediately, you can incorporate a movie player view controller wherever you would normally use a view controller. For example, you can present it using a tab bar or navigation bar-based interface, taking advantage of the transitions offered by those interfaces.
To present a movie player view controller modally, you typically use the presentMoviePlayerViewControllerAnimated: method. This method is part of a category on the UIViewController class and is implemented by the Media Player framework. The presentMoviePlayerViewControllerAnimated: method presents a movie player view controller using the standard transition animations for presenting video content. To dismiss a modally presented movie player view controller, call the dismissMoviePlayerViewControllerAnimated method.
Properties
moviePlayer
The movie player controller object used to present the movie. (read-only)
Discussion
The MPMoviePlayerController object in this property is created automatically by the receiver and cannot be changed. However, you can use the object to manage the presentation and configuration of the movie playback.
Availability
- Available in iOS 3.2 and later.
Declared In
MPMoviePlayerViewController.hInstance Methods
initWithContentURL:
Returns a movie player view controller initialized with the specified movie.
Parameters
- contentURL
The URL that points to the content to be played.
Return Value
A movie player view controller initialized with the specified URL.
Availability
- Available in iOS 3.2 and later.
Declared In
MPMoviePlayerViewController.hshouldAutorotateToInterfaceOrientation:
Returns a Boolean value indicating whether the view controller supports the specified orientation.
Parameters
- toInterfaceOrientation
The orientation of the application’s user interface after the rotation. The possible values are described in
UIInterfaceOrientation.
Return Value
YES if the view controller supports the specified orientation or NO if it does not.
Discussion
This method is an override that replaces the default behavior by returning YES for the UIInterfaceOrientationPortrait, UIInterfaceOrientationLandscapeLeft, and UIInterfaceOrientationLandscapeRight orientations.
Availability
- Available in iOS 3.2 and later.
Declared In
MPMoviePlayerViewController.h© 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-09-01)