Repository navigation
feat: allow setting autoplayPolicy in webPreferences - #16396
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
nornagon
force-pushed
the
autoplay-policy
branch
from
January 14, 2019 22:22
cccac2a to
b1b94e8
Compare
miniak
reviewed
Jan 14, 2019
nornagon
force-pushed
the
chromium-upgrade/72
branch
from
January 14, 2019 23:03
45b7838 to
4910487
Compare
nornagon
force-pushed
the
autoplay-policy
branch
from
January 14, 2019 23:23
b1b94e8 to
dd16948
Compare
deepak1556
reviewed
Jan 15, 2019
| prefs->navigate_on_drag_drop = | ||
| IsEnabled("navigateOnDragDrop", false /* default_value */); | ||
| prefs->autoplay_policy = content::AutoplayPolicy::kNoUserGestureRequired; | ||
| GetAsAutoplayPolicy(&preference_, "autoplayPolicy", &prefs->autoplay_policy); |
Member
There was a problem hiding this comment.
This could be
if (!GetAsAutoplayPolicy(&preference_, "autoplayPolicy", &prefs->autoplay_policy)) {
prefs->autoplay_policy = content::AutoplayPolicy::kNoUserGestureRequired;
}
|
Release Notes Persisted
|
nornagon
added a commit
that referenced
this pull request
Jan 15, 2019
nornagon
added a commit
that referenced
this pull request
Jan 22, 2019
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.
Description of Change
Chrome 71 shipped with the autoplay policy set to require user gesture by default. I don't think this default makes sense for electron, so I've made the default in electron be kNoUserGestureRequired, but I can imagine app devs wanting to set a different option. This exposes that API as
{autoplayPolicy: "user-gesture-required"}in webPreferences.Checklist
npm testpassesRelease Notes
Notes: Allowed configuring of media autoplay policy via webPreferences.