<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NowPlaying",
  "identifier" : "/documentation/NowPlaying/AnimatedArtwork",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Now Playing"
    ],
    "preciseIdentifier" : "s:10NowPlaying15AnimatedArtworkV"
  },
  "title" : "AnimatedArtwork"
}
-->

# AnimatedArtwork

Animated artwork for the media item with video and preview support.

```
struct AnimatedArtwork
```

## Overview

The following example shows how to attach animated artwork to a content value:

```swift
let content = MusicContent(
    id: track.id,
    songTitle: track.title,
    artistName: track.artist,
    albumName: track.album,
    type: .audio,
    duration: .finite(track.duration),
    artwork: Artwork(id: track.artworkID) { size in
        let data = await loadArtworkData(size: size)
        return try ArtworkRepresentation(data: data)
    },
    animatedArtwork: AnimatedArtwork(
        id: "animated-789",
        supportedAspectRatios: [.square, .tall],
        preview: { size, ratio in
            let data = await loadPreviewData(size: size, ratio: ratio)
            return try ArtworkRepresentation(data: data)
        },
        video: { size, ratio in
            await loadVideoURL(size: size, ratio: ratio)
        }
    )
)
```

## Topics

### Initializers

[`init(id: String, supportedAspectRatios: [AnimatedArtwork.AspectRatio], preview: (CGSize, AnimatedArtwork.AspectRatio) async throws -> ArtworkRepresentation, video: (CGSize, AnimatedArtwork.AspectRatio) async throws -> URL)`](/documentation/NowPlaying/AnimatedArtwork/init(id:supportedAspectRatios:preview:video:))

Creates an animated artwork whose preview and video assets load on demand.

### Instance Properties

[`let id: String`](/documentation/NowPlaying/AnimatedArtwork/id)

A unique identifier for this animated artwork asset.

[`let supportedAspectRatios: [AnimatedArtwork.AspectRatio]`](/documentation/NowPlaying/AnimatedArtwork/supportedAspectRatios)

The aspect ratios this artwork supports.

### Type Properties

[`static let compatibleAspectRatios: [AnimatedArtwork.AspectRatio]`](/documentation/NowPlaying/AnimatedArtwork/compatibleAspectRatios)

The aspect ratios compatible with the current device.

### Enumerations

[`enum AspectRatio`](/documentation/NowPlaying/AnimatedArtwork/AspectRatio)

The aspect ratio of the animated artwork.

## Relationships

### Conforms To

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

---

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)