<!--
{
  "availability" : [
    "LivePhotosKit JS: 1.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "LivePhotosKitJS",
  "identifier" : "/documentation/LivePhotosKitJS/LivePhotosKit.Player/photo",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "LivePhotosKit JS"
    ],
    "preciseIdentifier" : "instp/LivePhotosKit.Player/photo"
  },
  "title" : "photo"
}
-->

# photo

The renderable, image-bearing DOM element (either an image or a canvas) that the Player consumes to render itself to the screen.

```
attribute HTMLImageElement,HTMLCanvasElement photo;
```

## Discussion

If this property is not populated by an image or canvas, the Player cannot play or render.

You can provide a value for this property in one of several ways:

- Set [`photoSrc`](/documentation/LivePhotosKitJS/LivePhotosKit.Player/photoSrc) to a string URL and wait for the resulting download and decode to complete, at which point the property is populated with the resulting image.
- Set [`photoSrc`](/documentation/LivePhotosKitJS/LivePhotosKit.Player/photoSrc) to an `ArrayBuffer` and wait for the decode to complete, at which point the property is populated with the resulting image.
- Set the property directly to a fully loaded `HTMLImageElement` (such that its `complete` property is `true`).
- Set the property directly to an `HTMLCanvasElement` you have prepared, such that its backing store depicts the photo and that the photo is scaled properly.

Assigning this property directly causes [`photoSrc`](/documentation/LivePhotosKitJS/LivePhotosKit.Player/photoSrc) to be cleared and set back to `null`. Moreover, if [`photoSrc`](/documentation/LivePhotosKitJS/LivePhotosKit.Player/photoSrc) was recently assigned and a network request or asynchronous decoding is still happening; that activity is also canceled.

---

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)