portalSize
The size of the portal window for immersive video playback, in meters.
Declaration
var portalSize: SIMD2<Float> { get set }Discussion
Use this property to control the dimensions of the portal window when desiredImmersiveViewingMode is VideoPlayerComponent.ImmersiveViewingMode.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.
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 = .portalThis property doesn’t apply to spatial videos.