New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 638463 link

Starred by 6 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Muted autoplay videos should not show a media notification

Project Member Reported by markdavidscott@google.com, Aug 17 2016

Issue description

Muted autoplay videos can be used as a design element, while scrolling through a stream, etc.  Currently, these result in a media notification being shown, but it seems unlikely that the user would want to pause a video they weren't actively looking at.  It's preferable to show the notification only for video that's audible, or *possibly* silent video that's played explicitly by the user.
 
Cc: zqzh...@chromium.org
Components: Internals>Media>Session Blink>Media
Labels: M-54
Status: Assigned (was: Available)
I have an idea of a hack to fix this.
Project Member

Comment 2 by sheriffbot@chromium.org, Aug 17 2016

Labels: Hotlist-Google
Labels: Proj-Autoplay
I'm starting looking into this.

It will also affect MediaSession on desktop I think. Now the logic is getting complex.

For desktop, there's no autoplay restriction, so checking user gesture does not help, and we don't want a muted video join MediaSession. Maybe we should pass the muted flag in _DidPlay message, and fire another message for _Unmute? (seems not very clean)

Any idea Mounir?
Status: Started (was: Assigned)
Finally got around to clean up the fix I had: https://codereview.chromium.org/2251073003
Labels: -M-54 M-55
Cc: sbirch@chromium.org yus...@chromium.org mlamouri@chromium.org miguelg@chromium.org
 Issue 660482  has been merged into this issue.
Project Member

Comment 8 by bugdroid1@chromium.org, Nov 4 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/910111369092ad1c3432833491eae73b87a6c33d

commit 910111369092ad1c3432833491eae73b87a6c33d
Author: mlamouri <mlamouri@chromium.org>
Date: Fri Nov 04 11:28:24 2016

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

