<!--
{
  "availability" : [
    "LivePhotosKit JS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "LivePhotosKitJS",
  "identifier" : "/documentation/LivePhotosKitJS/LivePhotosKit.Player/updateSize",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "LivePhotosKit JS"
    ],
    "preciseIdentifier" : "instm/LivePhotosKit.Player/updateSize"
  },
  "title" : "updateSize"
}
-->

# updateSize

Updates the size of the player.

```
void updateSize();
```

## Parameters

`forceOrDisplayWidth`

If a Boolean value, indicates whether the player should be forced to render. If a number value, specifies the width of the player.

`displayHeight`

The height of the player. The default uses the photo’s aspect ratio to calculate the display height.

## Discussion

Call this method when the size of the element changes—for example, when you change the size directly or when the element size changes depending on the layout of other elements. Also call this method when attaching the player to the DOM or changing the `display` style from `none`. Since the player handles window resize events itself, you don’t need to call this method when the window size changes.

---

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)