player: doesn't respect initial volume and muted props

Current Behavior:

When embedding a <media-player> in Svelte with volume set to 0 and muted set to true, the player starts at full volume.

If you bind:this={player} and programatically set player.muted and player.volume it works.

Expected Behavior:

The player should start muted.

Steps To Reproduce:

    <media-player
        class="w-full"
        src={props.src}
        playsInline
        bind:this={player}
        muted={true}
        >
        <media-provider></media-provider>
    </media-player>

Reproduction Link: StackBlitz example

Environment:

Example:

  • Framework: Svelte
  • Meta Framework: SvelteKit
  • Node: 20.0.0
  • OS: Windows@11
  • Browser: Chrome@128

Anything Else?

image

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 6
  • Comments: 19 (2 by maintainers)

Commits related to this issue

Most upvoted comments

Hi, sorry in advance if i can be boring. I’ve commented on this issue a few times, but haven’t received any response so far. I’m wondering if this is still on your radar or if there’s anyone maintaining this part of the project.

This problem is still relevant and I’d really appreciate any update or guidance. If there’s anything I can do to help move it forward, I’d be happy to contribute.

Thanks for reporting! This is a hydration bug with Svelte 4 as mentioned in the docs. You can either upgrade to Svelte 5 or you can mount the player client-side only by dynamically importing it.

👉 Section in docs mentioning this issue.

this bug is not present in v1.11.30-next first version affected is v1.12.0-next

i am using this in my nuxt app to only have 1 player unmuted