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,011
  • 19
  • 57
  • 99
  • 1
    Stop Tube effectively prevents HTML5 videos from buffering and auto-playing. This feature is used for conserving your bandwidth. Its main ability is to halt buffering.. Also, the add-on does not require you to restart Firefox, simply install it and you are good to go. – BDRSuite Mar 24 '15 at 17:00
  • 2
    [This is how you prevent YouTube from automatically playing videos that you did not choose](http://i.stack.imgur.com/IBfaa.png) (recommended videos) – Vinayak Mar 25 '15 at 00:44
  • 1
    @Vinayak The problem with that setting is that it is purely temporary. As soon as you reload a page or go to a different YouTube page, it resets, making it useless. – Tyler Durden Mar 25 '15 at 03:18
  • @TylerDurden Try one of the [extensions I posted as an answer](http://superuser.com/a/863541/10259) in that question. AFAIK, they will work whether YouTube uses Flash or HTML5 to show the video. – galacticninja Mar 25 '15 at 04:37
  • @galacticninja I am going to try all the answers and pick the best one. Vinayaks comment does not work for the reason I already listed. – Tyler Durden Mar 25 '15 at 13:02
  • @TylerDurden I just tried turning Autoplay off and refreshing the YouTube page and it was still turned off. I'm using Chrome with the HTML5 player. Are you clearing your browser cookies on exit or using third party tools like CCleaner to do that? If that's the case, your Autoplay setting will not be honored. – Vinayak Mar 25 '15 at 14:18
  • @TylerDurden I tried it again with Firefox 36 this time and it's still working as expected. Autoplay doesn't turn back on when you refresh the page or watch another video. My guess is you're deleting browser cookies which sets Autoplay back to its default setting which is 'enabled'. – Vinayak Mar 25 '15 at 14:42
  • The "closed as duplicate" situation is a bit frustrating here. The question that is allegedly the same as this one actually asks "I want to keep some videos open in tabs, but not play them". It's a bit different from a more general "makes sure no videos autoplay anywhere", even if the answers are the same. Hence, search results for the latter end up at THIS question, which doesn't have any accurate answers as of 2022. I guess the link is fine. But, I wonder if the title and question of the "true duplicate" should be edited to reflect the generality of the answers? – MRule Jul 22 '22 at 08:20

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?

galacticninja
  • 6,188
  • 16
  • 78
  • 120
  • FYI at least in Mozilla Firefox 103.0 and on YouTube as of 2022/07/22, this does not work: Youtube does something that allows it to bypass Firefox's controls. Videos still autoplay even with these settings enabled. – MRule Jul 22 '22 at 08:14
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,304
  • 12
  • 17
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,212
  • 2
  • 22
  • 33
-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,625
  • 10
  • 54
  • 89
  • 2
    OP's question is about disabling the loading/playback of HTML5 videos as soon as the page is open, and not about the new "Autoplay" feature of Youtube, which opens a new video after finishing playing the current one. –  Mar 25 '15 at 19:12
  • 3
    @screened The OP's question is about both those scenarios. My answer solves the second half of the question. I shall update it with a solution to the first half when I come across a solution for that as well. – Vinayak Mar 25 '15 at 23:14
  • 1
    Ah, I hadn't read it carefully. The part you'd answered is off-topic here though. It should be moved to https://webapps.stackexchange.com/ , if there isn't a post about it there already. –  Mar 26 '15 at 05:43