Repository navigation
media-preview: try unmuted autoplay before falling back to muted - #340855
Open
ANIL KUMAR MEENA (anilkumarmeena) wants to merge 2 commits into
Open
ANIL KUMAR MEENA (anilkumarmeena) wants to merge 2 commits into
ANIL KUMAR MEENA (anilkumarmeena) wants to merge 2 commits into
Conversation
Contributor
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.
7 tasks done
Author
|
@microsoft-github-policy-service agree |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.