Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media autoplay permission #13

Open
Fyrd opened this issue Jun 8, 2017 · 25 comments
Open

Media autoplay permission #13

Fyrd opened this issue Jun 8, 2017 · 25 comments

Comments

@Fyrd
Copy link

Fyrd commented Jun 8, 2017

As browsers are starting to disable auto-playing videos & audio it would be great if we could easily request autoplay permission. Currently the app I'm working on has legitimate uses for autoplay and I'm not looking forward to telling users to go dig into Settings to enable it.

@marcoscaceres
Copy link
Member

marcoscaceres commented Jun 9, 2017

I'd be interested in hearing the use case for autoplaying videos with audio enabled. Can you provide a few more details?

@Fyrd
Copy link
Author

Fyrd commented Jun 14, 2017

@marcoscaceres Hey, sorry for the delay.

To be specific, I work on the Adobe Spark team on a product called Spark Video that is a video generating tool that allows users to record their narration for the video. It does not actually autoplay videos. The preview of the generated video is rendered via WebGL, and multiple audio files are played at different moments using timeOut delays. As a result this is being considered "autoplaying" the audio and is currently blocked in Safari TP by default since each audio isn't the direct result of a click.

@marcoscaceres
Copy link
Member

@mounirlamouri, thoughts?

@Silviu-Marian
Copy link

+1 for this
legitimate use cases for web apps that are primarily video, playlists, on-line radios, pretty much anywhere where media changes automatically and has to play without user intervention

Without this perm request it's a completely degraded experience
Safari 11 doesn't even tell you there's a setting there, and it's very buggy
Chrome has it under experiments (chrome://flags)

@mounirlamouri
Copy link
Member

At the moment, we do not want to expose a permission for autoplay. We might want to tell a website whether yes/no they can autoplay but not allow them to request this privilege nor offer a switch to users.

@0815fox
Copy link

0815fox commented Aug 29, 2018

Could you explain why? There are legitimate use cases on the web suffering from your strict decision, so an explanation is required.

@fernandocarvalhomovin
Copy link

I also need this feature. The site riofestiv.al, a project carried out with the main international art festivals that exhibit in Rio de Janeiro, invites the visitor to create a play list from the videos registered in the gallery of the site. In the end, the visitor needs to see the play list created without having to play each video separately. A media autoplay permission would be useful in this case.

@ghost
Copy link

ghost commented May 31, 2020

Could you explain why? There are legitimate use cases on the web suffering from your strict decision, so an explanation is required.

If a question as fair as this is ignored, what hope is there?

@ShoryuKyzan
Copy link

ShoryuKyzan commented Jun 17, 2020

Commercial products with dashboard webpages that need audible alarms to sound automatically. The page is started and left open. User may not have clicked anything, The the "MEI" (chrome "interactiveness" metric) may be high and allow autoplay, but on first time visiting the device page, it needs to be guaranteed to work.
This is the 2nd product I've worked on that would need this ability because of the autoplay permission change.

@sundayz
Copy link

sundayz commented Sep 25, 2020

Music and sound editing web applications are affected by this a lot. In a web app I am working on, we want to allow users to overlay sound effects on top of music, which automatically play at a given time. Safari blocks these sound effects, because while the user initially starts audio playback by clicking a button, these sound effects are considered "autoplay" and blocked.

@savroff
Copy link

savroff commented Oct 23, 2020

I'm be interested in hearing the use case for autoplaying videos with audio enabled. Can you provide a few more details?

@marcoscaceres would be happy to help with this one!
We are working on SVOD product and video there is a central part of it. People expect to play videos in the playlist with autoplay. Also as video is the only reason of why they are on the website, they want it to start playing right away.

Please take a look on a screenshot below:

CleanShot 2020-10-23 at 10 51 05

As you see we even ask people a preference on autoplay to make sure user is comfortable with it. So we would love to request permission right there and handle it via browser native modal.

So as current state - player act differently in different browsers and its brining a lot of confusion.

@t1gor
Copy link

t1gor commented Nov 24, 2020

+1 for @savroff - we're working on an online video chat, and we'd like to notify users when they get a message with sound.

@simon-lanf
Copy link

Working on digital displays, our only user is ourselves, this would make the process more straightforward.

@marcoscaceres
Copy link
Member

marcoscaceres commented Jun 17, 2021

Going back to the OP, this issue was dealing with "permission request" of "Media autoplay". However, the Permission API is now limited to querying permissions only.

I think this issue needs to move to either the media group or to HTML.

@jernoble, as Chair of the Media WG, could you provide us with some guidance?

@ndvbd
Copy link

ndvbd commented Jul 14, 2021

@marcoscaceres this is extremely needed. We have a dashboard for employees (~100 people) that when the tab is open, and a task arrives, it makes a nice alarm bell sound. The use case is legit, and there is no problem when the first time the page loads, to pop up a permission consent screen (exactly like the Browser Notification consent screen: Notification.requestPermission) that the user can allow auto-playing alert sounds, or reject them permanently, or ignore the pop up.

Otherwise, there is no proper alternative.

@marcoscaceres
Copy link
Member

@ndvbd, your use case seems subtly different from the video one. Just so I know where to best route your use case (or who else to ping at least), what HTML element or API are you using to play the alarm sound?

@ndvbd
Copy link

ndvbd commented Jul 20, 2021

@marcoscaceres It's an <audio> element that we .play() on.

@marcoscaceres marcoscaceres transferred this issue from w3c/permissions Jul 26, 2021
@marcoscaceres
Copy link
Member

Transferring the issue to w3c/autoplay in the hope we can get a response here...

@alastor0325
Copy link
Collaborator

FYI, the autoplay detection API is in the discussion, which might be the thing y'all are looking for? (although that is not a permission, it's a current status of whether a website can start autoplaying media)

