0

[Blink>Media] Moving autoplay logic to AutoplayPolicy

This CL moves autoplay code from HTMLMediaElement to the
AutoplayPolicy class, which helps decoupling the autoplay logic
from HTMLMediaElement.

BUG=712606

Review-Url: https://codereview.chromium.org/2813303005
Cr-Commit-Position: refs/heads/master@{#466137}
This commit is contained in:
zqzhang
2017-04-20 14:24:05 -07:00
committed by Commit bot
parent ac9a37e939
commit 12d76adf4b
9 changed files with 480 additions and 291 deletions

@ -14,6 +14,13 @@ There are two ways of initiating autoplay:
* Autoplay by `play()` method: Explicitly calling the `play()` method without
user gesture.
All the autoplay logic is handled by the AutoplayPolicy class. When the media
element wants to perform some action (like unmute, autoplay by attribute or
`play()` method), it will send a request to AutoplayPolicy, and if the request
is approved, the element can autoplay, otherwise it should be paused. Also the
media element should inform the AutoplayPolicy about relevant changes such as
"the element has been moved to a new document".
## User gesture lock
Each media element has a user gesture lock. If the element is allowed to