Skip to content

The muted attribute does not render in the video tag Svelte-5 #15014

@tbpatj

Description

@tbpatj

Describe the bug

Upgraded from svelte-4 to svelte-5 and found that the muted attribute does not render in the video tag which prevents autoplay on Safari when using client side routing. This is also currently happening in my chrome browser as well.

This is a problem as it makes autoplay not possible by default. Browsers won't start a video automatically if the video isn't muted.

Looks like this was an issue prior for svelte-3 and svelte-4
#6536

Reproduction

try to add a video tag with the attribute muted, when you go into the dev tools it doesn't render it in the actual html. It does appear in the properties, but I'm still getting issues with autoplay. I assume this is related to the muted attribute not actually being rendered?

Image Image

It appears that even the muted property is always true even when explicitly passing false too. not sure if this is intended behavior but furthers my suspicion around the muted attribute

Image Image

Logs

System Info

System:
    OS: macOS 13.7.1
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 70.71 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.14.0 - ~/.nvm/versions/node/v20.14.0/bin/node
    npm: 10.7.0 - ~/.nvm/versions/node/v20.14.0/bin/npm
  Browsers:
    Brave Browser: 131.1.73.104
    Safari: 18.1.1
  npmPackages:
    svelte: ^5.0.0 => 5.10.0

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions