How To Block YouTube Autoplay

Ask for help about NoScript, no registration needed to post
User avatar
Jahzoone
Posts: 19
Joined: Tue Sep 22, 2009 12:53 pm
Location: Georgia USA
Contact:

How To Block YouTube Autoplay

Post by Jahzoone »

Hi,

I looked around on the forum and the web for a way to block Youtubes Autoplay Feature Globally. You can turn it off for individual subscriptions but not globally. Several sites said install AdBlocker pluggin, I was just wondering if this could be accomplished in the NoScript pluggin? Any ideas are welcome because this new AutoPlay "feature" is seriously annonying!!!!!!!!!!!1
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
User avatar
Giorgio Maone
Site Admin
Posts: 9454
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: How To Block YouTube Autoplay

Post by Giorgio Maone »

NoScript Options|Embeddings|Apply these restrictions to whitelisted sites as well
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
User avatar
Jahzoone
Posts: 19
Joined: Tue Sep 22, 2009 12:53 pm
Location: Georgia USA
Contact:

Re: How To Block YouTube Autoplay

Post by Jahzoone »

Hi,

I ticked the box (Apply these restrictions to whitelisted sites as well) and it didn't really stop the Autoplay Feature YouTube has added. Autoplay loads the next video from your subscription list, but now has the NoScript icon on the video. What I need to do is stop the autoplay from loading the next webpage. If anyone from Google reads this thread, Turn this annoying Autoplay (so called) Feature OFF!
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
Guest

Re: How To Block YouTube Autoplay

Post by Guest »

IMO you're looking at the wrong tool in the wrong place.

If you want to alter a website's behavior, try user scripts. Or, here's a crazy idea, use the YouTube suggestions forum instead of hoping someone who a) works at Google and b) cares happens to read this.
Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
User avatar
Jahzoone
Posts: 19
Joined: Tue Sep 22, 2009 12:53 pm
Location: Georgia USA
Contact:

Re: How To Block YouTube Autoplay

Post by Jahzoone »

You're probably right, I already found a solution on YouTube which involves the Firefox Browser, Greasmonkey Plugin and a special script. I was only hoping that since I already use NoScript there might be away to configure it to block the Autoplay, if not that's OK it's still a great tool.

As far as the message to Google, that's all that is. A protest, sorry if it was inappropriate in this forum.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
User avatar
Giorgio Maone
Site Admin
Posts: 9454
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: How To Block YouTube Autoplay

Post by Giorgio Maone »

Jahzoone wrote: Greasmonkey Plugin and a special script.
If it can be done with GreaseMonkey, it most likely can be done with NoScript using a surrogate script.
Can I se the GM script in question?
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
User avatar
therube
Ambassador
Posts: 7929
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: How To Block YouTube Autoplay

Post by therube »

Just searching ...

http://userscripts.org/scripts/show/12008
http://userscripts.org/scripts/source/12008.user.js

Code: Select all

// ==UserScript==
// @name          Youtube Prevent Autoplay
// @namespace     userscripts.org
// @version       0.9
// @description   Prevents videos from playing automatically by replacing the default youtube.com player with the youtube player that doesn't autostart playback
// @include        http://youtube.com/watch*
// @include        http://*.youtube.com/watch*
// @include        http://*.youtube.com/user/*
// ==/UserScript==

with(document.getElementById('movie_player'))
{
setAttribute("flashvars","autoplay=0&"+getAttribute("flashvars"));
src+="#";
}
http://www.google.com/search?q=Block+Yo ... nt=mozilla

(Some kind of error when I posted. "Resubmitted", & it appeared to go, but looking again I see it had not. Thank goodness for Recently Closed Windows, so that I didn't have to rewrite this :-).)
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) Gecko/20100701 SeaMonkey/2.0.6
User avatar
Giorgio Maone
Site Admin
Posts: 9454
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: How To Block YouTube Autoplay

Post by Giorgio Maone »

As a script surrogate, can be done by adding the following 2 string preferences to about:config

noscript.surrogate.noAutoPlay.sources

Code: Select all

@!.youtube.com
noscript.surrogate.noAutoPlay.replacement

Code: Select all

with(document.getElementById('movie_player')){setAttribute("flashvars","autoplay=0&"+getAttribute("flashvars"));src+="#"}
[Edit]
Corrected the replacement preference name.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
User avatar
Jahzoone
Posts: 19
Joined: Tue Sep 22, 2009 12:53 pm
Location: Georgia USA
Contact:

Re: How To Block YouTube Autoplay

Post by Jahzoone »

