No play button fallback for videos in Data Saver is on
Reported by
luc.pot...@gmail.com,
Jan 23 2018
|
||
Issue descriptionExample URL: https://myscript.com/calculator/ Steps to reproduce the problem: 1. Create a page with a video tag with "autplay" attribute and no "controls" attribute. 2. Turn on Data Saver in Chrome settings What is the expected behavior? I would expect Chrome to force the "controls" attribute to true when Data Saver in on. Otherwise it's impossible to play a video. What went wrong? There is no way to play the video because of this Data Saver mode and the absence of the "controls" att Did this work before? No Is it a problem with Flash or HTML5? HTML5 Does this work in other browsers? Yes Chrome version: 63.0.3239.111 Channel: stable OS Version: 5.0 Flash Version: Contents of chrome://gpu:
,
Jan 24 2018
FWIW, we can't force the controls attribute as it may as the video may already have controls even if it has the autoplay attribute. We are looking into dropping the autoplay restriction when Data Saver is enabled and this should make things a bit better as <video autoplay muted> would work and this issue is particularly problematic on these videos.
,
Jan 24 2018
As mlamouri said, most sites disable controls in order to add their own. It is up to the site to ensure that users have some way of starting the video if they choose to disable Chrome's logic. This is working as intended.
,
Jan 24 2018
I understand your point. However if there is no way to detect in JS that Data Saver mode is on, it's impossible for the developer to conditionally display the controls, is it? There are many situations where you want do display a muted video without controls.
,
Jan 24 2018
FYI, I initially posted a comment on GitHub here: https://github.com/w3c/battery/issues/9#issuecomment-358309992 but it seems impossible to detect power saving mode.
,
Jan 24 2018
You can check whether the play promise gets rejected. If so, you will know that autoplay is blocked and you need to add controls. Here is a bit of pseudo code to get you started:
var promise = document.querySelector('video').play();
if (promise !== undefined) {
promise.then(_ => {
// Autoplay started!
}).catch(error => {
// Autoplay was prevented.
// Show a "Play" button so that user can start playback.
});
}
,
Jan 24 2018
Thank you for the snippet. I had not thought of this approach. |
||
►
Sign in to add a comment |
||
Comment 1 by dalecur...@chromium.org
, Jan 23 2018Components: -Internals>Media Internals>Media>UI
Owner: dah...@chromium.org
Status: Assigned (was: Unconfirmed)