I recently made a really basic game engine for my dumb games[1] and discovered something interesting about this limitation: Ctrl does not count as a user interaction. I’m guessing because it’s a modifier key.
I wanted my game to have good UX so I cleverly required inputs before any sound would be made. Usually via the game selection screen. But if Ctrl is your “action” key, it doesn’t actually allow the Audio API to work, so you’ll miss some sounds.
I get why this restriction is in place but sometimes it makes good faith attempts at good UX a bit complicated.
Interesting, I didn’t know that. I decided to standardize on “click to play”, and added some logic to try starting the audio engine again if it didn’t start the first time.
I don't remember if you can crouch in it or not, but a game like https://warbrokers.io could definitely have a crouch mechanic, and it would make sense for it to use ctrl.
This is great. Safari has settings for this but plenty of sites (e.g. yahoo) punch through them anyway. The web has become so incredibly user-hostile in the last decade.
It has always been user hostile since the days of pop-over ads, pop-under ads, obnoxious browser toolbars that were basically malware, etc. It seems like since around the year 2000 it’s been a nonstop fight between people who want to extract money and advertising impressions out of users versus people trying to keep the web user friendly. I think we only had maybe a 5 year run of the web being user-friendly at the beginning, and that was just because people hadn’t quite yet figured out how to extract money from web usage.
Well, that, and the Web was created a bit before the commercialisation and privatisation of the Internet as a whole.
Since the Terms of Service of the Internet running on the National Science Foundation's backbones actually prohibited commercial activity, that put a crimp in the style of people who would try to extract money from its usage, don't you think?
I would prefer that audio require explicit opt-in, not just interaction. The biggest offender I regularly encounter is not even what I would normally consider an evil website: npr.org
Essentially it's disabling gesture activation, so if you want to allow audio you need to do this explicitly. Note however, that whenever you directly visit a video file, audio will still play but this is very rarely the case.
Read the comment section on the article for some discussion on this. Firefox does allow users to opt-in to inaudible autoplay video blocking but it’s not the default.
The reasoning is that advertisers can approximate video with canvas tags, gifs, or just swapping out images really fast, defeating the point and needlessly burning more CPU/bandwidth. But for users that care you can still opt-in to this behavior and presumably few enough people do this that the workarounds aren’t widespread.
(The key difference seems to be that playing audio has a clear path that’s straightforward to block but “video” can be approximated by any webpage interactivity making it harder to lock down)
Would you rather websites keep using animated GIFs instead? Because I think this is why GIFs are still in active use despite being a terrible format in terms of compression/bandwidth: browsers impose all of these limitations on video, which don't apply to GIFs because they're images.
Yup, this baffles me too. The counterarguments seem to be that "you're gonna see autoplaying content anyway and this just makes the advertisers life harder".
I think Google added an option to disable all/most autoplaying content in Chrome a couple of years ago. But they quickly backtracked and removed that flag, claiming that it breaks in-browser games or something like that. It's a pretty weak reason for me, I don't care about in-browser games, I just want to read a news article without some irrelevant video popup distracting me, plus blasting audio.
No, but animated GIFs have been standard in browsers for so long that I think you'd end up breaking lots of things. Loading spinners, for example, are often GIFs. Maybe you'd prefer if those were static, but suspect many users would think a website and/or their browser was broken if they didn't move.
You almost can, other than the annoying animated image exception (I would really like media controls on those, you can currently only set them to play once, never, or infinitely). Privacy and Security -> under "Permissions" click settings next to autoplay -> select "Block Audio and Video" under "default for all websites".
For animated images I'm not sure if it is exposed in the UI but in about:config change image.animation_mode to "once". If you want to replay it after that, you will need to open the image in a new tab. It is somewhat easy to miss them with this setting since even images at the bottom of the page will start their single animation when you hit pagedown (even if you move the page view up again almost immediately).
Mostly this autoplay blocking has been wonderful, a massive improvement. The one slight annoyance I've noticed is that the exceptions managament isn't as flexible as uBlock origin's configuration and you can't tell Firefox to unblock all of Bandcamp. I'm not sure if this is something that could potentially be done in an addon. The other thing I'd really like is a way to default "loop" to off on media controls so that I can just play the media once by default when I do play it. Oh yeah, for some reason I can't imagine Twitter tries hard to make videos repeat and current autoplay restrictions aren't able to stop that (I don't have an account so I suspect this is a "fuck you for not making an account" thing. I can't imagine anyone putting up with that more than briefly).
Thanks for recommending that. It’s fascinating seeing the diversity of opinions amongst commenters. Also Firefox’s reasoning behind not blocking inaudible video was fascinating. Basically, if inaudible autoplay video is blocked advertisers work around it using canvas tags which is worse for everyone.
The correct solution to this problem is to allow websites to require sound. Add a HTML meta tag that tells the browser "Hey, this page won't load properly without sound, so ask the user if they want to enable sound, or navigate away". If the user really wants to load the page without sound, they can override it in about:config.
All of the other solutions are dumb and I can't believe browser vendors have settled for them.
(Could it be related to the biggest browser vendor also running their own video site that bypasses all autoplay restrictions? Nah...)
There is no API to detect that auto blocking is enabled and manual intervention is needed.
You are forced to play a fake audio tag with sound and detect that it's event does not fire. This is impossible, so you do it with a timeout and throw your hands up.
when i was 9 and first used the web i was annoyed by how pages can subvert you and steal focus and show popups (and do audio via flash) etc and even then it was unambiguously obvious that this is a misfeature that should not exist. how do these people have such cognitive dissonance over such simple questions other than being so full of themselves that they think pretending to be open minded by pondering such obvious questions is fooling anyone.
you are designing the fabric of a medium where the main use case is to open 20 pages at once from completely random strangers across the internet. OBVIOUSLY it should not autoplay sound by default.
(also the same reasoning explains why JS should not be a thing, because it slows everything down and causes bugs by letting casuals design the fabric instead of the browser just coming with what's needed (you'd think they can do this with trillions of man hours))
i was with up until the last paragraph. i like to make fun of javascript as much as the next person (unless you're a dyed in the wool only programs in JS type person, then i make fun of you too ;-) however, the web definitely has benefited from local interactive programming. it just so happens that JS was the language of the web browser. thinking that the internet would be nearly as interesting without some sort of local interactive programming in the browser just screams trolling or someone that really doesn't remember the early days of the web in its full glory.
I wanted my game to have good UX so I cleverly required inputs before any sound would be made. Usually via the game selection screen. But if Ctrl is your “action” key, it doesn’t actually allow the Audio API to work, so you’ll miss some sounds.
I get why this restriction is in place but sometimes it makes good faith attempts at good UX a bit complicated.
[1] https://arcade.pointless.click/?game=bankrun