<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/VideoMaterial",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation13VideoMaterialV"
  },
  "title" : "VideoMaterial"
}
-->

# VideoMaterial

A material that supports animated textures.

```
struct VideoMaterial
```

## Overview

In RealityKit, a *material* is an object that defines the surface properties
of a rendered 3D object. A `VideoMaterial` is a material that maps a movie
file on to the surface of an entity. Video materials are *unlit*, which
means that scene lighting doesn’t affect them. Video materials support
transparency if the source video’s file format also supports transparency.

Video materials use an
<doc://com.apple.documentation/documentation/AVFoundation/AVPlayer> instance
to control movie playback. You can use any movie file format that
<doc://com.apple.documentation/documentation/AVFoundation/AVPlayer> supports
to create a video material. To control playback of the material’s video, use
the [`avPlayer`](/documentation/RealityKit/VideoMaterial/avPlayer) property, which offers methods like
<doc://com.apple.documentation/documentation/AVFoundation/AVPlayer/play()>
and
<doc://com.apple.documentation/documentation/AVFoundation/AVPlayer/pause()>.

The following code demonstrates how to create and start playing a video
material using a movie file from your application bundle.

```swift
// Create a URL that points to the movie file.
if let url = Bundle.main.url(forResource: "MyMovie", withExtension: "mp4") {

    // Create an AVPlayer instance to control playback of that movie.
    let player = AVPlayer(url: url)

    // Instantiate and configure the video material.
    let material = VideoMaterial(avPlayer: player)

    // Configure audio playback mode.
    material.controller.audioInputMode = .spatial

    // Create a new model entity using the video material.
    let modelEntity = ModelEntity(mesh: cube, materials: [material])

    // Start playing the video.
    player.play()
}
```

To see an example of using a video texture in RealityKit, see
<doc://com.apple.documentation/documentation/RealityKit/creating-a-game-with-scene-understanding>.

## Topics

### Creating a video material

[`init(avPlayer:)`](/documentation/RealityKit/VideoMaterial/init(avPlayer:))

Creates a new video material.

### Controlling playback

[`avPlayer`](/documentation/RealityKit/VideoMaterial/avPlayer)

The material’s video playback controller.

[`controller`](/documentation/RealityKit/VideoMaterial/controller)

An object that configures framework-specific video options.



---

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)