@sundayz
Copy link

sundayz commented Jul 27, 2021

While detecting autoplay is a step in the right direction, I think what we all want is at least consistent behaviour. Today it's difficult to make something as simple as a playlist of songs.

I work on a web app that allows users to create "mixes" from songs and we've tested MediaElement, WebAudio and MediaElementAudioSourceNode, they all have different behavior in different browsers, and it was a HUGE pain to make one song in the playlist trigger the next to play. Our solutions include doing things such as muting audio before playing it, playing it muted, then unmuting it, which is apparently considered valid by browsers, but playing them normally is not (even though a user gesture activated the playback).

I don't think there will ever be a complete automatic solution that can cover all use cases, I understand the reluctance of having an autoplay permission request popup, but at least make the ruleset consistent and expand it so it covers all use cases.

Maybe allow events originating from media which was started by a user action to start other media unmuted? Maybe once media has loaded from a URL after a user action, allow other media from that origin to autoplay? Maybe only allow autoplay if the html element is in the viewport and the tab is focused? Anything would be better than what we have today.

I might be wrong about this but I even see browser vendors making autoplay exceptions for popular websites? Doesn't seem very fair.

@Exlord
Copy link

Exlord commented Aug 14, 2021

We have web conference/classroom app. Some of the main feature are Sharing webcam/Screensharing/Playing video by teacher ...
The users can enter the room using a custom url which includes a token, so when they click on the link and enter the room they have no interaction with the page so if video that is active in the room fails to autoplay
Also if user refresh the page mid session they get autologedin so they have no interaction with the page but again any media playing in the room should be autoplayed

@Lancear
Copy link

Lancear commented Aug 26, 2021

Could you explain why? There are legitimate use cases on the web suffering from your strict decision, so an explanation is required.
@mounirlamouri, this question seems to have never been answered. Could you provide some info regarding the decision.

@marcoscaceres
Copy link
Member

Just fyi, I mounirlamouri is no longer working on this, so he might not respond. If anyone else can answer, that would be greatly appreciated.

@sajphon
Copy link

sajphon commented Aug 8, 2022

How has this not been addressed in a year ? 🤦‍♂️

@hamishwillee
Copy link

hamishwillee commented Jan 27, 2023

FWIW the permission-policy autoplay addresses a site indicating that it allows autoplay in "general".

However a browser can happily ignore this or have other conditions for blocking autoplay. For example, some might allow autoplay if the user touches the element, but not otherwise. Perhaps that kind of transient activation might be a good approach to be standardized, in particular also requiring the site permission.

FYI Autoplay detection https://www.w3.org/TR/autoplay-detection/#query-by-a-media-type is enabled in Firefox nightly from FF110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests