RESOLVED FIXED 175748
Autoplay Muted Videos Don't Play When Outside Viewport
https://bugs.webkit.org/show_bug.cgi?id=175748
Summary Autoplay Muted Videos Don't Play When Outside Viewport
Neil Daniels
Reported 2017-08-18 17:45:38 PDT
Created attachment 318565 [details] Webarchive of mentioned test case. I have various <video autoplay loop muted playsinline> on a single page, on iOS 11 (15A5354b, iPhone and iPad) only the videos that are within the viewport automatically play. A test case exists at this page: https://www.fomopop.com/html5-video-test/ (a webarchive is attached as well, for posterity). If you view on an iPhone running iOS 10.x, all 5 of the videos will play. On an iPhone running iOS 11 (15A5354b), only the first 2 videos will play. This might be related to https://bugs.webkit.org/show_bug.cgi?id=170610 , but I'm not sure if that's in a public iOS build yet.
Attachments
Webarchive of mentioned test case. (354.91 KB, application/x-webarchive)
2017-08-18 17:45 PDT, Neil Daniels
no flags
Patch (6.13 KB, patch)
2017-08-21 12:09 PDT, Jer Noble
no flags
Archive of layout-test-results from ews100 for mac-elcapitan (1.20 MB, application/zip)
2017-08-21 13:05 PDT, Build Bot
no flags
Archive of layout-test-results from ews106 for mac-elcapitan-wk2 (1.38 MB, application/zip)
2017-08-21 13:33 PDT, Build Bot
no flags
Archive of layout-test-results from ews113 for mac-elcapitan (2.15 MB, application/zip)
2017-08-21 13:40 PDT, Build Bot
no flags
Archive of layout-test-results from ews125 for ios-simulator-wk2 (10.63 MB, application/zip)
2017-08-21 13:56 PDT, Build Bot
no flags
Patch (8.88 KB, patch)
2017-08-21 16:57 PDT, Jer Noble
no flags
Jer Noble
Comment 1 2017-08-18 17:49:25 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.
Jer Noble
Comment 2 2017-08-18 17:50:35 PDT
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.
Jer Noble
Comment 3 2017-08-18 18:02:29 PDT
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.
Radar WebKit Bug Importer
Comment 4 2017-08-18 18:16:41 PDT
Jer Noble
Comment 5 2017-08-21 12:09:03 PDT
Build Bot
Comment 6 2017-08-21 13:05:00 PDT Comment hidden (obsolete)
Build Bot
Comment 7 2017-08-21 13:05:01 PDT Comment hidden (obsolete)
Build Bot
Comment 8 2017-08-21 13:33:31 PDT Comment hidden (obsolete)
Build Bot
Comment 9 2017-08-21 13:33:32 PDT Comment hidden (obsolete)
Build Bot
Comment 10 2017-08-21 13:40:43 PDT Comment hidden (obsolete)
Build Bot
Comment 11 2017-08-21 13:40:44 PDT Comment hidden (obsolete)
Build Bot
Comment 12 2017-08-21 13:56:30 PDT Comment hidden (obsolete)
Build Bot
Comment 13 2017-08-21 13:56:33 PDT Comment hidden (obsolete)
Jer Noble
Comment 14 2017-08-21 16:57:51 PDT
WebKit Commit Bot
Comment 15 2017-08-22 09:13:26 PDT
Comment on attachment 318699 [details] Patch Clearing flags on attachment: 318699 Committed r221016: <http://trac.webkit.org/changeset/221016>
WebKit Commit Bot
Comment 16 2017-08-22 09:13:27 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.