Review-Url: https://codereview.chromium.org/2251073003
Cr-Commit-Position: refs/heads/master@{#429859}

[modify] https://crrev.com/910111369092ad1c3432833491eae73b87a6c33d/chrome/android/java_sources.gni
[add] https://crrev.com/910111369092ad1c3432833491eae73b87a6c33d/chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/AutoplayMutedNotificationTest.java
[modify] https://crrev.com/910111369092ad1c3432833491eae73b87a6c33d/content/renderer/media/webmediaplayer_ms_unittest.cc
[add] https://crrev.com/910111369092ad1c3432833491eae73b87a6c33d/content/test/data/media/session/autoplay-muted.html
[modify] https://crrev.com/910111369092ad1c3432833491eae73b87a6c33d/media/blink/webmediaplayer_impl.cc
[modify] https://crrev.com/910111369092ad1c3432833491eae73b87a6c33d/media/blink/webmediaplayer_impl.h
[modify] https://crrev.com/910111369092ad1c3432833491eae73b87a6c33d/media/blink/webmediaplayer_impl_unittest.cc
[modify] https://crrev.com/910111369092ad1c3432833491eae73b87a6c33d/third_party/WebKit/LayoutTests/media/autoplay-muted.html
[modify] https://crrev.com/910111369092ad1c3432833491eae73b87a6c33d/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
[modify] https://crrev.com/910111369092ad1c3432833491eae73b87a6c33d/third_party/WebKit/Source/core/html/HTMLMediaElement.h
[modify] https://crrev.com/910111369092ad1c3432833491eae73b87a6c33d/third_party/WebKit/public/platform/WebMediaPlayerClient.h

Labels: M-56 Merge-Request-55
Requesting M55 merge because it is solving a complaints that we've heard many times from developers and users.
Yes please, it's very annoying, not just for the notification but because it steals audio focus so in M54 it's almost impossible to surf the web while listening to say Spotify.

Comment 11 by dimu@chromium.org, Nov 4 2016

Labels: -Merge-Request-55 Merge-Approved-55 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M55 (branch: 2883)
Project Member

Comment 12 by bugdroid1@chromium.org, Nov 4 2016

Labels: -merge-approved-55 merge-merged-2883
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f2f93aa0a8ae4539e6d1499e7f0497c8925504d9

commit f2f93aa0a8ae4539e6d1499e7f0497c8925504d9
Author: Mounir Lamouri <mlamouri@chromium.org>
Date: Fri Nov 04 13:41:23 2016

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

Review-Url: https://codereview.chromium.org/2251073003
Cr-Commit-Position: refs/heads/master@{#429859}
(cherry picked from commit 910111369092ad1c3432833491eae73b87a6c33d)

Review URL: https://codereview.chromium.org/2471373005 .

Cr-Commit-Position: refs/branch-heads/2883@{#450}
Cr-Branched-From: 614d31daee2f61b0180df403a8ad43f20b9f6dd7-refs/heads/master@{#423768}

[modify] https://crrev.com/f2f93aa0a8ae4539e6d1499e7f0497c8925504d9/chrome/android/java_sources.gni
[add] https://crrev.com/f2f93aa0a8ae4539e6d1499e7f0497c8925504d9/chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/AutoplayMutedNotificationTest.java
[modify] https://crrev.com/f2f93aa0a8ae4539e6d1499e7f0497c8925504d9/content/renderer/media/webmediaplayer_ms_unittest.cc
[add] https://crrev.com/f2f93aa0a8ae4539e6d1499e7f0497c8925504d9/content/test/data/media/session/autoplay-muted.html
[modify] https://crrev.com/f2f93aa0a8ae4539e6d1499e7f0497c8925504d9/media/blink/webmediaplayer_impl.cc
[modify] https://crrev.com/f2f93aa0a8ae4539e6d1499e7f0497c8925504d9/media/blink/webmediaplayer_impl.h
[modify] https://crrev.com/f2f93aa0a8ae4539e6d1499e7f0497c8925504d9/media/blink/webmediaplayer_impl_unittest.cc
[modify] https://crrev.com/f2f93aa0a8ae4539e6d1499e7f0497c8925504d9/third_party/WebKit/LayoutTests/media/autoplay-muted.html
[modify] https://crrev.com/f2f93aa0a8ae4539e6d1499e7f0497c8925504d9/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
[modify] https://crrev.com/f2f93aa0a8ae4539e6d1499e7f0497c8925504d9/third_party/WebKit/Source/core/html/HTMLMediaElement.h
[modify] https://crrev.com/f2f93aa0a8ae4539e6d1499e7f0497c8925504d9/third_party/WebKit/public/platform/WebMediaPlayerClient.h

Status: Fixed (was: Started)
Project Member

Comment 14 by bugdroid1@chromium.org, Nov 5 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/949c8b5ab4c5ea959f13aebe9ef5eb6982da01a6

commit 949c8b5ab4c5ea959f13aebe9ef5eb6982da01a6
Author: John Budorick <jbudorick@chromium.org>
Date: Sat Nov 05 01:23:36 2016

[M55] Fix EmbeddedTestServer use.

createAndStartServer was added in M56.

BUG= 638463 
TBR=mlamouri@chromium.org

Review URL: https://codereview.chromium.org/2478703005 .

Cr-Commit-Position: refs/branch-heads/2883@{#469}
Cr-Branched-From: 614d31daee2f61b0180df403a8ad43f20b9f6dd7-refs/heads/master@{#423768}

[modify] https://crrev.com/949c8b5ab4c5ea959f13aebe9ef5eb6982da01a6/chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/AutoplayMutedNotificationTest.java

Verified in 55.0.2883.45 with mutes video-http://tinyurl.com/grukg24
This issue still happen. The media notification is shown, and Android shifts the sound from other apps (Spotify/SoundCloud/etc.) to the browser, even if the video is muted. 
Which version of Chrome are you using? There was a regression in Chrome 67 that was fixed in Chrome 69.
67, will update once I check on 69.
I confirmed it works as expected on Chrome Canary 70. Thanks for your response.

Sign in to add a comment