How to stop HTML5 auto play?

Joined
Dec 8, 2009
Messages
453
Reaction score
10
Points
18
Location
The same as Sheldon Cooper - East Texas
Your Mac's Specs
iMac 2014 i5 5k 32gb 1tb fusion, second TB display, 2014 MBA
This probably applies to Safari/IOS also, but there isn’t a generic browser forum.

Anybody bothered by auto playing HTML5 videos that are increasing in number by the day? Nothing like surfing in a quiet coffee shop and and suddenly having to frantically page though a dozen tabs to find the ad or talking heads that are blabbing away.

Turning the sound off fixes the audio problem, but unless you are on a genuine hi-speed broadband link (scarce in rural areas) you can find yourself wondering why the ‘Net is so slow this morning, then you find a hires, five minute video ad playing in the background. And of course, you give up the pings and dings that tell you of mail, or messages.

Another fix is to use an off-brand browser like Sunrise that doesn’t (yet) have HTML5 capability, but that is just a stopgap.

Now the question, has anybody found a way to block them in Safari? I have just started my search and I was surprised to find nothing available. More research finds that the HTML5 spec is imbedded in the HTML stream and isn’t a plugin like flash that can be blocked. Plus it is impervious to something like No-Script - it isn’t javascript.

Supposedly, Firefox has an Autoplay flag that can be set to false, but so far I haven’t made that work.

As advertisers realize that they can throw this in any surfer’s face on common, it is just going to get worse. Hopefully, as people get really ticked, the browsers will eventually have a blocker switch, but that will take time and a lot of complaints before Madison Avenue allows them to be stopped by the user.
 

pigoo3

Well-known member
Staff member
Admin
Joined
May 20, 2008
Messages
44,210
Reaction score
1,418
Points
113
Location
U.S.
Your Mac's Specs
2017 15" MBP, 16gig ram, 1TB SSD, OS 10.15
Anybody bothered by auto playing HTML5 videos that are increasing in number by the day? Nothing like surfing in a quiet coffee shop and and suddenly having to frantically page though a dozen tabs to find the ad or talking heads that are blabbing away.

Yes...VERY irritating! Especially if these are the videos that I'm thinking of...that have no controls (stop, pause, etc.)!!!:(

- Nick
 

chscag

Well-known member
Staff member
Admin
Joined
Jan 23, 2008
Messages
65,248
Reaction score
1,833
Points
113
Location
Keller, Texas
Your Mac's Specs
2017 27" iMac, 10.5" iPad Pro, iPhone 8, iPhone 11, iPhone 12 Mini, Numerous iPods, Monterey
Check out the following MacRumors thread: LINK
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
You'd have to find something that looks for <video> tags and replaces them with something else.

The tricky part here is that developers determine whether or not the video plays. The autoplay attribute here is what's causing your issue. Chrome has an autoplay blocker (here) as does Firefox (here) if you use one of those as well.
 
OP
cptkrf
Joined
Dec 8, 2009
Messages
453
Reaction score
10
Points
18
Location
The same as Sheldon Cooper - East Texas
Your Mac's Specs
iMac 2014 i5 5k 32gb 1tb fusion, second TB display, 2014 MBA
Check out the following MacRumors thread: LINK

Yes. I found that before I posted, and installed it, but so far I have not been able to make it stop anything and certainly not HTML5 videos. And googling shows that I am not the only one.
 
OP
cptkrf
Joined
Dec 8, 2009
Messages
453
Reaction score
10
Points
18
Location
The same as Sheldon Cooper - East Texas
Your Mac's Specs
iMac 2014 i5 5k 32gb 1tb fusion, second TB display, 2014 MBA
In my quest to stop all HTML 5 autoplaying videos I have found that browser developers don’t consider it a problem. “Don’t watch it or don’t listen to it” is their answer. And - “Besides, if we allow it to be disabled, then the developers will get really ticked off and tell people to use another one.”

So far I can do little with Safari, but Firefox is much more open. The problem is not so much the talking heads that start blabbing somewhere in some tab, although in a quiet office or coffee shop it can be embarrassing, but on a fixed income (called data caps) it just sucks up money.

Since the autoplay is an HTML element, normal blocking does not work. If you google about the problem, all you get is the advice to install Click-to-Flash or some such which is worthless against <video controls autoplay>. Everybody is concerned about blocking YouTube HTML5 for some reason, but that has nothing to do with CNN and Yahoo autoplaying in your face.


The best solution is to build a front end that strips the tags before the browser sees them, but that isn’t a task that I want to crank up yet. Maybe someone else will.

For now, with Firefox I am attempting to spoof the sender into thinking that I don’t have the proper plugins.

On the url line, type about:config and say yes to the warning. Then search on Media.xxx and set the following to false.

media.autoplay.enabled;false
media.ogg.enabled;false
media.wave.enabled;false
media.webm.enabled;false
media.apple.mp4.enabled;false

So far so good as respects the autoplaying. I haven’t decided if it actually prevents downloading yet, since my connection is so fast that I can’t really pull it out of the Little Snitch monitor. And, I have discovered that Netstat isn’t working on Yosemite. Still have to knock that problem out.

