<!--
{
  "availability" : [
    "iOS: 26.4.0 -",
    "iPadOS: 26.4.0 -",
    "macCatalyst: 26.4.0 -",
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ImmersiveMediaSupport",
  "identifier" : "/documentation/ImmersiveMediaSupport/SetCameraCommand",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Immersive Media Support"
    ],
    "preciseIdentifier" : "s:21ImmersiveMediaSupport16SetCameraCommandV"
  },
  "title" : "SetCameraCommand"
}
-->

# SetCameraCommand

A command type for immersive camera switching during playback.

```
struct SetCameraCommand
```

## Overview

The property `cameraID` has been added to this type to hold camera identifier string, so that we can switch from one immersive camera to another using these camera identifiers.

## Topics

### Initializers

[`init(from: any Decoder) throws`](/documentation/ImmersiveMediaSupport/SetCameraCommand/init(from:))

### Instance Properties

[`var cameraID: String`](/documentation/ImmersiveMediaSupport/SetCameraCommand/cameraID)

The camera ID to use for the duration of this command.

[`var duration: CMTime`](/documentation/ImmersiveMediaSupport/SetCameraCommand/duration)

The duration of the command.

[`var id: Int`](/documentation/ImmersiveMediaSupport/SetCameraCommand/id)

A unique command ID for the entire immersive media file.

[`var offset: CMTime?`](/documentation/ImmersiveMediaSupport/SetCameraCommand/offset)

Reserved for later use.

[`var time: CMTime`](/documentation/ImmersiveMediaSupport/SetCameraCommand/time)

The time this command starts during playback.

### Instance Methods

[`func encode(to: any Encoder) throws`](/documentation/ImmersiveMediaSupport/SetCameraCommand/encode(to:))

### Structures

[`struct Overrides`](/documentation/ImmersiveMediaSupport/SetCameraCommand/Overrides-swift.struct)

Override camera/venue params

### Initializers

[`init(id: Int, time: CMTime, cameraID: String)`](/documentation/ImmersiveMediaSupport/SetCameraCommand/init(id:time:cameraID:))

Creates a command with a specific ID, cameraID and start time.

[`init(id: Int, time: CMTime, cameraID: String, overrides: SetCameraCommand.Overrides?)`](/documentation/ImmersiveMediaSupport/SetCameraCommand/init(id:time:cameraID:overrides:))

Creates a command with a specific ID, cameraID, start time and override parameters.

### Instance Properties

[`var overrides: SetCameraCommand.Overrides?`](/documentation/ImmersiveMediaSupport/SetCameraCommand/overrides-swift.property)

The override parameters for the camera.

## Relationships

### Conforms To

[`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)