Summary: | TAKE 2: Pass down website autoplay policies to media elements | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Matt Rajca <mrajca> | ||||||
Component: | Media | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue | ||||||
Priority: | P2 | ||||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Matt Rajca
2017-01-23 18:28:22 PST
Created attachment 299566 [details]
Patch
Comment on attachment 299566 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=299566&action=review > Source/WebCore/loader/DocumentLoader.h:471 > + std::optional<bool> m_audioPlaybackRequiresUserGesture; > + std::optional<bool> m_videoPlaybackRequiresUserGesture; I think this should be a 3-state enum, probably with a different name like m_audioPlaybackPolicy. enum class AutoplayPolicy { RequireUserGesture, AutoPlay, AutoPlayWithoutSound, Default, <-- This name might need to be more descriptive indicating that the policy hasn't been set by the WebsitePolicies so default to the Settings value. Maybe just a comment explaining this. etc. } These two could probably even be made into one enum > Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:820 > +#if PLATFORM(MAC) Let's get rid of this now that it doesn't do anything for other platforms. > Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:823 > + documentLoader->setAudioPlaybackRequiresUserGesture(std::optional<bool>()); std::nullopt Created attachment 299613 [details]
Patch
(In reply to comment #2) > Comment on attachment 299566 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=299566&action=review > > > Source/WebCore/loader/DocumentLoader.h:471 > > + std::optional<bool> m_audioPlaybackRequiresUserGesture; > > + std::optional<bool> m_videoPlaybackRequiresUserGesture; > > I think this should be a 3-state enum, probably with a different name like > m_audioPlaybackPolicy. > enum class AutoplayPolicy { > RequireUserGesture, > AutoPlay, > AutoPlayWithoutSound, > Default, <-- This name might need to be more descriptive indicating that > the policy hasn't been set by the WebsitePolicies so default to the Settings > value. Maybe just a comment explaining this. > etc. > } > These two could probably even be made into one enum Done. > > > Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:820 > > +#if PLATFORM(MAC) > > Let's get rid of this now that it doesn't do anything for other platforms. Okay, and I made the tests run on iOS as well. > > > Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:823 > > + documentLoader->setAudioPlaybackRequiresUserGesture(std::optional<bool>()); > > std::nullopt Not necessary with the changes above. Comment on attachment 299613 [details] Patch Clearing flags on attachment: 299613 Committed r211097: <http://trac.webkit.org/changeset/211097> All reviewed patches have been landed. Closing bug. *** Bug 167346 has been marked as a duplicate of this bug. *** *** Bug 167132 has been marked as a duplicate of this bug. *** *** Bug 167325 has been marked as a duplicate of this bug. *** |