Disable autoplay when user gesture is required for media playback
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Jun 2012 20:37:16 +0000 (20:37 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Jun 2012 20:37:16 +0000 (20:37 +0000)
commit6867b4efc7063e7f069234a2e41ca468c21e2f48
tree84a3adc7026868558789d5518da8c81b6537bf2b
parent97d5a54693ea5b6a5a21dc0fcc39a252e81cb880
Disable autoplay when user gesture is required for media playback
https://bugs.webkit.org/show_bug.cgi?id=88897

Patch by Min Qin <qinmin@google.com> on 2012-06-12
Reviewed by Adam Barth.

When user gesture is required for media playback, we should block autoplay.
Otherwise, people will use autoplay instead of video.play() to bypass the gesture requirement.
Test: media/no-autoplay-with-user-gesture-requirement.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setReadyState):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@120112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/media/no-autoplay-with-user-gesture-requirement-expected.txt [new file with mode: 0644]
LayoutTests/media/no-autoplay-with-user-gesture-requirement.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp