7

I am using Firefox version 36.0.4 which has HTML 5 video. How can I stop it from autoloading videos in YouTube. For example, when I got a YouTube page, videos will immediately start playing. Also, When I watch a video on YouTube, after it is done, somehow YouTube decides to play ANOTHER video which I did not pick and then start to automatically play it. I find this extremely annoying. How can I block this behavior?

Please note that solutions from Is there any way to disable a YouTube video from automatically starting in Firefox? don't work because they are about Flash videos which isn't the case here

Tyler Durden
  • 6,333

5 Answers5

2

As of Firefox 69, you can now configure Firefox' settings to block all or specific websites from autoplaying videos.

To always allow or disallow autoplay for all videos or media with sound:

  1. Click the menu button menu button and choose Options.
  2. Select the Privacy & Security panel.
  3. Scroll down to the Permissions section.
  4. Go to Autoplay → Settings. Default for all websites: Block audio is the default setting. Set this to Block Audio and Video to block videos too. Or set this to Allow Audio and Video and you can configure blocking autoplay on a per-site setting, instead.

Youtube.com's site permissions will look like this if set to block video autoplay. You can also opt to set the autoplay permission to allow autoplaying videos for youtube.com only and not other sites.

Youtube.com Firefox site permissions


Firefox versions prior to 69 can use the YouTube High Definition extension (also a Chrome extension) to stop YouTube from auto playing videos, among other features:

YouTube High Definition screenshot - disable YouTube auto-play

This is from another answer of mine in Is there any way to disable a YouTube video from automatically starting in Firefox?

0

Personally I use the Flashblock addon, which (despite the name) also stops autoplay for HTML5 video (and Silverlight, on Windows), by making them click-to-load. You can also whitelist sites where you'd like content to load automatically, and optionally sync that whitelist via Firefox Sync.

In further testing (I've had YouTube whitelisted for a while, since the autoplay doesn't bother me), they seem to have changed their site design in a way that messes with Flashblock, as you can't actually click on the blocked video to start it. The following style (applied with Stylish or another method) works around that:

div#theater-background { z-index: -1; }

Also, as a further caveat: Since YouTube implement their own navigation (following internal links doesn't actually trigger a "real" page load), the blocking won't be reapplied for subsequent videos. That may or may not be a problem. (It'll still occur every time you arrive at a YouTube page from outside.)

FeRD
  • 1,394
0

I am a great fan of the ViewTube userscript. You will need Greasemonkey (Firefox) or Tampermonkey (Chrome) if you decide to pursue this route.

http://isebaro.com/viewtube/ is the main publishing URL for the script. Essentially it creates a container where the YouTube video would normally appear, and you can choose to load the video element via VLC's web plugin or embedded HTML5 video tags. It also has options like enabling or disabling autoplay, and does not load additional videos unless you are browsing a playlist.


In Firefox, for 1080p and 60fps videos on YouTube with ViewTube, you may need to forcibly enable Media Source Extensions (check https://www.youtube.com/html5 to see if MSE are enabled).

  1. Visit about:config in the Firefox URL bar and hit enter.
  2. Confirm you will be careful.
  3. Right-click and select New > Boolean.
  4. Name the preference media.mediasource.ignore_codecs.
  5. Set its value to True.
0

Currently I use another alternative, because I find its specific limitations less annoying:

NoScript, set to "Allow scripts globally" and Embeddings -> "Apply these restrictions to whitelisted sites too". Otherwise you may also need to disable the XSS protection if it keeps popping up when you don't want it. It's reliable at blocking <video>. Temporary (only) allow is under NoScript button -> blocked objects.

It's intended to do click-to-play as well, but on Youtube that (usually) doesn't work.

Really I just want something stupidly robust, like the Flash click-to-play on Chrome :p. My annoyances with the other options:

FlashStopper: "highly dependent on websites autoplay implementation and is susceptible to changes made by the sites." Seems over-complex - why not have a cruder fallback for unhandled videos?

FlashBlock: no placeholder on a couple of popular sites, and the only documented way to enable those videos temporarily is to manually add a user stylesheet.

sourcejedi
  • 3,860
-2

This is how you disable Autoplay on YouTube: Disable Autoplay (click the picture to enlarge it)

If Autoplay turns back on after you've restarted the web browser or refreshed the page, it probably means that browser cookies that store your Autoplay setting were deleted.

You may have set your web browser to do this automatically or you may be using third party software like CCleaner to delete them. Either way, Autoplay will revert back to its default setting (which is 'enabled') if the browser cookies are deleted.

Vinayak
  • 10,885