Structure

AVLayerVideoGravity

A value that defines how the video is displayed within a layer’s bounds rectangle.

Declaration

struct AVLayerVideoGravity

Topics

Video Gravity Options

static let resize: AVLayerVideoGravity

The video should be stretched to fill the layer’s bounds.

static let resizeAspect: AVLayerVideoGravity

The player should preserve the video’s aspect ratio and fit the video within the layer’s bounds.

static let resizeAspectFill: AVLayerVideoGravity

The player should preserve the video’s aspect ratio and fill the layer’s bounds.

Relationships

See Also

Configuring Player Layer Values

var player: AVPlayer?

The player for which the player layer displays visual output.

var isReadyForDisplay: Bool

A Boolean value that indicates whether the first video frame has been made ready for display for the current item of the associated player.

var videoGravity: AVLayerVideoGravity

A value that specifies how the video is displayed within a player layer’s bounds.

var videoRect: CGRect

The current size and position of the video image as displayed within the receiver's bounds.

var pixelBufferAttributes: [String : Any]?

The client requirements for the visual output displayed in the player layer during playback.

func AVMakeRect(aspectRatio: CGSize, insideRect: CGRect) -> CGRect

Returns a scaled CGRect that maintains the specified aspect ratio when within a bounding object.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software