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 descriptionSteps 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.
,
Oct 24 2017
,
Oct 24 2017
,
Oct 24 2017
,
Oct 24 2017
,
Oct 24 2017
Removing the warning sounds fair enough given that we reject the promise now.
,
Oct 25 2017
+fbeaufort@ in case of he wants/needs to update a blog post.
,
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
,
Oct 25 2017
|
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by sandeepkumars@chromium.org
, Oct 24 2017Labels: Needs-triage-Mobile Needs-Feedback