| Index: Source/core/html/HTMLMediaElement.cpp
|
| diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
|
| index d140bf8db7e8fa433da5a8bb7cc0d143ee1e05e8..e1660f5e3e032962868c3e5171f00f8a0965f863 100644
|
| --- a/Source/core/html/HTMLMediaElement.cpp
|
| +++ b/Source/core/html/HTMLMediaElement.cpp
|
| @@ -2222,6 +2222,25 @@ bool HTMLMediaElement::canPlay() const
|
| return paused() || ended() || m_readyState < HAVE_METADATA;
|
| }
|
|
|
| +void HTMLMediaElement::togglePlayState()
|
| +{
|
| + ASSERT(controls());
|
| + // The activation behavior of a media element that is exposing a user interface to the user
|
| + if (m_mediaController) {
|
| + if (m_mediaController->isRestrained())
|
| + m_mediaController->play();
|
| + else if (m_mediaController->paused())
|
| + m_mediaController->unpause();
|
| + else
|
| + m_mediaController->pause();
|
| + } else {
|
| + if (paused())
|
| + play();
|
| + else
|
| + pause();
|
| + }
|
| +}
|
| +
|
| void HTMLMediaElement::mediaPlayerDidAddTextTrack(WebInbandTextTrack* webTrack)
|
| {
|
| if (!RuntimeEnabledFeatures::videoTrackEnabled())
|
| @@ -3423,6 +3442,10 @@ void HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured()
|
| configureTextTracks();
|
| }
|
|
|
| +bool HTMLMediaElement::willRespondToMouseClickEvents()
|
| +{
|
| + return controls();
|
| +}
|
|
|
| void* HTMLMediaElement::preDispatchEventHandler(Event* event)
|
| {
|
| @@ -3432,6 +3455,16 @@ void* HTMLMediaElement::preDispatchEventHandler(Event* event)
|
| return 0;
|
| }
|
|
|
| +void HTMLMediaElement::defaultEventHandler(Event* event)
|
| +{
|
| + if (event->type() == EventTypeNames::click && willRespondToMouseClickEvents()) {
|
| + togglePlayState();
|
| + event->setDefaultHandled();
|
| + return;
|
| + }
|
| + HTMLElement::defaultEventHandler(event);
|
| +}
|
| +
|
| void HTMLMediaElement::createMediaPlayer()
|
| {
|
| #if ENABLE(WEB_AUDIO)
|
|
|