Repository navigation
media-preview: try unmuted autoplay before falling back to muted - #340855
ANIL KUMAR MEENA (anilkumarmeena) wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The implementation matches the documented behavior without affecting disabled-autoplay behavior.
0 open findings
What changed in this PR
Updates video previews to prefer autoplay with sound and fall back to muted playback when blocked.
Changes:
- Uses explicit
play()calls with a muted fallback. - Updates the autoplay setting description.
| File | Description |
|---|---|
extensions/media-preview/media/videoPreview.js |
Implements sound-first autoplay fallback. |
extensions/media-preview/package.nls.json |
Clarifies autoplay behavior. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
ANIL KUMAR MEENA (@anilkumarmeena) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
1 similar comment
|
ANIL KUMAR MEENA (@anilkumarmeena) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
When
mediaPreview.video.autoPlayis enabled, the video preview always mutes the video (video.muted = settings.autoplay), even in environments where autoplay with sound is allowed.This change tries to autoplay with sound first and only falls back to muted playback if the browser rejects
play()withNotAllowedError. The setting description is updated to match.Changes
media/videoPreview.js: replace theautoplay/mutedattributes with an explicitplay()call once the video has loaded, falling back to muted playback when autoplay with sound is blocked.package.nls.json: update themediaPreview.video.autoPlaydescription.Notes
autoplayPolicy: 'user-gesture-required', and opening a file does not count as a gesture inside the newly created webview frame. So on desktop the preview still starts muted today, same as before. The change only matters where autoplay with sound is permitted, and it no longer forces mute unconditionally.autoPlayoff, behavior is unchanged: the video is never muted and plays with sound when the user presses play.How to test
"mediaPreview.video.autoPlay": true..mp4that has an audio track.autoPlaydisabled, press play and check that audio plays.