Skip to content

[pull] main from tldraw:main#563

Merged
pull[bot] merged 1 commit into
code:mainfrom
tldraw:main
May 28, 2026
Merged

[pull] main from tldraw:main#563
pull[bot] merged 1 commit into
code:mainfrom
tldraw:main

Conversation

@pull

@pull pull Bot commented May 28, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

In order to let SDK consumers disable video autoplay across the board
without subclassing `VideoShapeUtil`, this PR adds a top-level
`allowVideoAutoplay` option to `TldrawOptions`. The host opt-out acts as
a ceiling, not a floor: when `false`, no video autoplays regardless of
its per-shape `autoplay` prop; when `true` (the default, preserving
existing behavior), each shape's per-shape `autoplay` prop is respected.
The `prefers-reduced-motion` check at the render site continues to apply
independently.

```tsx
<Tldraw options={{ allowVideoAutoplay: false }} />
```

### Behavior matrix

| `TldrawOptions.allowVideoAutoplay` | `shape.props.autoplay` | Result |
| ---------------------------------- | ---------------------- |
--------------- |
| `true` (default) | `true` | Autoplays |
| `true` (default) | `false` | Does not play |
| `false` | `true` | Does not play |
| `false` | `false` | Does not play |

So `allowVideoAutoplay: false` is a global opt-out for the host app — it
never forces every video to play. The per-shape prop remains the way
users opt individual shapes in or out when autoplay is allowed at the
host level.

Closes [#8915](#8915).

### Change type

- [x] \`feature\`

### Test plan

1. Create a tldraw editor with \`<Tldraw options={{ allowVideoAutoplay:
false }} />\`.
2. Drop a video file onto the canvas — confirm it does not start playing
automatically.
3. Click into the video to edit, press play — confirm the user can still
play it manually.
4. With the default option (or \`allowVideoAutoplay: true\`), drop a
video and confirm it still autoplays as before.
5. With the default option, set \`shape.props.autoplay = false\` on an
individual video — confirm only that shape stops autoplaying while
others still autoplay.

### Release notes

- Add an \`allowVideoAutoplay\` option to \`TldrawOptions\`. When set to
\`false\`, no video shape autoplays regardless of its per-shape
\`autoplay\` prop — including pasted and restored shapes. Defaults to
\`true\`.

### API changes

- Added \`TldrawOptions.allowVideoAutoplay: boolean\` (default
\`true\`).

### Code changes

| Section         | LOC change |
| --------------- | ---------- |
| Core code       | +18 / -1   |
| Automated files | +2 / -0    |
| Documentation   | +7 / -0    |

---------

Co-authored-by: Max Drake <maxdrake46@gmail.com>
@pull pull Bot locked and limited conversation to collaborators May 28, 2026
@pull pull Bot added the ⤵️ pull label May 28, 2026
@pull pull Bot merged commit 0f6272f into code:main May 28, 2026
@pull pull Bot had a problem deploying to bemo-canary May 28, 2026 09:13 Failure
@pull pull Bot had a problem deploying to deploy-staging May 28, 2026 09:13 Error
@pull pull Bot had a problem deploying to deploy-production May 28, 2026 09:13 Failure
@pull pull Bot had a problem deploying to npm deploy May 28, 2026 09:13 Failure
@pull pull Bot had a problem deploying to vsce publish May 28, 2026 09:13 Failure
@pull pull Bot had a problem deploying to npm deploy May 28, 2026 09:13 Failure
@pull pull Bot had a problem deploying to bemo-canary May 28, 2026 09:13 Failure
@pull pull Bot had a problem deploying to deploy-staging May 28, 2026 09:13 Failure
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant