6

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?

3 Answers3

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.

MrFregg
  • 398
2

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.

Jerry
  • 401
1

You can use the Chrome extension Disable autoplay for YouTube. Or AutoplayStopper recommended by @Taylor D. Edmiston in this comment.

On Firefox, you can use YouTube No Buffer.

GAD3R
  • 3,900