<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVLayerVideoGravity",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:@T@AVLayerVideoGravity"
  },
  "title" : "AVLayerVideoGravity"
}
-->

# AVLayerVideoGravity

A structure that defines how a layer displays a player’s visual content within the layer’s bounds.

```
struct AVLayerVideoGravity
```

## Topics

### Video gravities

[`AVLayerVideoGravityResize`](/documentation/AVFoundation/AVLayerVideoGravity/resize)

The video stretches to fill the layer’s bounds.

[`AVLayerVideoGravityResizeAspect`](/documentation/AVFoundation/AVLayerVideoGravity/resizeAspect)

The video preserves its aspect ratio and fits it within the layer’s bounds.

[`AVLayerVideoGravityResizeAspectFill`](/documentation/AVFoundation/AVLayerVideoGravity/resizeAspectFill)

The video preserves its aspect ratio and fills the layer’s bounds.

### Initializers

[`init(rawValue:)`](/documentation/AVFoundation/AVLayerVideoGravity/init(rawValue:))

Creates a video gravity with a string value.

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)