<!--
{
  "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/init(id:supportedAspectRatios:preview:video:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Now Playing"
    ],
    "preciseIdentifier" : "s:10NowPlaying15AnimatedArtworkV2id21supportedAspectRatios7preview5videoACSS_SayAC0G5RatioOGAA0D14RepresentationVSo6CGSizeV_AItYaYbKc10Foundation3URLVAN_AItYaYbKctcfc"
  },
  "title" : "init(id:supportedAspectRatios:preview:video:)"
}
-->

# init(id:supportedAspectRatios:preview:video:)

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

```
init(id: String, supportedAspectRatios: [AnimatedArtwork.AspectRatio] = [.square], preview previewProvider: @escaping @Sendable (CGSize, AnimatedArtwork.AspectRatio) async throws -> ArtworkRepresentation, video videoProvider: @escaping @Sendable (CGSize, AnimatedArtwork.AspectRatio) async throws -> URL)
```

## Parameters

`id`

A unique identifier for this artwork.

`supportedAspectRatios`

The aspect ratios your app supports.

`previewProvider`

A closure that loads a preview image for the specified size and aspect ratio.

`videoProvider`

A closure that provides a URL to a video file for the specified size and aspect ratio.

---

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)