4

When accessing certain websites that have YouTube videos embedded I have noticed that sometimes when the webpage loads the YouTube video will automatically play and taking a look at the source code it appears this is decided by a modifier to the URL of the embedded video.

My question is whether there is some kind of setting (in any browser or YouTube itself) or perhaps a Chrome extension which allows you to disable autoplaying from any website regardless of whether the URL has been setup to autoplay?

Thus far I haven't been able to find any extension or setting to allow this. Is it possible that some sort of modified certificate for one of the sites that YouTube-embedded videos pull information from could prevent this?

  • Would an adBlock browser plugin suite your needs or is it not ads you are asking about? – Coops Nov 24 '16 at 14:34
  • Hi, I'm looking for a way to prevent embedded youtube videos from autoplaying as some sites (especially blogs) have these play automatically. – Ethan Field Nov 24 '16 at 14:36
1

Not only for Youtube videos, but for all videos:

In firefox, to stop autoplay, open the about:config page and set media.autoplay.enabled to false

In Chrome, to stop autoplay, open the chrome://flags/#autoplay-policy page and choose Document user activation is required

After change, relauch your browser.

| improve this answer | |
4

Here is a user script I wrote that can do this:

// ==UserScript==
// @name         Stop Youtube Embedded Video Autoplay
// @namespace    none
// @version      0.1
// @description  Stop autoplaying YouTube Embedded Videos.
// @author       none
// @match        *://*/*
// @grant        none
// ==/UserScript==

(function() {
'use strict';

var vid = document.getElementsByTagName("iframe");
for (var i = 0, l = vid.length; i < l; i++) {
    var vidno = vid[i];
    var reg = new RegExp(/.*youtube.*autoplay=1.*/i);
    if (reg.test(vidno.src)){
        vidno.src=vidno.src.replace("autoplay=1", "autoplay=0");
    }
}


})();

You'll just have to create a new UserScript in Greasemonkey,Tampermonkey, etc. It'll run on every page, look for embedded YouTube videos and stop them autoplaying.

| improve this answer | |
1

You can use the Chrome extension Stop autoplay for YouTube.

On Firefox you can use YouTube No Buffer.

| improve this answer | |
  • 1
    Will this prevent autoplay for embedded videos on external sites as well? – Ethan Field Nov 24 '16 at 15:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.