Summary: | Autoplay Muted Videos Don't Play When Outside Viewport | ||
---|---|---|---|
Product: | WebKit | Reporter: | Neil Daniels <neil.here> |
Component: | Media | Assignee: | Jer Noble <jer.noble> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | buildbot, commit-queue, eric.carlson, jer.noble, rniwa, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Other | ||
Hardware: | iPhone / iPad | ||
OS: | iOS 11 | ||
Attachments: |
Description
Neil Daniels
2017-08-18 17:45:38 PDT
It's actually more likely related to <https://bugs.webkit.org/show_bug.cgi?id=168268>, as it seems to only happen with <video><source /></video> elements, and not <video src=""></video> elements. It looks like we're not calling prepareForLoad() in the <source /> selection case; prepareForLoad() is what sets the state PlatformSessionManager state to Autoplaying, thus breaking restoring that state to Autoplaying when becoming visible again. Aha, we set the PlatformMediaSession's state to Autoplaying inside prepareForLoad(), which also sets the m_autoplaying flag to true (as specified in the "media element load algorithm" section of the HTML spec. But the autoplaying flag is initially true (as specified in just before same), so we should probably notify the client that we're autoplaying on HTMLMediaElement creation. Created attachment 318657 [details]
Patch
Comment on attachment 318657 [details] Patch Attachment 318657 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/4355274 New failing tests: media/video-restricted-invisible-autoplay-not-allowed.html media/video-restricted-invisible-autoplay-allowed-if-audible.html Created attachment 318664 [details]
Archive of layout-test-results from ews100 for mac-elcapitan
The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Comment on attachment 318657 [details] Patch Attachment 318657 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/4355342 New failing tests: media/video-restricted-invisible-autoplay-not-allowed.html media/video-restricted-invisible-autoplay-allowed-if-audible.html Created attachment 318666 [details]
Archive of layout-test-results from ews106 for mac-elcapitan-wk2
The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Comment on attachment 318657 [details] Patch Attachment 318657 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/4355333 New failing tests: media/video-concurrent-visible-playback.html media/video-restricted-invisible-autoplay-not-allowed.html media/video-restricted-invisible-autoplay-allowed-if-audible.html Created attachment 318668 [details]
Archive of layout-test-results from ews113 for mac-elcapitan
The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews113 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Comment on attachment 318657 [details] Patch Attachment 318657 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/4355381 New failing tests: media/video-restricted-invisible-autoplay-not-allowed.html media/video-restricted-invisible-autoplay-allowed-if-audible.html Created attachment 318669 [details]
Archive of layout-test-results from ews125 for ios-simulator-wk2
The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews125 Port: ios-simulator-wk2 Platform: Mac OS X 10.12.5
Created attachment 318699 [details]
Patch
Comment on attachment 318699 [details] Patch Clearing flags on attachment: 318699 Committed r221016: <http://trac.webkit.org/changeset/221016> All reviewed patches have been landed. Closing bug. |