But, progress is slowly being made.

Now, about the latest news that Samsung Smart TV’s are bringing you advertisements in the middle of your locally watched video. Of course, the only reason is for "An Enhanced Customer Viewing Experience"...
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
The best solution is to build a front end that strips the tags before the browser sees them, but that isn’t a task that I want to crank up yet. Maybe someone else will.
This was going to be my suggestion - removing the autoplay attribute so as to prevent any autoplay. I don't actually think this is all that difficult - all one would need to do is remove all attributes from video tags using something like:
Code:
document.getElementsByTagName("video”).removeAttribute(“autoplay”)
You can even inject this relatively easily with a Safari extension. Hmmm...I might take a crack at this later.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
And I'm done. Here's ( View attachment RemoveAutoPlay.safariextz.zip ) an extension I just whipped up that will strip all video tags on a page of their autoplay attribute. In other words, any HTML5 based video player that autoplays the standard way will no longer autoplay.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
That's because it's a Flash based player. ;)
 
OP
cptkrf
Joined
Dec 8, 2009
Messages
453
Reaction score
10
Points
18
Location
The same as Sheldon Cooper - East Texas
Your Mac's Specs
iMac 2014 i5 5k 32gb 1tb fusion, second TB display, 2014 MBA
That's because it's a Flash based player. ;)

I don't have flash. One thing that I definitely agreed with Steve Jobs on, is that Flash is the root of all evil. Took it off my first Macbook that was running red hot and never ran it again.

No flash on my machines. Possibly something else is running it, but not Adobe flash.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
It would appear that they use Flash unless it's not available.

It looks like that website uses some Javascript to load things and consequently, they don't use a standard HTML5 based player. Unfortunately, my coding skills aren't good enough to account for them all.
 
OP
cptkrf
Joined
Dec 8, 2009
Messages
453
Reaction score
10
Points
18
Location
The same as Sheldon Cooper - East Texas
Your Mac's Specs
iMac 2014 i5 5k 32gb 1tb fusion, second TB display, 2014 MBA
It would appear that they use Flash unless it's not available.

It looks like that website uses some Javascript to load things and consequently, they don't use a standard HTML5 based player. Unfortunately, my coding skills aren't good enough to account for them all.

I'm not really approaching this like I had a research grant, just off and on when some loud video really ticks me off that day. It would appear that there are several ways that web coders use to plant the video in your face. Many still use Flash (why?) but fall over to HTML if it isn't available. I can stop those with add on blockers, since they use plugins.

It is the embedded video tag in the HTML stream that is immune to any third party add-ons. The browser thinks it is regular code and executes it.

So, either the browser writers are going to have to code in a checkbox nullifier for that tag, which will take a coder who is both rich and ready to get death threats from industry, or a pre-process will have to be scripted to dump the tag before the browser gets it.

Or something else that I haven't thought of. Possibly a law that allows a user to bill for unwanted data usage on a monthly basis?:Angry:

Years ago, I would have jumped at the chance to work on this, and probably learn a new language at the same time, but so far I just haven't got the engine up to speed enough to tackle the task.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Many still use Flash (why?) but fall over to HTML if it isn't available.
That's a fairly simple answer - Flash works regardless of the underlying browser. If you make a player work with Flash, you don't have to concern yourself with HTML spec support in the browser being used by your users.

So, either the browser writers are going to have to code in a checkbox nullifier for that tag, which will take a coder who is both rich and ready to get death threats from industry, or a pre-process will have to be scripted to dump the tag before the browser gets it.
I imagine that this is possible and would only require injecting a script at the end of a page load. I really want to figure this out (this is what happens when I get intrigued by things...) now.
 
Joined
May 10, 2015
Messages
1
Reaction score
0
Points
1
Does not work an macworld

The extension does not work an macworld.com or pcworld.com. Als removing the whole container with AdBlock doesn't help. They seem to load the video with JavaScript.

When auto-play videos play anyway | Macworld

Maybe you could make your extension more robust to disable autoplay for videos added by JavaScript.
 
Joined
Jun 23, 2015
Messages
1
Reaction score
0
Points
1
Yahoo uses JAVASCRIPT

Yahoo uses JAVASCRIPT
to make those ANNOYING videos play
REGARDLESS if you have CLICK TO FLASH
in Safari (latest version)
Have to go thru preferences, enable DEVELOPER menu
and then click on DISABLE JAVASCRIPT whenever going to
https://www.yahoo.com
because NO EXTENSION will BLOCK Yahells AUTOPLAY
 
Last edited:
Joined
Dec 2, 2016
Messages
1
Reaction score
0
Points
1
Could not install the extension on Sierra

And I'm done. Here's ( View attachment 21798 ) an extension I just whipped up that will strip all video tags on a page of their autoplay attribute. In other words, any HTML5 based video player that autoplays the standard way will no longer autoplay.

I could not get the removeautoplay to install on Mac Sierra 10.12.1 Do you have a fix for this or know of some way to stop HTML5 player from playing automatically when I open a page.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top