<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVKit",
  "identifier" : "/documentation/AVKit/AVPortalViewport",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVKit"
    ],
    "preciseIdentifier" : "c:objc(cs)AVPortalViewport"
  },
  "title" : "AVPortalViewport"
}
-->

# AVPortalViewport

An object that defines the visual parameters for content displayed within a portal frame.

```
class AVPortalViewport
```

## Overview

Use this configuration to create cinematic viewing experiences with custom framing. Portal viewports let you control how the system frames and presents immersive content. Specify the aspect ratio of the portal frame to achieve the visual effect you want, as the following example shows:

```swift
let portalViewport = AVPortalViewport()
portalViewport.aspectRatio = 2.39
playerViewController.viewport.portal = portalViewport
```

When you don’t explicitly set properties, the system provides sensible defaults. The aspect ratio defaults to 16:9 (1.78) for standard widescreen content.

> Note: Spatial videos don’t support portal viewport settings.

## Topics

### Configuring the aspect ratio

[`var aspectRatio: Double?`](/documentation/AVKit/AVPortalViewport/aspectRatio-4drnq)

The width-to-height ratio of the portal frame.

## Relationships

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

### Conforms To

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

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

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

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

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

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

---

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)