Instance Property


A Boolean value that indicates whether the movie player should use the app’s audio session.


var useApplicationAudioSession: Bool { get set }


The default value of this property is true. Setting this property to false causes the movie player to use a system-supplied audio session with a non-mixable playback category.

When this property is true, the movie player shares the app’s audio session. This give you control over how the movie player content interacts with your audio and with audio from other apps, such as the iPod. For important guidance on using this feature, see Audio Session Programming Guide in Audio Session Programming Guide.

Changing the value of this property does not affect the currently playing movie. For the new setting to take effect, you must stop playback and then start it again.

Special Considerations

In iOS 3.1 and earlier, a movie player always uses a system-supplied audio session. To obtain that same behavior in iOS 3.2 and newer, you must set this property’s value to false.

See Also

Accessing Movie Properties

var contentURL: URL!

The URL that points to the movie file.

var movieSourceType: MPMovieSourceType

The playback type of the movie.

var movieMediaTypes: MPMovieMediaTypeMask

The types of media available in the movie.

var allowsAirPlay: Bool

Specifies whether the movie player allows AirPlay movie playback.

var isAirPlayVideoActive: Bool

Indicates whether the movie player is currently playing video via AirPlay.

var naturalSize: CGSize

The width and height of the movie frame.

var isFullscreen: Bool

A Boolean that indicates whether the movie player is in full-screen mode.

func setFullscreen(Bool, animated: Bool)

Causes the movie player to enter or exit full-screen mode.

var scalingMode: MPMovieScalingMode

The scaling mode to use when displaying the movie.

var controlStyle: MPMovieControlStyle

The style of the playback controls.