Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(684)

Unified Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.h

Issue 2475643004: Monitor the intersection of video and viewport. (Closed)
Patch Set: Fix trybots failure. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLMediaElement.h
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.h b/third_party/WebKit/Source/core/html/HTMLMediaElement.h
index 0bd98bca6d30fa8ac49f065ddad4b715583cedbb..d1b4c3a99755badbc2093828f1389f9ede1ccddd 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.h
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.h
@@ -52,7 +52,7 @@ class AudioTrackList;
class AutoplayUmaHelper;
class ContentType;
class CueTimeline;
-class ElementVisibilityObserver;
+class ElementViewportIntersectionObserver;
class EnumerationHistogram;
class Event;
class ExceptionState;
@@ -312,6 +312,10 @@ class CORE_EXPORT HTMLMediaElement : public HTMLElement,
return m_remotePlaybackClient;
}
+ WebMediaPlayer::ViewportIntersectionInfo currentViewportIntersection() const {
+ return m_currentViewportIntersection;
+ }
+
protected:
HTMLMediaElement(const QualifiedName&, Document&);
~HTMLMediaElement() override;
@@ -542,7 +546,8 @@ class CORE_EXPORT HTMLMediaElement : public HTMLElement,
EnumerationHistogram& showControlsHistogram() const;
- void onVisibilityChangedForAutoplay(bool isVisible);
+ void onVideoViewportIntersectionChanged(const WebRect& rootRect,
+ const WebRect& intersectRect);
UnthrottledThreadTimer<HTMLMediaElement> m_loadTimer;
UnthrottledThreadTimer<HTMLMediaElement> m_progressEventTimer;
@@ -667,6 +672,8 @@ class CORE_EXPORT HTMLMediaElement : public HTMLElement,
GC_PLUGIN_IGNORE("http://crbug.com/404577")
WeakMember<AudioSourceProviderClient> m_audioSourceNode;
+ WebMediaPlayer::ViewportIntersectionInfo m_currentViewportIntersection;
+
// AudioClientImpl wraps an AudioSourceProviderClient.
// When the audio format is known, Chromium calls setFormat().
class AudioClientImpl final
@@ -725,11 +732,11 @@ class CORE_EXPORT HTMLMediaElement : public HTMLElement,
Member<AutoplayExperimentHelper::Client> m_autoplayHelperClient;
Member<AutoplayExperimentHelper> m_autoplayHelper;
Member<AutoplayUmaHelper> m_autoplayUmaHelper;
+ bool m_shouldAutoplayWhenVisible = false;
WebRemotePlaybackClient* m_remotePlaybackClient;
- // class AutoplayVisibilityObserver;
- Member<ElementVisibilityObserver> m_autoplayVisibilityObserver;
+ Member<ElementViewportIntersectionObserver> m_viewportIntersectionObserver;
static URLRegistry* s_mediaStreamRegistry;
};
« no previous file with comments | « third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp ('k') | third_party/WebKit/Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698