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

Issue 2251073003: Pretend the video has no audio track if it is playing as part of autoplay muted. (Closed)

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

Description

Pretend the video has no audio track if it is playing as part of autoplay muted. This is to prevent autoplay muted videos to behave as audible videos because they might never be audible as far as the user is concerned. These will avoid taking an audio power blocker for them and also prevent showing a media notification. BUG=638463 R=sandersd@chromium.org,foolip@chromium.org,zqzhang@chromium.org Committed: https://crrev.com/910111369092ad1c3432833491eae73b87a6c33d Cr-Commit-Position: refs/heads/master@{#429859}

Patch Set 1 #

Patch Set 2 : cleaned up #

Patch Set 3 : no new state #

Patch Set 4 : "" #

Patch Set 5 : unit tests #

Total comments: 7

Patch Set 6 : review comments #

Patch Set 7 : fix tests #

Total comments: 5

Patch Set 8 : isAutoplayMuted uses !paused() #

Patch Set 9 : event order and moar tests #

Total comments: 8

Patch Set 10 : review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+261 lines, -12 lines) Patch
M chrome/android/java_sources.gni View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
A chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/AutoplayMutedNotificationTest.java View 1 2 3 4 5 6 7 8 9 1 chunk +161 lines, -0 lines 0 comments Download
M content/renderer/media/webmediaplayer_ms_unittest.cc View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A content/test/data/media/session/autoplay-muted.html View 1 2 3 4 5 6 7 8 1 chunk +11 lines, -0 lines 0 comments Download
M media/blink/webmediaplayer_impl.h View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
M media/blink/webmediaplayer_impl.cc View 1 2 3 4 5 6 7 8 2 chunks +17 lines, -3 lines 0 comments Download
M media/blink/webmediaplayer_impl_unittest.cc View 1 2 3 4 5 6 7 3 chunks +39 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/media/autoplay-muted.html View 1 2 3 4 5 6 7 8 1 chunk +10 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLMediaElement.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLMediaElement.cpp View 1 2 3 4 5 6 7 8 4 chunks +14 lines, -4 lines 0 comments Download
M third_party/WebKit/public/platform/WebMediaPlayerClient.h View 1 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 64 (35 generated)
mlamouri (slow - plz ping)
Would something like this fly in principle?
4 years, 4 months ago (2016-08-17 14:29:43 UTC) #3
DaleCurtis
What's the intent here? I don't see any actual disable of the audio track happening; ...
4 years, 4 months ago (2016-08-17 16:51:25 UTC) #6
mlamouri (slow - plz ping)
On 2016/08/17 at 16:51:25, dalecurtis wrote: > What's the intent here? I don't see any ...
4 years, 4 months ago (2016-08-18 10:01:03 UTC) #8
sandersd (OOO until July 31)
On 2016/08/18 10:01:03, Mounir Lamouri wrote: > On 2016/08/17 at 16:51:25, dalecurtis wrote: > > ...
4 years, 4 months ago (2016-08-18 17:59:48 UTC) #9
mlamouri (slow - plz ping)
On 2016/08/18 at 17:59:48, sandersd wrote: > On 2016/08/18 10:01:03, Mounir Lamouri wrote: > > ...
4 years, 4 months ago (2016-08-19 14:28:18 UTC) #10
sandersd (OOO until July 31)
> Do you mean whether `play()` was called in JS? The element can't be playing ...
4 years, 4 months ago (2016-08-19 20:57:27 UTC) #11
mlamouri (slow - plz ping)
PTAL
4 years, 2 months ago (2016-10-04 21:17:13 UTC) #17
sandersd (OOO until July 31)
https://codereview.chromium.org/2251073003/diff/70001/media/blink/webmediaplayer_impl_unittest.cc File media/blink/webmediaplayer_impl_unittest.cc (right): https://codereview.chromium.org/2251073003/diff/70001/media/blink/webmediaplayer_impl_unittest.cc#newcode665 media/blink/webmediaplayer_impl_unittest.cc:665: TEST_F(WebMediaPlayerImplTest, SetVolumeCallsDidPlay) { We don't have tests that all ...
4 years, 2 months ago (2016-10-04 23:53:04 UTC) #20
mlamouri (slow - plz ping)
Dan, I think this will not work because multiple calls to DidPlay() break some sanity ...
4 years, 2 months ago (2016-10-05 16:19:49 UTC) #21
foolip
Does WebMediaPlayer need to know *why* it's muted, shouldn't simply being muted be a sufficient ...
4 years, 2 months ago (2016-10-05 16:56:56 UTC) #24
sandersd (OOO until July 31)
https://codereview.chromium.org/2251073003/diff/70001/media/blink/webmediaplayer_impl_unittest.cc File media/blink/webmediaplayer_impl_unittest.cc (right): https://codereview.chromium.org/2251073003/diff/70001/media/blink/webmediaplayer_impl_unittest.cc#newcode688 media/blink/webmediaplayer_impl_unittest.cc:688: SetDelegateState(state.delegate_state); On 2016/10/05 16:19:49, mlamouri wrote: > On 2016/10/04 ...
4 years, 2 months ago (2016-10-05 17:38:18 UTC) #25
mlamouri (slow - plz ping)
On 2016/10/05 at 16:56:56, foolip wrote: > Does WebMediaPlayer need to know *why* it's muted, ...
4 years, 2 months ago (2016-10-05 20:08:54 UTC) #26
foolip
On 2016/10/05 20:08:54, mlamouri wrote: > On 2016/10/05 at 16:56:56, foolip wrote: > > Does ...
4 years, 2 months ago (2016-10-06 10:46:52 UTC) #31
mlamouri (slow - plz ping)
On 2016/10/06 at 10:46:52, foolip wrote: > On 2016/10/05 20:08:54, mlamouri wrote: > > On ...
4 years, 2 months ago (2016-10-07 13:45:53 UTC) #32
foolip
mlamouri@, can you elaborate a bit on the risks of simply using muted as the ...
4 years, 2 months ago (2016-10-10 11:33:07 UTC) #33
mlamouri (slow - plz ping)
Decision was made that we will not always hide the notification when something is muted. ...
4 years, 1 month ago (2016-10-31 15:27:42 UTC) #34
sandersd (OOO until July 31)
WMPI change LGTM.
4 years, 1 month ago (2016-10-31 21:02:35 UTC) #39
foolip
lgtm % event order https://codereview.chromium.org/2251073003/diff/110001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp File third_party/WebKit/Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/2251073003/diff/110001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp#newcode2310 third_party/WebKit/Source/core/html/HTMLMediaElement.cpp:2310: scheduleEvent(EventTypeNames::volumechange); On 2016/10/31 15:27:41, mlamouri ...
4 years, 1 month ago (2016-11-01 16:12:21 UTC) #40
mlamouri (slow - plz ping)
The event order is back to normal. Only WMPI is notified after the video is ...
4 years, 1 month ago (2016-11-03 14:55:21 UTC) #44
Zhiqiang Zhang (Slow)
lgtm % nits https://codereview.chromium.org/2251073003/diff/150001/chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/AutoplayMutedNotificationTest.java File chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/AutoplayMutedNotificationTest.java (right): https://codereview.chromium.org/2251073003/diff/150001/chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/AutoplayMutedNotificationTest.java#newcode33 chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/AutoplayMutedNotificationTest.java:33: return (AudioManager) getActivity().getApplicationContext().getSystemService( Some thoughts: we ...
4 years, 1 month ago (2016-11-03 16:41:09 UTC) #47
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/2251073003/170001
4 years, 1 month ago (2016-11-03 18:20:48 UTC) #51
mlamouri (slow - plz ping)
https://codereview.chromium.org/2251073003/diff/150001/chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/AutoplayMutedNotificationTest.java File chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/AutoplayMutedNotificationTest.java (right): https://codereview.chromium.org/2251073003/diff/150001/chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/AutoplayMutedNotificationTest.java#newcode33 chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/AutoplayMutedNotificationTest.java:33: return (AudioManager) getActivity().getApplicationContext().getSystemService( On 2016/11/03 at 16:41:09, Zhiqiang Zhang ...
4 years, 1 month ago (2016-11-03 18:23:39 UTC) #52
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/328268)
4 years, 1 month ago (2016-11-03 19:30:04 UTC) #54
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/2251073003/170001
4 years, 1 month ago (2016-11-03 21:39:08 UTC) #56
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/325160)
4 years, 1 month ago (2016-11-04 02:17:56 UTC) #58
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/2251073003/170001
4 years, 1 month ago (2016-11-04 09:32:48 UTC) #60
commit-bot: I haz the power
Committed patchset #10 (id:170001)
4 years, 1 month ago (2016-11-04 11:28:53 UTC) #61
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/910111369092ad1c3432833491eae73b87a6c33d Cr-Commit-Position: refs/heads/master@{#429859}
4 years, 1 month ago (2016-11-04 11:31:02 UTC) #63
Zhiqiang Zhang (Slow)
4 years, 1 month ago (2016-11-04 14:17:56 UTC) #64
Message was sent while issue was closed.
https://codereview.chromium.org/2251073003/diff/150001/chrome/android/javates...
File
chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/AutoplayMutedNotificationTest.java
(right):

https://codereview.chromium.org/2251073003/diff/150001/chrome/android/javates...
chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/AutoplayMutedNotificationTest.java:33:
return (AudioManager) getActivity().getApplicationContext().getSystemService(
On 2016/11/03 18:23:39, mlamouri wrote:
> On 2016/11/03 at 16:41:09, Zhiqiang Zhang wrote:
> > Some thoughts: we can avoid this if we can further abstract the
> AudioFocusManager to a unified interface shared by different platforms.
> > 
> > Ditto the MockAudioFocusChangeListener.
> 
> I agree but I have no idea how. We did the same for MediaSessionTest.java that
> relies heavily on the AudioFocusManager. If you have thought how to do this,
> could you file a bug with the ideas? :)

There's already one, https://crbug.com/651069 :)

Powered by Google App Engine
This is Rietveld 408576698