iOS Developer Library

Developer

MediaPlayer Framework Reference UIViewController MediaPlayer Additions Reference

Options
Deployment Target:

On This Page
Language:

UIViewController

Inherits From


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import MediaPlayer

Objective-C

@import MediaPlayer;

Availability


Available in iOS 3.2 and later

This category adds methods to the UIViewController class for presenting and dismissing a movie player using a specific set of animations. The transitions used by these methods are the same ones used by the YouTube and iPod applications to display video content.

  • Presents the movie player view controller using the standard movie player transition.

    Declaration

    Swift

    func presentMoviePlayerViewControllerAnimated(_ moviePlayerViewController: MPMoviePlayerViewController!)

    Objective-C

    - (void)presentMoviePlayerViewControllerAnimated:(MPMoviePlayerViewController *)moviePlayerViewController

    Parameters

    moviePlayerViewController

    The movie player view controller to present.

    Import Statement

    Objective-C

    @import MediaPlayer;

    Swift

    import MediaPlayer

    Availability

    Available in iOS 3.2 and later

  • Dismisses a movie player view controller using the standard movie player transition.

    Declaration

    Swift

    func dismissMoviePlayerViewControllerAnimated()

    Objective-C

    - (void)dismissMoviePlayerViewControllerAnimated

    Discussion

    If the receiver’s modalViewController property does not contain a movie player view controller, this method does nothing.

    Import Statement

    Objective-C

    @import MediaPlayer;

    Swift

    import MediaPlayer

    Availability

    Available in iOS 3.2 and later