[-] Not Auto Play Video

Alex302

Filters Developer
Staff member
Administrator
Meteorman, the automatically videostarts on my end in IE and Chrome.
Maybe I don't understand you. Do you want to disable autoplay, or you want for enable autoplay?
 

Meteorman

New Member
On this page is a video that will play automatically. I want that video not Play but blocked.

Sorry for my bad english
 

Blaz

Moderator & Translator
Staff member
Moderator
@Alex
We need replace text feature and then we can disable it via Adguard.
"autoplay":true must be set to "autoplay":false and then it is not auto-starting.
 

avatar

Administrator
Staff member
Administrator
Yep, you're right @Blaz, once we implement these rules it will be easy to do this.
 

DJRumpy

New Member
Can you use some sort of generic css injection rule/filter to inject the enabled;false?

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

Really wanting this feature as well.
 

DJRumpy

New Member
Correct. CNN is a good example. Short of blocking the content entirely AdGuard appears to be one of the few Safari extensions that even supports CSS injection.
 

avatar

Administrator
Staff member
Administrator
CSS is not enough here. <video> autoplay attribute should be removed to accomplish it.

However I am not sure if removing this attribute in runtime will change video behaviour.

Classic userscript doing it:
http://diveintohtml5.info/examples/disable_video_autoplay.user.js

However, this won't help with videos added dynamically, after userscript has finished it's work. We may need to use a "MutationObserver" watching for the new "video" tags.
 

DJRumpy

New Member
CSS is not enough here. <video> autoplay attribute should be removed to accomplish it.

However I am not sure if removing this attribute in runtime will change video behaviour.

Classic userscript doing it:
http://diveintohtml5.info/examples/disable_video_autoplay.user.js

However, this won't help with videos added dynamically, after userscript has finished it's work. We may need to use a "MutationObserver" watching for the new "video" tags.
I haven't looked at the page source but that may be the case. Since click to flash and click to play are no longer supported there are currently no alternatives for Safari that work as far as I can tell. It will be awesome if they can implement it in some fashion.

Thanks!
 

avatar

Administrator
Staff member
Administrator
There is no easy way to detect if this is a Flash video or something else (like a game or something like that).
 

Joe Smith

New Member
Btw, guys, I've made our own userscript which does it:
https://github.com/AdguardTeam/Userscripts/raw/master/disableAutoplay/disable-autoplay.user.js

But please not that it is done for HTML5 video only.
I tried this but it's not working for all videos, some still auto loads, example of pages where it doesn't work:

https://www.younow.com/explore/dance | On the side you will see webcam stream auto loading after few seconds.
https://www.google.com/adsense/start/#?modal_active=none
http://news.nationalpost.com/news/minion-toy-sounds-like-it-is-swearing-822672

But there is a Chrome extension that worked on all sites that I tried so far, it prevents both HTML video and audio from auto loading.
There is a source code of it, maybe you could take a look at it and with their permission improve your script? https://github.com/Eloston/disable-html5-autoplay/
 

avatar

Administrator
Staff member
Administrator
My userscript is really simple and it won't cover all case that's true.

The extension you've linked is much more complicated and covers more cases, but it cannot be easily converted to a userscript.
Anyway, i'll look into it, thank you!
 
Top