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

Issue 1293253003: Fix autoplay during prerendering for media elements on Android. (Closed)

Created:
5 years, 4 months ago by DaleCurtis
Modified:
5 years, 3 months ago
Reviewers:
Charlie Reis, qinmin, stgao
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, creis+watch_chromium.org, posciak+watch_chromium.org, avayvod+watch_chromium.org, nasko+codewatch_chromium.org, jam, mcasas+watch_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, mkwst+moarreviews-renderer_chromium.org, wjia+watch_chromium.org, mlamouri+watch-media_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@defer_media
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix autoplay during prerendering for media elements on Android. If the user gesture for autoplay is disabled manually or via an experiment, prerendered media will play in a hidden frame. Within WebMediaPlayerImpl this behavior is deferred at load time via a callback, however WebMediaPlayerAndroid was never given this callback, so it would try to play media. Generally this fails because by default autoplay requires a user gesture. The correct fix is to refactor WMPA such that it uses a params structure like WMPI and can invoke the deferral callback when load() is called. BUG=522157 TEST=clank no longer plays hidden a/v when user gesture disabled. Committed: https://crrev.com/98fc72cda10bf328ad55e460f6a7b06a356d5b3d Cr-Commit-Position: refs/heads/master@{#344676}

Patch Set 1 #

Total comments: 11

Patch Set 2 : Comments. #

Total comments: 2

Patch Set 3 : Comments. #

Patch Set 4 : Rebase. #

Patch Set 5 : Rename test class. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+72 lines, -48 lines) Patch
M chrome/browser/media/defer_background_media_browsertest.cc View 1 2 3 4 2 chunks +12 lines, -6 lines 0 comments Download
M content/renderer/media/android/webmediaplayer_android.h View 1 5 chunks +11 lines, -5 lines 0 comments Download
M content/renderer/media/android/webmediaplayer_android.cc View 1 7 chunks +29 lines, -17 lines 0 comments Download
M content/renderer/render_frame_impl.h View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 chunks +18 lines, -18 lines 0 comments Download

Messages

Total messages: 28 (10 generated)
DaleCurtis
creis for content/ qinmin for media/ https://codereview.chromium.org/1293253003/diff/1/chrome/browser/media/defer_background_media_browsertest.cc File chrome/browser/media/defer_background_media_browsertest.cc (right): https://codereview.chromium.org/1293253003/diff/1/chrome/browser/media/defer_background_media_browsertest.cc#newcode16 chrome/browser/media/defer_background_media_browsertest.cc:16: class MediaBrowserTest : ...
5 years, 4 months ago (2015-08-18 23:14:42 UTC) #2
Charlie Reis
I'm not very familiar with this code, in case you want to find someone more ...
5 years, 4 months ago (2015-08-18 23:57:42 UTC) #3
qinmin
https://codereview.chromium.org/1293253003/diff/1/chrome/browser/media/defer_background_media_browsertest.cc File chrome/browser/media/defer_background_media_browsertest.cc (right): https://codereview.chromium.org/1293253003/diff/1/chrome/browser/media/defer_background_media_browsertest.cc#newcode16 chrome/browser/media/defer_background_media_browsertest.cc:16: class MediaBrowserTest : public InProcessBrowserTest { On 2015/08/18 23:14:42, ...
5 years, 4 months ago (2015-08-19 21:31:14 UTC) #4
DaleCurtis
https://codereview.chromium.org/1293253003/diff/1/chrome/browser/media/defer_background_media_browsertest.cc File chrome/browser/media/defer_background_media_browsertest.cc (right): https://codereview.chromium.org/1293253003/diff/1/chrome/browser/media/defer_background_media_browsertest.cc#newcode16 chrome/browser/media/defer_background_media_browsertest.cc:16: class MediaBrowserTest : public InProcessBrowserTest { On 2015/08/19 21:31:14, ...
5 years, 4 months ago (2015-08-20 17:59:23 UTC) #5
DaleCurtis
https://codereview.chromium.org/1293253003/diff/1/chrome/browser/media/defer_background_media_browsertest.cc File chrome/browser/media/defer_background_media_browsertest.cc (right): https://codereview.chromium.org/1293253003/diff/1/chrome/browser/media/defer_background_media_browsertest.cc#newcode16 chrome/browser/media/defer_background_media_browsertest.cc:16: class MediaBrowserTest : public InProcessBrowserTest { On 2015/08/20 17:59:22, ...
5 years, 4 months ago (2015-08-20 18:00:24 UTC) #6
DaleCurtis
Thanks Charlie, your review is sufficient. I know the WMPI code well and qinmin@ knows ...
5 years, 4 months ago (2015-08-20 18:47:10 UTC) #7
Charlie Reis
Thanks, LGTM.
5 years, 4 months ago (2015-08-20 19:37:25 UTC) #8
qinmin
lgtm % comment https://codereview.chromium.org/1293253003/diff/20001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/1293253003/diff/20001/content/renderer/render_frame_impl.cc#newcode116 content/renderer/render_frame_impl.cc:116: #include "media/blink/webmediaplayer_params.h" this can be removed ...
5 years, 4 months ago (2015-08-20 19:47:26 UTC) #9
DaleCurtis
Thanks for review! https://codereview.chromium.org/1293253003/diff/20001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/1293253003/diff/20001/content/renderer/render_frame_impl.cc#newcode116 content/renderer/render_frame_impl.cc:116: #include "media/blink/webmediaplayer_params.h" On 2015/08/20 19:47:25, qinmin ...
5 years, 4 months ago (2015-08-20 19:52:44 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1293253003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1293253003/40001
5 years, 4 months ago (2015-08-20 19:53:41 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_compile_dbg_32_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_compile_dbg_32_ng/builds/87599) ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, ...
5 years, 4 months ago (2015-08-20 19:57:37 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1293253003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1293253003/60001
5 years, 4 months ago (2015-08-20 21:11:20 UTC) #18
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years, 4 months ago (2015-08-21 03:25:31 UTC) #19
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/98fc72cda10bf328ad55e460f6a7b06a356d5b3d Cr-Commit-Position: refs/heads/master@{#344676}
5 years, 4 months ago (2015-08-21 03:26:19 UTC) #20
Yuki
A revert of this CL (patchset #4 id:60001) has been created in https://codereview.chromium.org/1305973002/ by yukishiino@chromium.org. ...
5 years, 4 months ago (2015-08-21 05:21:53 UTC) #22
stgao
This CL broke compile on http://build.chromium.org/p/chromium.linux/builders/Linux%20Builder%20%28dbg%29/builds/92412 Reverting this CL passed the try-job: https://codereview.chromium.org/1304053002/ Reverting other ...
5 years, 4 months ago (2015-08-21 05:21:53 UTC) #23
DaleCurtis
Sorry about the ODR violation, renamed the test class and am resubmitting. Thanks!
5 years, 3 months ago (2015-08-25 19:55:35 UTC) #24
DaleCurtis
5 years, 3 months ago (2015-08-25 19:58:07 UTC) #28
Actually, looks like the CQ can't handle resubmits of this change, so I'll fork
it into a new one.

Powered by Google App Engine
This is Rietveld 408576698