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

Issue 777609 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

HTMLMediaElement play warning emitted in console inside try block "API can only be initiated by a user gesture."

Reported by kevin.br...@sendtonews.com, Oct 23 2017

Issue description

Steps to reproduce the problem:
1. play a non muted media element inside a try block
2. catch the error, or catch the promise
3. watch the console give a warning

What is the expected behavior?
All errors are caught so no warning should happen.

What went wrong?
A warning was output

Did this work before? No 

Chrome version: 61.0.3163.98  Channel: stable
OS Version: 7.0.0 RS988
Flash Version: 

Currently the only way to reliably test if a browser supports non-muted autoplay, is to try it, then if it fails, deal with the failure.

On mobile, or in Q1 '18 when desktop chrome is slated to have non muted autoplay disallowed, this forces a warning to the console that can't be removed. There is no code path to test this without causing a warning. If I catch the promise and resolve it, then no warning or error should be outputted.

Testing user agents for version numbers and deciding if I should mute video elements or not based off of versioning code is an unacceptable and unreliable solution.
 
Cc: msrchandra@chromium.org nyerramilli@chromium.org sandeepkumars@chromium.org
Labels: Needs-triage-Mobile Needs-Feedback
@kevin.brogan: Thanks for the report!!

Could you please attach a media file where you're seeing the issue, details of your device, and if possible attach a screencast? that would help us in triaging of the issue.

Thanks!!

Components: -Blink Blink>Media
Cc: dah...@chromium.org mlamouri@chromium.org
Cc: -mlamouri@chromium.org beccahughes@chromium.org
Cc: -msrchandra@chromium.org mlamouri@chromium.org
Owner: mlamouri@chromium.org
Status: Assigned (was: Unconfirmed)
Removing the warning sounds fair enough given that we reject the promise now.
Cc: fbeaufort@chromium.org
+fbeaufort@ in case of he wants/needs to update a blog post.
Project Member

Comment 8 by bugdroid1@chromium.org, Oct 25 2017

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

commit bdc4ef0f025c58da727360775b515e1fa9f80d43
Author: Mounir Lamouri <mlamouri@chromium.org>
Date: Wed Oct 25 17:31:00 2017

Autoplay: no longer show a console warning when attempting to play without a user gesture.

We already reject a promise which will create a console error if
handled. When not handled, it means that the website is in control and
we should not pollute the console.

Bug:  777609 
Change-Id: Ib59947a83c675660d3f2ab423ade0b24b8b31a89
Reviewed-on: https://chromium-review.googlesource.com/735326
Reviewed-by: Becca Hughes <beccahughes@chromium.org>
Commit-Queue: Mounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#511503}
[modify] https://crrev.com/bdc4ef0f025c58da727360775b515e1fa9f80d43/third_party/WebKit/LayoutTests/http/tests/media/autoplay/document-user-activation-navigation-nogesture-expected.txt
[modify] https://crrev.com/bdc4ef0f025c58da727360775b515e1fa9f80d43/third_party/WebKit/LayoutTests/media/media-play-promise-expected.txt
[modify] https://crrev.com/bdc4ef0f025c58da727360775b515e1fa9f80d43/third_party/WebKit/LayoutTests/media/video-play-require-user-gesture-expected.txt
[modify] https://crrev.com/bdc4ef0f025c58da727360775b515e1fa9f80d43/third_party/WebKit/Source/core/html/media/HTMLMediaElement.cpp

Status: Fixed (was: Assigned)

Sign in to add a comment