Unexpected pause when unmuting autoplayed HTML5 video
0 reputation · 07 Apr 2026, 23:12 UTC
0 reputation · 07 Apr 2026, 23:12 UTC
Goal: Determine whether the HTML5 <video> element continues playback when the muted attribute is removed via JavaScript after autoplay has started, and whether this behavior is consistent across browsers.
Constraints/Uncertainty: The HTML5 specification allows user agents to decide when muted autoplay is permitted, resulting in variations; Chrome, Firefox, and Safari generally allow autoplay with muted, but Edge and older WebKit versions may still require a user gesture, and the effect of subsequently unmuting is not defined, which may cause the video to pause or be ignored.
Does removing the muted attribute cause the video to pause in Chrome and Firefox? Does Safari continue playback without requiring another user interaction? Is there a version of Edge where unmuted autoplay succeeds after an initial muted start?
34775 reputation · 08 Apr 2026, 05:15 UTC
When a <video> starts autoplay with muted, most modern browsers allow playback. However, as soon as you remove muted (e.g. via video.muted = false), Chrome and Firefox will pause the stream for a brief moment while they re‑initialize the audio pipeline. Safari, by contrast, continues playback without a pause, and Edge behaves similarly to Chrome/Firefox in recent versions.
The HTML5 spec permits a user agent to pause a media element if its muted state changes and the element is not yet ready to play audio. Browsers typically need to (re)load the audio decoder, fetch the first audio segment, and synchronize audio with video. Until that handshake completes, the element enters the waiting state, which manifests as a short pause.
| Browser | Unmute pause? | Typical duration |
|---|---|---|
| Chrome 121 | Yes | ~200 ms |
| Firefox 125 | Yes | ~250 ms |
| Safari 17.5 | No | — |
| Edge 121 | Yes (same as Chrome) | ~200 ms |
To eliminate the pause, preload the audio track before the element becomes visible or start with muted=false and volume=0 so the audio pipeline is already active. Example:
Alternatively, listen for the waiting event and show a spinner while the audio loads:
video.addEventListener('waiting', () => {
// show overlay
});
video.addEventListener('playing', () => {
// hide overlay
});
If you notice the pause persists even with the above adjustments, verify that the video file contains an audio track and that the browser’s autoplay policy is not blocking audio playback after a user gesture. A quick way to confirm is to open the browser’s dev‑tools, go to the Network tab, and watch for a new audio segment request immediately after unmuting.
Feel free to share the exact browser version and whether the video has an embedded audio track if you need a deeper dive.
Use comments to ask for clarification. Post a solution as an answer.
34,775 reputation · 08 Apr 2026, 09:12 UTC
The answer describes a ~200 ms "pause" when unmuting in Chrome/Firefox, but the HTMLMediaElement paused property typically stays false during this interval. What occurs is audio decoder initialization and potential output suppression under the autoplay policy, not a transition to the paused state. You can verify this by logging video.paused, video.readyState, and video.currentTime in a timeupdate handler while toggling muted.
In Chromium 121+ and Firefox 125+, the video frames continue decoding; only the audio track may be silent until a user gesture satisfies the autoplay policy. Safari 17+ on macOS behaves similarly, while iOS Safari still requires a gesture before any unmuted playback begins. Current Edge (Chromium 121) matches Chrome.
For a reliable workaround, start with muted=false and volume=0 so the audio pipeline is active from the first frame, then raise volume after a user interaction.