RESOLVED FIXED 167390
Notify clients when the user plays media otherwise prevented from autoplaying
https://bugs.webkit.org/show_bug.cgi?id=167390
Summary Notify clients when the user plays media otherwise prevented from autoplaying
Matt Rajca
Reported 2017-01-24 15:09:53 PST
Notify clients when the user plays media (with a user gesture) otherwise prevented from autoplaying.
Attachments
Patch (21.45 KB, patch)
2017-01-24 15:14 PST, Matt Rajca
no flags
Patch (21.48 KB, patch)
2017-01-24 15:50 PST, Matt Rajca
mrajca: review-
mrajca: commit-queue-
Patch (25.09 KB, patch)
2017-01-25 16:13 PST, Matt Rajca
no flags
Patch (25.06 KB, patch)
2017-01-25 17:09 PST, Matt Rajca
no flags
Patch (25.56 KB, patch)
2017-01-25 17:42 PST, Matt Rajca
no flags
Patch (32.01 KB, patch)
2017-01-26 11:05 PST, Matt Rajca
no flags
Matt Rajca
Comment 1 2017-01-24 15:14:19 PST
Matt Rajca
Comment 2 2017-01-24 15:50:55 PST
Alex Christensen
Comment 3 2017-01-24 18:57:15 PST
Comment on attachment 299644 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=299644&action=review > Source/WebKit2/UIProcess/API/C/WKPageUIClient.h:729 > WKRequestPointerLockCallback requestPointerLock; > WKDidLosePointerLockCallback didLosePointerLock; > + WKDidPlayMediaPreventedFromPlayingWithoutUserGesture didPlayMediaPreventedFromPlayingWithoutUserGesture; I'm not sure if we need to make another version of the client to maintain binary compatibility. It seems like the pointer lock stuff was added recently enough that maybe the answer is no.
Alex Christensen
Comment 4 2017-01-25 15:37:10 PST
Comment on attachment 299644 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=299644&action=review > Source/WebKit2/UIProcess/WebPageProxy.messages.in:441 > + DidPlayMediaPreventedFromPlayingWithoutUserGesture() This name is a bit verbose, but I can't think of anything better. > Tools/TestWebKitAPI/Tests/WebKit2/js-play-with-controls.html:5 > + setTimeout(function() { Could we remove this setTimeout? > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm:217 > +TEST(WebKit2, WebsitePoliciesPlayAfterPreventedAutoplay) It would be good to test that a video that shouldn't autoplay doesn't call the didPlayMediaPreventedFromPlayingWithoutUserGesture when you play it.
Matt Rajca
Comment 5 2017-01-25 16:13:45 PST
(In reply to comment #4) > Comment on attachment 299644 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=299644&action=review > > > Source/WebKit2/UIProcess/WebPageProxy.messages.in:441 > > + DidPlayMediaPreventedFromPlayingWithoutUserGesture() > > This name is a bit verbose, but I can't think of anything better. > > > Tools/TestWebKitAPI/Tests/WebKit2/js-play-with-controls.html:5 > > + setTimeout(function() { > > Could we remove this setTimeout? Done. > > > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm:217 > > +TEST(WebKit2, WebsitePoliciesPlayAfterPreventedAutoplay) > > It would be good to test that a video that shouldn't autoplay doesn't call > the didPlayMediaPreventedFromPlayingWithoutUserGesture when you play it. I'll add one.
Matt Rajca
Comment 6 2017-01-25 16:13:59 PST
Matt Rajca
Comment 7 2017-01-25 17:09:09 PST
Matt Rajca
Comment 8 2017-01-25 17:42:17 PST
WebKit Commit Bot
Comment 9 2017-01-25 18:19:19 PST
Comment on attachment 299779 [details] Patch Clearing flags on attachment: 299779 Committed r211193: <http://trac.webkit.org/changeset/211193>
WebKit Commit Bot
Comment 10 2017-01-25 18:19:23 PST
All reviewed patches have been landed. Closing bug.
Ryan Haddad
Comment 11 2017-01-25 20:25:35 PST
Reverted r211193 for reason: This change broke internal builds. Committed r211200: <http://trac.webkit.org/changeset/211200>
Matt Rajca
Comment 12 2017-01-26 11:05:56 PST
WebKit Commit Bot
Comment 13 2017-01-26 12:42:33 PST
Comment on attachment 299820 [details] Patch Clearing flags on attachment: 299820 Committed r211226: <http://trac.webkit.org/changeset/211226>
WebKit Commit Bot
Comment 14 2017-01-26 12:42:37 PST
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.