Only consider autoplay interference in the first 10 seconds of playback.
authormrajca@apple.com <mrajca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Mar 2017 00:44:42 +0000 (00:44 +0000)
committermrajca@apple.com <mrajca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Mar 2017 00:44:42 +0000 (00:44 +0000)
commit90236870f0ee662f0994a2c19b903cc416d1c58b
tree474a02c70ab2121f03c8d8bc12c07f99d6b03e56
parentffc0d452ed1a8d09d5b37b4b1361516508189990
Only consider autoplay interference in the first 10 seconds of playback.
https://bugs.webkit.org/show_bug.cgi?id=169455

Reviewed by Alex Christensen.

If the media duration is relatively long, say, 10 minutes, and you pause 5 minutes in, that's
probably not a strong indication users may not want auto-play. This patch limits interference
events to the first 10 seconds of automatic playback.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::play):
(WebCore::HTMLMediaElement::playInternal):
(WebCore::HTMLMediaElement::pauseInternal):
(WebCore::HTMLMediaElement::setMuted):
(WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
(WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
(WebCore::HTMLMediaElement::userDidInterfereWithAutoplay):
(WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture):
(WebCore::HTMLMediaElement::pageMutedStateDidChange):
* html/HTMLMediaElement.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@213687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h