Autoplay & audio
Starting mute and volume are decided in one pass, most specific first:
| If… | Starts at |
|---|---|
The video sets muted or volume | That exact value - explicit props always win |
Playback starts from a real gesture (clicking a lazy placeholder, a stage idle-click, video-toggle) | The page's shared audio preference |
Playback starts with no gesture (autoplay, playInView scrolling into view) | Muted - unless a gesture already produced unmuted playback this page load |
| A playlist reaches it via skip / auto-advance | The outgoing video's own live mute/volume |
The shared preference
One localStorage value for the whole site, not one per player - it survives reloads and follows the viewer from page to page. It updates whenever a viewer presses mute or drags a volume slider on any player, so a newly-mounted player starts wherever the viewer last left things rather than resetting to full volume. A player that sets muted or volume explicitly opts out entirely.
Gesture-less playback is always muted
Browsers block unmuted playback that no user gesture asked for, so autoplay and playInView start muted whatever the stored preference says. The rule is scoped to the current page load: once a real gesture has produced unmuted playback, browsers allow further unmuted programmatic playback, so it stops applying until the next reload.
<!-- starts muted regardless of the shared preference -->
<VideoCard src="..." autoplay />
<!-- opts out of the shared preference in both directions -->
<VideoCard src="..." :muted="false" :volume="0.5" />
<ml-video-card src="..." autoplay></ml-video-card>
<!-- `muted="false"` would arrive as the truthy string "false" - use the property -->
<ml-video-card id="loud" src="..."></ml-video-card>
<script type="module">
const el = document.getElementById('loud')
el.muted = false
el.volume = 0.5
</script>
Playlist skips carry sound forward
playNext/playPrevious and auto-advance are the one exception to following the shared preference: they carry the outgoing video's live mute and volume onto the next one. Skipping a muted video doesn't suddenly turn sound on, and skipping one you unmuted doesn't silence the next.