Instance Property

videoRect

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

Declaration

@property(nonatomic, readonly) CGRect videoRect;

Discussion

You can use this property to determine the display rect of the video image within the layer’s bounds. The size and position of this rect are dependent on the aspect ratio of the media (e.g. 16:9 or 4:3), the layer’s bounds, and its videoGravity.

This property is key value observable using Key-value observing.

See Also

Configuring Player Layer Values

player

The player for which the player layer displays visual output.

readyForDisplay

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

videoGravity

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

AVLayerVideoGravity

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

pixelBufferAttributes

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

AVMakeRectWithAspectRatioInsideRect

Returns a scaled rectangle that maintains the specified aspect ratio within a bounding rectangle.