Hey this is great, I had a feeling NoScript could get the job done, since after all that's what noScript does, block scripts. Thank you Giorgio Maone and therube for your help. I will try the fix when I get off work and let you know what happens.
Last edited by Jahzoone on Tue Aug 03, 2010 1:16 am, edited 1 time in total.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
User avatar
Jahzoone
Posts: 19
Joined: Tue Sep 22, 2009 12:53 pm
Location: Georgia USA
Contact:

Re: How To Block YouTube Autoplay

Post by Jahzoone »

OK, I added the 2 strings to about:config in Firefox, restarted the browser, then went to YouTube and Logged-in to see what happened. The Autoplay was still working, so I searched around youtube forums and videos again and found a different script from the one posted originally, this seems to be the updated Greasemonkey script:

Code: Select all

// ==UserScript==
// @name           Subscription Bar
// @namespace      Adam Rock
// @include        http://*youtube.com/watch?v=*
// ==/UserScript==


if (/[\?&]playnext=1/i.test(document.location.href)) 
    document.location.replace(document.location.href.replace("playnext=1","playnext=0"));


GM_addStyle("#quicklist-bar{display: none}");
GM_addStyle("#quicklist-tray-container{display: none}");
GM_addStyle("#quicklist-bar-container{display: none}");
The documentation links are:

http://www.youtube.com/watch?v=jIMzoOiGzxY

http://userscripts.org/scripts/show/82587

Any thoughts welcome
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
Guest

Re: How To Block YouTube Autoplay

Post by Guest »

Jahzoone wrote:OK, I added the 2 strings to about:config in Firefox, restarted the browser, then went to YouTube and Logged-in to see what happened. The Autoplay was still working [...]
That would be because Giorgio has an error in his post (the second preference should be noscript.surrogate.noAutoPlay.replacement).
Jahzoone wrote:[...] this seems to be the updated Greasemonkey script
It's a completely different one, because there are many ways of getting rid of that annoying "feature". Tampering with the YouTube player's Flash variables, calling the page function that disables autoplay, adding a GET parameter to the URL that disables autoplay, etc.
Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
User avatar
Jahzoone
Posts: 19
Joined: Tue Sep 22, 2009 12:53 pm
Location: Georgia USA
Contact:

Re: How To Block YouTube Autoplay

Post by Jahzoone »

Alright the rename fixed the script, unfortunately I don't know if it worked to block the Autoplay because when I tried to test it last night I found Youtube changed the default setting from ON to OFF and made the option "sticky" so it remembers the state of the switch.

One cool effect of the surrogate script is when you surf to a YouTube page the player doesn't start automatically, you have to manually click the Play button.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
metal321

Re: How To Block YouTube Autoplay

Post by metal321 »

If you are using Firefox there is an addon called "Stop Autoplay."
I am looking for something that works with Seamonkey but most
addons don't seem to work with it.

https://addons.mozilla.org/en-US/firefox/addon/1765/
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10 ( .NET CLR 3.5.30729) PBSTB/1.2
User avatar
therube
Ambassador
Posts: 7929
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: How To Block YouTube Autoplay

Post by therube »

A number of things to consider, it looks like:

> I don't have time to maintain Stop Autoplay. The extension is still buggy and the code needs to be rewritten, but that is beyond my ability.
(Maintain can be gotten around, generally. Buggy could be a different matter. And last updated 2008, so might be even harder for FF 3.6 compatibility?)

> Don't use this feature with Flashblock extension.
(Flashblock being a common extension.)

> Due to Bug 236839, you have to enable JavaScript to make Stop Autoplay to work
(Not all sites require JS to play media, so you may not ordinarily Allow a particular site otherwise.)

Firefox Extension: Stop Autoplay
http://hemiolapei.free.fr/divers/sap/sap-en.html
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.14) Gecko/20100930 SeaMonkey/2.0.9
User avatar
Jahzoone
Posts: 19
Joined: Tue Sep 22, 2009 12:53 pm
Location: Georgia USA
Contact:

Re: How To Block YouTube Autoplay

Post by Jahzoone »

Hummmmm, this Stop Autoplay extension looks a bit under developed and while not a bad idea for a plugin let's not forget that Youtube has abandoned the Autoplay Feature, at least for now. If someone just wants to stop a video from automatically starting on a Youtube page or channel the script mentioned earlier in this thread works great.
Giorgio Maone wrote:As a script surrogate, can be done by adding the following 2 string preferences to about:config

noscript.surrogate.noAutoPlay.sources

Code: Select all

@!.youtube.com
noscript.surrogate.noAutoPlay.replacement

Code: Select all

with(document.getElementById('movie_player')){setAttribute("flashvars","autoplay=0&"+getAttribute("flashvars"));src+="#"}
[Edit]
Corrected the replacement preference name.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10
Post Reply