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

Issue 2511143006: Detect change on the intersection of video and viewport. (Closed)

Created:
4 years, 1 month ago by xjz
Modified:
4 years ago
Reviewers:
ojan, esprehn, xhwang, szager1, miu
CC:
apacible+watch_chromium.org, blink-reviews, blink-reviews-api_chromium.org, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, chromium-reviews, chromoting-reviews_chromium.org, dglazkov+blink, eae+blinkwatch, eric.carlson_apple.com, feature-media-reviews_chromium.org, fs, gasubic, kinuko+watch, miu+watch_chromium.org, mlamouri+watch-blink_chromium.org, rwlbuis, sof, nessy, Srirama, vcarbune.chromium, xjz+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Detect change on the intersection of video and viewport. This Cl: 1. Abstracts the calculation of intersection geometry from IntersectionObserver. Calculating algorithms keep unchanged. 2. When a media is playing, periodically checks whether the intersection with viewport has changed. If changed, notifies WebMediaPlayerImpl. 3. Adds logic to start remoting when video consistently covers most of the viewport for a certain time. BUG=643964 Committed: https://crrev.com/cdbbe7359047bf173cff5bff708b59efb889862c Cr-Commit-Position: refs/heads/master@{#436166}

Patch Set 1 #

Total comments: 18

Patch Set 2 : Addressed miu's comments. #

Total comments: 16

Patch Set 3 : Addressed comments from PS#2. #

Total comments: 16

Patch Set 4 : Addressed ojan's comments. #

Total comments: 4

Patch Set 5 : Addressed ojan's comments. Added tests. #

Patch Set 6 : Addressed comments. #

Total comments: 12

Patch Set 7 : Addressed comments. Added two more tests. #

Patch Set 8 : Rename. #

Patch Set 9 : Rebased only. #

Patch Set 10 : Bug fix. #

