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

Unified Diff: media/blink/webmediaplayer_impl.cc

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: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index 3e1500e121bab874f209093e74cb36922672fd20..7e11e7cc8a272dce4d73289dbf2b7e43d6068b2f 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -352,6 +352,20 @@ void WebMediaPlayerImpl::exitedFullscreen() {
observer_->OnExitedFullscreen();
}
+void WebMediaPlayerImpl::videoViewportIntersectionChanged(
+ const blink::WebMediaPlayer::ViewportIntersectionInfo& info) {
+ MediaObserver::ViewportIntersectionInfo intersect_info;
+ intersect_info.ratio = info.ratio;
+ intersect_info.root_rect =
miu 2016/11/15 23:29:26 I think the types have implicit conversion defined
xjz 2016/11/16 01:06:45 Done.
+ gfx::Rect(info.rootRect.x, info.rootRect.y, info.rootRect.width,
+ info.rootRect.height);
+ intersect_info.intersect_rect =
+ gfx::Rect(info.intersectRect.x, info.intersectRect.y,
+ info.intersectRect.width, info.intersectRect.height);
+ if (observer_)
+ observer_->OnVideoViewportIntersectionChanged(intersect_info);
+}
+
void WebMediaPlayerImpl::DoLoad(LoadType load_type,
const blink::WebURL& url,
CORSMode cors_mode) {

Powered by Google App Engine
This is Rietveld 408576698