| Index: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
|
| index a1f0ce6a74d593703d34135af4a59c9ecdc1652e..311186621cbf67ab19ced64c7c79d253418a6940 100644
|
| --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
|
| +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
|
| @@ -39,6 +39,7 @@
|
| #include "core/dom/ElementTraversal.h"
|
| #include "core/dom/ElementVisibilityObserver.h"
|
| #include "core/dom/Fullscreen.h"
|
| +#include "core/dom/IntersectionGeometry.h"
|
| #include "core/dom/TaskRunnerHelper.h"
|
| #include "core/dom/shadow/ShadowRoot.h"
|
| #include "core/events/Event.h"
|
| @@ -2504,6 +2505,22 @@ void HTMLMediaElement::startPlaybackProgressTimer() {
|
| }
|
|
|
| void HTMLMediaElement::playbackProgressTimerFired(TimerBase*) {
|
| + if (m_webMediaPlayer) {
|
| + // Check whether the intersection with viewport has changed.
|
| + ExecutionContext* context = getExecutionContext();
|
| + DCHECK(context->isDocument());
|
| + Document& document = toDocument(*context);
|
| + IntersectionGeometry geometry(&document, this, Vector<Length>(), true);
|
| + geometry.computeGeometry();
|
| + WebRect intersectRect = geometry.intersectionIntRect();
|
| + if (m_currentViewportIntersection.intersectRect != intersectRect) {
|
| + m_currentViewportIntersection.intersectRect = intersectRect;
|
| + m_currentViewportIntersection.rootRect = geometry.rootIntRect();
|
| + m_webMediaPlayer->viewportIntersectionChanged(
|
| + m_currentViewportIntersection);
|
| + }
|
| + }
|
| +
|
| if (!std::isnan(m_fragmentEndTime) && currentTime() >= m_fragmentEndTime &&
|
| getDirectionOfPlayback() == Forward) {
|
| m_fragmentEndTime = std::numeric_limits<double>::quiet_NaN();
|
|
|