<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/VideoPlayerComponent/portalSize",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation20VideoPlayerComponentV10portalSizes5SIMD2VySfGvp"
  },
  "title" : "portalSize"
}
-->

# portalSize

The size of the portal window for immersive video playback, in meters.

```
var portalSize: SIMD2<Float> { get set }
```

## Discussion

Use this property to control the dimensions of the portal window when
[`desiredImmersiveViewingMode`](/documentation/RealityKit/VideoPlayerComponent/desiredImmersiveViewingMode) is
[`VideoPlayerComponent.ImmersiveViewingMode.portal`](/documentation/RealityKit/VideoPlayerComponent/ImmersiveViewingMode-swift.enum/portal). The first component
specifies the width and the second component specifies the height,
both in meters.

The default value is `[1.0, 0.5625]`, which produces a 16:9 aspect
ratio.

You can assign a new value before immersive playback transitions to
portal mode, or while playback is already in portal mode to resize
the portal in place. Both components must be greater than zero; if
you assign a non-positive width or height, the property keeps its
previous value.

```swift
var component = VideoPlayerComponent(avPlayer: player)

// Use a 4:3 immersive portal that's one meter wide.
component.portalSize = [1.0, 0.75]

// Render the immersive video into a portal window.
component.desiredImmersiveViewingMode = .portal
```

This property doesn’t apply to spatial videos.

---

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)