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

Unified Diff: third_party/WebKit/public/platform/WebMediaPlayer.h

Issue 2475643004: Monitor the intersection of video and viewport. (Closed)
Patch Set: Addressed comments. Observe intersection changing. 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/public/platform/WebMediaPlayer.h
diff --git a/third_party/WebKit/public/platform/WebMediaPlayer.h b/third_party/WebKit/public/platform/WebMediaPlayer.h
index 87c058c8da7cf3760c0fa3293db6c6c03b65dd3d..0a96fee5f91bed1373244e73caa89697e5d8b713 100644
--- a/third_party/WebKit/public/platform/WebMediaPlayer.h
+++ b/third_party/WebKit/public/platform/WebMediaPlayer.h
@@ -35,6 +35,7 @@
#include "WebCanvas.h"
#include "WebContentDecryptionModule.h"
#include "WebMediaSource.h"
+#include "WebRect.h"
#include "WebSetSinkIdCallbacks.h"
#include "WebString.h"
@@ -54,7 +55,6 @@ class WebMediaPlayerSource;
class WebSecurityOrigin;
class WebString;
class WebURL;
-struct WebRect;
struct WebSize;
class WebMediaPlayer {
@@ -105,6 +105,15 @@ class WebMediaPlayer {
typedef WebString TrackId;
enum TrackType { TextTrack, AudioTrack, VideoTrack };
+ struct ViewportIntersectionInfo {
+ ViewportIntersectionInfo() {}
+ ~ViewportIntersectionInfo() {}
+
+ float ratio = 0;
miu 2016/11/15 23:29:26 Please remove |ratio|. This can be computed in rem
xjz 2016/11/16 01:06:45 Done.
+ WebRect rootRect;
+ WebRect intersectRect;
+ };
+
virtual ~WebMediaPlayer() {}
virtual void load(LoadType, const WebMediaPlayerSource&, CORSMode) = 0;
@@ -226,6 +235,10 @@ class WebMediaPlayer {
// Inform WebMediaPlayer when the element has entered/exited fullscreen.
virtual void enteredFullscreen() {}
virtual void exitedFullscreen() {}
+ // Inform WebMediaPlayer when the intersection rect of video and viewport
+ // changes.
+ virtual void videoViewportIntersectionChanged(
+ const ViewportIntersectionInfo& info) {}
virtual void enabledAudioTracksChanged(
const WebVector<TrackId>& enabledTrackIds) {}

Powered by Google App Engine
This is Rietveld 408576698