Patch Set 11 : Rebase again. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+521 lines, -443 lines) Patch
M media/base/media_observer.h View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M media/blink/webmediaplayer_impl.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M media/blink/webmediaplayer_impl.cc View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -0 lines 0 comments Download
M media/remoting/remoting_renderer_controller.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -0 lines 0 comments Download
M media/remoting/remoting_renderer_controller.cc View 1 2 3 4 5 6 7 8 2 chunks +11 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/dom/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/dom/IntersectionGeometry.h View 1 2 3 4 5 1 chunk +73 lines, -0 lines 0 comments Download
A + third_party/WebKit/Source/core/dom/IntersectionGeometry.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +162 lines, -182 lines 0 comments Download
M third_party/WebKit/Source/core/dom/IntersectionObservation.h View 1 2 3 4 5 3 chunks +6 lines, -26 lines 0 comments Download
M third_party/WebKit/Source/core/dom/IntersectionObservation.cpp View 1 2 3 4 5 6 7 8 9 10 2 chunks +29 lines, -194 lines 0 comments Download
M third_party/WebKit/Source/core/dom/IntersectionObserver.h View 1 2 2 chunks +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/dom/IntersectionObserver.cpp View 1 2 3 4 chunks +5 lines, -34 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLMediaElement.h View 1 2 3 4 5 6 7 8 4 chunks +11 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLMediaElement.cpp View 1 2 3 4 5 6 7 8 7 chunks +50 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
A third_party/WebKit/Source/web/tests/MediaElementFillingViewportTest.cpp View 1 2 3 4 5 6 1 chunk +153 lines, -0 lines 0 comments Download
M third_party/WebKit/public/platform/WebMediaPlayer.h View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 66 (29 generated)
xjz
PTAL. Thanks! media/* is not changed from original CL: https://codereview.chromium.org/2475643004/.
4 years, 1 month ago (2016-11-18 23:34:37 UTC) #4
miu
I focused on media/*, HTMLMediaElement.cpp and FrameLoaderClientImpl.cpp. I only glanced at the other changes (szager1@ ...
4 years, 1 month ago (2016-11-21 21:07:04 UTC) #5
xjz
Thanks miu@! Addressed your comments in PS# 2. PTAL. szager@/ojan@: Can you PTAL the changes ...
4 years, 1 month ago (2016-11-21 23:58:42 UTC) #6
miu
media/*, HTMLMediaElement.cpp and FrameLoaderClientImpl.cpp lgtm https://codereview.chromium.org/2511143006/diff/20001/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp File third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp (right): https://codereview.chromium.org/2511143006/diff/20001/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp#newcode783 third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp:783: WebMediaPlayer::ViewportIntersectionInfo intersectInfo = nit: ...
4 years, 1 month ago (2016-11-22 00:14:30 UTC) #7
szager1
https://codereview.chromium.org/2511143006/diff/20001/media/base/media_observer.h File media/base/media_observer.h (right): https://codereview.chromium.org/2511143006/diff/20001/media/base/media_observer.h#newcode20 media/base/media_observer.h:20: struct ViewportIntersectionInfo { As we mentioned in the meeting, ...
4 years ago (2016-11-23 17:44:58 UTC) #8
ojan
https://codereview.chromium.org/2511143006/diff/20001/media/base/media_observer.h File media/base/media_observer.h (right): https://codereview.chromium.org/2511143006/diff/20001/media/base/media_observer.h#newcode20 media/base/media_observer.h:20: struct ViewportIntersectionInfo { On 2016/11/23 at 17:44:58, szager1 wrote: ...
4 years ago (2016-11-23 18:43:43 UTC) #9
ojan
Also, FYI, you'll get faster and better reviews in the future if you break up ...
4 years ago (2016-11-23 18:49:13 UTC) #10
xjz
On 2016/11/23 18:49:13, ojan wrote: > Also, FYI, you'll get faster and better reviews in ...
4 years ago (2016-11-23 23:42:20 UTC) #11
xjz
szager1, ojan, and miu: Thanks for reviewing! Addressed all comments in PS#2 in PS#3. PTAL. ...
4 years ago (2016-11-23 23:43:26 UTC) #12
ojan
One last round of review and I think we're good to go. Thanks for being ...
4 years ago (2016-11-24 00:48:33 UTC) #13
xjz
Thanks ojan! Addressed your comments in PS#4. PTAL. https://codereview.chromium.org/2511143006/diff/40001/media/base/media_observer.h File media/base/media_observer.h (right): https://codereview.chromium.org/2511143006/diff/40001/media/base/media_observer.h#newcode25 media/base/media_observer.h:25: virtual ...
4 years ago (2016-11-24 02:16:16 UTC) #14
ojan
I was about to approve this and realized that there's no tests. So sorry I ...
4 years ago (2016-11-24 03:06:06 UTC) #15
miu
On 2016/11/24 03:06:06, ojan wrote: > I was about to approve this and realized that ...
4 years ago (2016-11-29 19:52:12 UTC) #16
miu
On 2016/11/24 03:06:06, ojan wrote: > I was about to approve this and realized that ...
4 years ago (2016-11-29 19:52:14 UTC) #17
szager1
modulo tests, the code lg. nit (with my user hat on): the current implementation will ...
4 years ago (2016-11-29 23:06:18 UTC) #18
ojan
Yeah, I think there's follow-up patches to do for hooking into start/stop of playing, but ...
4 years ago (2016-11-29 23:54:21 UTC) #19
ojan
Yeah, I think there's follow-up patches to do for hooking into start/stop of playing, but ...
4 years ago (2016-11-29 23:54:21 UTC) #20
xjz
Added tests. PTAL https://codereview.chromium.org/2511143006/diff/60001/third_party/WebKit/Source/core/dom/IntersectionObservation.h File third_party/WebKit/Source/core/dom/IntersectionObservation.h (right): https://codereview.chromium.org/2511143006/diff/60001/third_party/WebKit/Source/core/dom/IntersectionObservation.h#newcode40 third_party/WebKit/Source/core/dom/IntersectionObservation.h:40: unsigned m_lastThresholdIndex; On 2016/11/24 03:06:06, ojan ...
4 years ago (2016-11-30 01:58:44 UTC) #22
miu
https://codereview.chromium.org/2511143006/diff/60001/third_party/WebKit/Source/core/dom/IntersectionObservation.h File third_party/WebKit/Source/core/dom/IntersectionObservation.h (right): https://codereview.chromium.org/2511143006/diff/60001/third_party/WebKit/Source/core/dom/IntersectionObservation.h#newcode40 third_party/WebKit/Source/core/dom/IntersectionObservation.h:40: unsigned m_lastThresholdIndex; On 2016/11/30 01:58:44, xjz wrote: > In ...
4 years ago (2016-11-30 03:40:36 UTC) #23
xjz
Addressed comments. PTAL. https://codereview.chromium.org/2511143006/diff/60001/third_party/WebKit/Source/core/dom/IntersectionObservation.h File third_party/WebKit/Source/core/dom/IntersectionObservation.h (right): https://codereview.chromium.org/2511143006/diff/60001/third_party/WebKit/Source/core/dom/IntersectionObservation.h#newcode40 third_party/WebKit/Source/core/dom/IntersectionObservation.h:40: unsigned m_lastThresholdIndex; On 2016/11/30 03:40:36, miu ...
4 years ago (2016-11-30 07:05:54 UTC) #24
ojan
lgtm! Please remove the runPendingTasks line and inline the beginFrame call instead of having a ...
4 years ago (2016-11-30 07:09:40 UTC) #25
xhwang
media/ looking good. Just a few nits for discussion. https://codereview.chromium.org/2511143006/diff/120001/third_party/WebKit/public/platform/WebMediaPlayer.h File third_party/WebKit/public/platform/WebMediaPlayer.h (right): https://codereview.chromium.org/2511143006/diff/120001/third_party/WebKit/public/platform/WebMediaPlayer.h#newcode231 third_party/WebKit/public/platform/WebMediaPlayer.h:231: ...
4 years ago (2016-11-30 18:13:09 UTC) #26
Z_DONOTUSE
https://codereview.chromium.org/2511143006/diff/120001/third_party/WebKit/public/platform/WebMediaPlayer.h File third_party/WebKit/public/platform/WebMediaPlayer.h (right): https://codereview.chromium.org/2511143006/diff/120001/third_party/WebKit/public/platform/WebMediaPlayer.h#newcode233 third_party/WebKit/public/platform/WebMediaPlayer.h:233: virtual void stablyFilledViewport(bool isMostlyFillingViewport) {} On 2016/11/30 at 18:13:09, ...
4 years ago (2016-11-30 18:48:23 UTC) #29
xjz
Thanks ojan and xhwang. Addressed your comments and added two more tests. PTAL. esprehn: need ...
4 years ago (2016-11-30 18:58:16 UTC) #31
xhwang
https://codereview.chromium.org/2511143006/diff/120001/third_party/WebKit/public/platform/WebMediaPlayer.h File third_party/WebKit/public/platform/WebMediaPlayer.h (right): https://codereview.chromium.org/2511143006/diff/120001/third_party/WebKit/public/platform/WebMediaPlayer.h#newcode233 third_party/WebKit/public/platform/WebMediaPlayer.h:233: virtual void stablyFilledViewport(bool isMostlyFillingViewport) {} On 2016/11/30 18:58:16, xjz ...
4 years ago (2016-11-30 19:06:21 UTC) #32
miu
https://codereview.chromium.org/2511143006/diff/120001/third_party/WebKit/public/platform/WebMediaPlayer.h File third_party/WebKit/public/platform/WebMediaPlayer.h (right): https://codereview.chromium.org/2511143006/diff/120001/third_party/WebKit/public/platform/WebMediaPlayer.h#newcode233 third_party/WebKit/public/platform/WebMediaPlayer.h:233: virtual void stablyFilledViewport(bool isMostlyFillingViewport) {} On 2016/11/30 19:06:21, xhwang ...
4 years ago (2016-11-30 19:56:56 UTC) #33
xjz
On 2016/11/30 19:56:56, miu wrote: > https://codereview.chromium.org/2511143006/diff/120001/third_party/WebKit/public/platform/WebMediaPlayer.h > File third_party/WebKit/public/platform/WebMediaPlayer.h (right): > > https://codereview.chromium.org/2511143006/diff/120001/third_party/WebKit/public/platform/WebMediaPlayer.h#newcode233 > ...
4 years ago (2016-11-30 20:05:02 UTC) #34
xhwang
On 2016/11/30 20:05:02, xjz wrote: > On 2016/11/30 19:56:56, miu wrote: > > > https://codereview.chromium.org/2511143006/diff/120001/third_party/WebKit/public/platform/WebMediaPlayer.h ...
4 years ago (2016-11-30 20:44:15 UTC) #35
blink-reviews
Any of those three LGTM. I agree that the old names leaked too much implementation ...
4 years ago (2016-11-30 21:00:47 UTC) #36
chromium-reviews
Any of those three LGTM. I agree that the old names leaked too much implementation ...
4 years ago (2016-11-30 21:00:50 UTC) #37
xjz
On 2016/11/30 21:00:50, chromium-reviews wrote: > Any of those three LGTM. I agree that the ...
4 years ago (2016-11-30 22:17:10 UTC) #38
xhwang
lgtm
4 years ago (2016-11-30 23:52:53 UTC) #45
xjz
ping esprehn@: need your rubber stamp on the following files: third_party/WebKit/Source/web/BUILD.gn third_party/WebKit/public/platform/WebMediaPlayer.h Thanks!
4 years ago (2016-12-02 19:44:24 UTC) #48
esprehn
lgtm
4 years ago (2016-12-03 01:59:56 UTC) #57
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2511143006/260001
4 years ago (2016-12-03 05:49:01 UTC) #61
commit-bot: I haz the power
Committed patchset #11 (id:260001)
4 years ago (2016-12-03 20:48:33 UTC) #64
commit-bot: I haz the power
4 years ago (2016-12-03 20:50:56 UTC) #66
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/cdbbe7359047bf173cff5bff708b59efb889862c
Cr-Commit-Position: refs/heads/master@{#436166}

Powered by Google App Engine
This is Rietveld 408576698