Notify clients when the user plays media (with a user gesture) otherwise prevented from autoplaying.
Created attachment 299637 [details] Patch
Created attachment 299644 [details] Patch
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.
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.
(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.
Created attachment 299762 [details] Patch
Created attachment 299773 [details] Patch
Created attachment 299779 [details] Patch
Comment on attachment 299779 [details] Patch Clearing flags on attachment: 299779 Committed r211193: <http://trac.webkit.org/changeset/211193>
All reviewed patches have been landed. Closing bug.
Reverted r211193 for reason: This change broke internal builds. Committed r211200: <http://trac.webkit.org/changeset/211200>
Created attachment 299820 [details] Patch
Comment on attachment 299820 [details] Patch Clearing flags on attachment: 299820 Committed r211226: <http://trac.webkit.org/changeset/211226>