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

Issue 2051253002: Start autoplay muted videos with autoplay attribute when they are visible. (Closed)

Created:
4 years, 6 months ago by mlamouri (slow - plz ping)
Modified:
4 years, 6 months ago
CC:
blink-reviews, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, eric.carlson_apple.com, feature-media-reviews_chromium.org, fs, gasubic, mlamouri+watch-blink_chromium.org, rwlbuis, sof, nessy, vcarbune.chromium
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Start autoplay muted videos with autoplay attribute when they are visible. The behaviour is linked to the autoplay-muted-videos flag. This is introducing a ElementVisibilityObserver helper that is behind the scene using the IntersectionObserver. BUG=618301 Committed: https://crrev.com/0c33d8c3ae4c8f1fc2d58574c128725389864d95 Cr-Commit-Position: refs/heads/master@{#401242}

Patch Set 1 #

Total comments: 4

Patch Set 2 : cleanup and tests #

Total comments: 8

Patch Set 3 : review comments #

Patch Set 4 : add cl dependency #

Patch Set 5 : fix test #

Total comments: 4

Patch Set 6 : review comments #

Total comments: 16

Patch Set 7 : review comments #

Patch Set 8 : reduce #

Unified diffs Side-by-side diffs Delta from patch set Stats (+310 lines, -18 lines) Patch
M third_party/WebKit/LayoutTests/media/autoplay-muted.html View 1 2 3 4 5 6 7 3 chunks +3 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/media/autoplay-when-visible.html View 1 2 3 4 5 6 7 1 chunk +97 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/core.gypi View 1 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/dom/ElementVisibilityObserver.h View 1 2 1 chunk +50 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp View 1 2 3 4 5 6 1 chunk +51 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/IntersectionObserver.h View 1 2 3 chunks +9 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/dom/IntersectionObserver.cpp View 1 2 3 4 5 6 6 chunks +59 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLMediaElement.h View 1 2 3 chunks +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLMediaElement.cpp View 1 2 3 4 5 6 chunks +33 lines, -6 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 60 (19 generated)
mlamouri (slow - plz ping)
This is a bit rough around the edges: I didn't clean up the CL and ...
4 years, 6 months ago (2016-06-09 21:11:41 UTC) #2
mlamouri (slow - plz ping)
4 years, 6 months ago (2016-06-10 09:57:04 UTC) #4
Sami
Seems reasonable to me. Do we need to clear the observer if playback starts through ...
4 years, 6 months ago (2016-06-10 12:42:25 UTC) #5
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2051253002/20001
4 years, 6 months ago (2016-06-10 15:13:33 UTC) #7
mlamouri (slow - plz ping)
Applied skyostil's comments. +zqzhang@ for another round of local review. esprehn@, ojan@ and szager@, PTAL. ...
4 years, 6 months ago (2016-06-10 15:14:01 UTC) #9
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/244762)
4 years, 6 months ago (2016-06-10 16:26:05 UTC) #11
DaleCurtis
The VisibilityObserver is nice, I think we'll want to use that to also not _load_ ...
4 years, 6 months ago (2016-06-10 17:56:35 UTC) #12
Zhiqiang Zhang (Slow)
LGTM
4 years, 6 months ago (2016-06-10 19:39:04 UTC) #13
szager1
Sorry I'm late to the game here, but I think there's too much code here. ...
4 years, 6 months ago (2016-06-10 21:03:14 UTC) #14
esprehn
+1 to Stefan's feedback. -- You received this message because you are subscribed to the ...
4 years, 6 months ago (2016-06-10 21:04:39 UTC) #15
szager1
https://codereview.chromium.org/2051253002/diff/20001/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp File third_party/WebKit/Source/core/dom/IntersectionObserver.cpp (right): https://codereview.chromium.org/2051253002/diff/20001/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp#newcode182 third_party/WebKit/Source/core/dom/IntersectionObserver.cpp:182: observe(target); Infinite recursion.
4 years, 6 months ago (2016-06-10 21:07:17 UTC) #16
szager1
https://codereview.chromium.org/2051253002/diff/20001/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp File third_party/WebKit/Source/core/dom/IntersectionObserver.cpp (right): https://codereview.chromium.org/2051253002/diff/20001/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp#newcode231 third_party/WebKit/Source/core/dom/IntersectionObserver.cpp:231: unobserve(target); Infinite recursion.
4 years, 6 months ago (2016-06-10 21:07:49 UTC) #17
szager1
https://codereview.chromium.org/2051253002/diff/20001/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp File third_party/WebKit/Source/core/dom/IntersectionObserver.cpp (right): https://codereview.chromium.org/2051253002/diff/20001/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp#newcode182 third_party/WebKit/Source/core/dom/IntersectionObserver.cpp:182: observe(target); On 2016/06/10 21:07:17, szager1 wrote: > Infinite recursion. ...
4 years, 6 months ago (2016-06-10 21:09:23 UTC) #18
esprehn
+1 to Stefan's feedback. -- You received this message because you are subscribed to the ...
4 years, 6 months ago (2016-06-10 21:12:26 UTC) #19
esprehn
Lets make ElementVisibilityObserver look like a js library, once that's done I think this is ...
4 years, 6 months ago (2016-06-14 16:01:18 UTC) #20
mlamouri (slow - plz ping)
esprehn@ comments applied. PTAL.
4 years, 6 months ago (2016-06-15 20:36:51 UTC) #21
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2051253002/60001
4 years, 6 months ago (2016-06-15 21:15:51 UTC) #23
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/244910)
4 years, 6 months ago (2016-06-15 23:08:09 UTC) #25
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2051253002/80001
4 years, 6 months ago (2016-06-16 15:49:35 UTC) #27
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-06-16 17:15:36 UTC) #29
szager1
https://codereview.chromium.org/2051253002/diff/80001/third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp File third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp (right): https://codereview.chromium.org/2051253002/diff/80001/third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp#newcode50 third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp:50: bool isVisible = entries[0]->intersectionRatio() > 0.f; Unfortunately, this will ...
4 years, 6 months ago (2016-06-17 07:32:36 UTC) #30
mlamouri (slow - plz ping)
https://codereview.chromium.org/2051253002/diff/80001/third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp File third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp (right): https://codereview.chromium.org/2051253002/diff/80001/third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp#newcode50 third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp:50: bool isVisible = entries[0]->intersectionRatio() > 0.f; On 2016/06/17 at ...
4 years, 6 months ago (2016-06-17 11:52:05 UTC) #31
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2051253002/100001
4 years, 6 months ago (2016-06-17 11:52:40 UTC) #33
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-06-17 13:38:41 UTC) #35
mlamouri (slow - plz ping)
szager@, friendly ping :) This CL blocks us from being feature complete on the autoplay ...
4 years, 6 months ago (2016-06-21 12:51:19 UTC) #36
szager1
Mostly looks good, a couple of details... https://codereview.chromium.org/2051253002/diff/100001/third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp File third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp (right): https://codereview.chromium.org/2051253002/diff/100001/third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp#newcode47 third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp:47: DCHECK_EQ(entries.size(), 1u); ...
4 years, 6 months ago (2016-06-21 21:18:05 UTC) #37
mlamouri (slow - plz ping)
Comments applied. PTAL :) https://codereview.chromium.org/2051253002/diff/100001/third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp File third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp (right): https://codereview.chromium.org/2051253002/diff/100001/third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp#newcode47 third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp:47: DCHECK_EQ(entries.size(), 1u); On 2016/06/21 at ...
4 years, 6 months ago (2016-06-21 21:25:51 UTC) #38
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2051253002/120001
4 years, 6 months ago (2016-06-21 21:28:34 UTC) #40
esprehn
This is really exciting, thanks for doing it! https://codereview.chromium.org/2051253002/diff/100001/third_party/WebKit/LayoutTests/media/autoplay-muted.html File third_party/WebKit/LayoutTests/media/autoplay-muted.html (right): https://codereview.chromium.org/2051253002/diff/100001/third_party/WebKit/LayoutTests/media/autoplay-muted.html#newcode3 third_party/WebKit/LayoutTests/media/autoplay-muted.html:3: <head> ...
4 years, 6 months ago (2016-06-21 21:28:42 UTC) #41
mlamouri (slow - plz ping)
https://codereview.chromium.org/2051253002/diff/100001/third_party/WebKit/LayoutTests/media/autoplay-muted.html File third_party/WebKit/LayoutTests/media/autoplay-muted.html (right): https://codereview.chromium.org/2051253002/diff/100001/third_party/WebKit/LayoutTests/media/autoplay-muted.html#newcode3 third_party/WebKit/LayoutTests/media/autoplay-muted.html:3: <head> On 2016/06/21 at 21:28:41, esprehn wrote: > you ...
4 years, 6 months ago (2016-06-21 21:32:11 UTC) #42
esprehn
https://codereview.chromium.org/2051253002/diff/100001/third_party/WebKit/LayoutTests/media/autoplay-muted.html File third_party/WebKit/LayoutTests/media/autoplay-muted.html (right): https://codereview.chromium.org/2051253002/diff/100001/third_party/WebKit/LayoutTests/media/autoplay-muted.html#newcode3 third_party/WebKit/LayoutTests/media/autoplay-muted.html:3: <head> On 2016/06/21 at 21:32:11, Mounir Lamouri (slow) wrote: ...
4 years, 6 months ago (2016-06-21 21:36:40 UTC) #43
mlamouri (slow - plz ping)
I've reduced the tests to no longer have <html> and <head>. I'm not a big ...
4 years, 6 months ago (2016-06-21 21:50:44 UTC) #44
esprehn
I'm happy as soon as szager is. :)
4 years, 6 months ago (2016-06-21 21:52:34 UTC) #45
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2051253002/140001
4 years, 6 months ago (2016-06-21 21:53:53 UTC) #47
szager1
lgtm, thanks!
4 years, 6 months ago (2016-06-21 22:20:41 UTC) #48
esprehn
lgtm
4 years, 6 months ago (2016-06-21 22:26:34 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2051253002/140001
4 years, 6 months ago (2016-06-21 22:28:03 UTC) #53
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/242898)
4 years, 6 months ago (2016-06-22 01:11:44 UTC) #55
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2051253002/140001
4 years, 6 months ago (2016-06-22 08:41:10 UTC) #57
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 6 months ago (2016-06-22 09:57:36 UTC) #58
commit-bot: I haz the power
4 years, 6 months ago (2016-06-22 09:59:54 UTC) #60
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/0c33d8c3ae4c8f1fc2d58574c128725389864d95
Cr-Commit-Position: refs/heads/master@{#401242}

Powered by Google App Engine
This is Rietveld 408576698