<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVPlayerLayer/videoGravity",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVPlayerLayer(py)videoGravity"
  },
  "title" : "videoGravity"
}
-->

# videoGravity

A value that specifies how the layer displays the player’s visual content within the layer’s bounds.

```
var videoGravity: AVLayerVideoGravity { get set }
```

## Discussion

A player layer supports the following video gravity values:

- [`resizeAspect`](/documentation/AVFoundation/AVLayerVideoGravity/resizeAspect)
- [`resizeAspectFill`](/documentation/AVFoundation/AVLayerVideoGravity/resizeAspectFill)
- [`resize`](/documentation/AVFoundation/AVLayerVideoGravity/resize)

The default value is [`resizeAspect`](/documentation/AVFoundation/AVLayerVideoGravity/resizeAspect).

This property is animatable.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)