You need to be logged in to post in the forums. If you do not have an account, please sign up first.
[UserJS] Youtube Video Screen
I made this simple script which allows you to set a black screen behind youtube videos.I don't think it's perfect, but I'm willing to improve it if people would like.
Features:
-Makes a copy of the video, and makes a new centered [width only] copy
-Hides and stops [to my knowledge] the default loaded video
-Black back screen with transparency set to 90% [Changeable]
-Only shows when Youtube is loaded
-Displays a 'Screen Off, Screen On' link at the top left of the screen
The latest version of this script can be found later in this thread
With Screen OFF:
off2.jpg
With Screen ON:
on.jpg
File:
ytS.js
PS: Don't mind the spelling errors in the code, it's late. I'll fix them tomorrow probably

Leave comments & Suggestions!
I hope you enjoy
If it could be launched right from the beginning (instead of actually pressing screen on) that would be perfect!
-
Content Blocker: Managed Sites: Display Number of Hits Seems to be a cool and nice feature. Do not hesitate to bump the thread
. -
Search engine sorting (move search engines up/down): An old basic need, HAS to be fixed
-
New Opera Preferences layout idea w\ Mockup: the current one is in dire need of change
One point - I have the youtube downloader script videoscript.user.js which places a yellow toolbar across the top of the page with a download link. This yellow toolbar obscures the Screen Off link (strangely it doesn't obscure the Screen On link). Perhaps you should force the Screen On/off links to the front of the page to prevent them being covered.
Also you have the Screen On option available on the YouTube homepage and search results - clicking just brings up the screen overlay with no vid (as expected). Perhaps you could restrict the Screen On/Off links to videos where it has some relevance.
Dava
Originally posted by pdarko:
Add
// ==UserScript== // @include http://www.youtube.com/watch?* // ==/UserScript==
at beginning of the file and you can remove checkYoutube function
You mean change it from:
/**
* @author L815
* Feel free to use as you please
*/
//Elemtns for the buttons & black background
//To change transparency, where it says "opacity", change the value you wish [higher = darker]
var the_div = document.createElement("div");
the_div.style = "opacity:.90;width:100%;height:100%;background-color: #000;position:absolute;top:0;display:none;";
To:
// ==UserScript==
// @include http://www.youtube.com/watch?*
// ==/UserScript==
/**
* @author L815
* Feel free to use as you please
*/
//Elemtns for the buttons & black background
//To change transparency, where it says "opacity", change the value you wish [higher = darker]
var the_div = document.createElement("div");
the_div.style = "opacity:.90;width:100%;height:100%;background-color: #000;position:absolute;top:0;display:none;";
???
Dava
See this.
Originally posted by pdarko:
Yes. It will tell Opera to run script just on http://www.youtube.com/watch?* pages.
See this.
Thanks for the info.
Dava
Changes:
- added option to choose the default mode
- moved the toggle button to upper right and made it images instead of text links
- added proper userjs header
If you like the changes I made feel free to use it, if you don't like them, well, just ignore this script

youtube_screen.js
28. June 2008, 20:16:01 (edited)
Originally posted by rfudk:
nice, thanks alot! Is there a way to halt the video after "closing" the "window"?
afaik there's no scripting API allowing control over the playback functions in youtube
, thanks a lot
-
Content Blocker: Managed Sites: Display Number of Hits Seems to be a cool and nice feature. Do not hesitate to bump the thread
. -
Search engine sorting (move search engines up/down): An old basic need, HAS to be fixed
-
New Opera Preferences layout idea w\ Mockup: the current one is in dire need of change
9. July 2008, 12:45:00 (edited)
changelog:
* YouTube Auto-Pause compatibility
* added option to adjust video size in screen mode
* code cleanup
youtube_screen.js
9. July 2008, 14:27:45 (edited)
-
Content Blocker: Managed Sites: Display Number of Hits Seems to be a cool and nice feature. Do not hesitate to bump the thread
. -
Search engine sorting (move search engines up/down): An old basic need, HAS to be fixed
-
New Opera Preferences layout idea w\ Mockup: the current one is in dire need of change
a few minor issues:
- in partial screen mode, the left part of the video screen gets hidden by the videos list on the left
- the screen 'on'/'off' link on upper left and 'close' button on upper right get hidden by other userJS buttons
(ie. showiconsaslinks.js - but not your fault)
suggestions:
- do not activate 'play' when clicking 'on' or 'off' screen (very annoying) - at least make it an option
Originally posted by skye11:
- in partial screen mode, the left part of the video screen gets hidden by the videos list on the left
- the screen 'on'/'off' link on upper left and 'close' button on upper right get hidden by other userJS buttons
(ie. showiconsaslinks.js - but not your fault)
Try my script, posted 4 posts above yours, instead of one in first post
Originally posted by skye11:
suggestions:
- do not activate 'play' when clicking 'on' or 'off' screen (very annoying) - at least make it an option
use YouTube Auto-Pause
6. August 2008, 00:19:02 (edited)
I'm glad this has become a useful script.
Also @ larski, I really like your updates/changes. Thanks for contributing

Thanks to everyone else as well for submitting change requests, and so on...
It also prevents me from expanding the description of the movie among others actions from buttons on the page .
I am on opera 9.52 by the way.
It is a wonderful script so i wanted to say my feedback to make it even better. Thanks
it's probably some other script that breaks it
Changes:
- Hide the "Upload" and username buttons
- Add auto-pause feature
- Add feature to load high-quality videos
22. January 2009, 22:31:45 (edited)
Youtube uncentered.jpg
Oh, don't bother, I figured it out! I moved the hidding code down after the video resizing code and also same thing for the showing code. It's back to normal now.
Youtube backagain.jpg
And by the way, when I tried to reload an opened-and-played youtube video, the auto-pause feature seemed to randomly break, sometimes the video was paused, sometimes not. Probably just a small bug.
Could you also add the animation so that the black screen fade in before the video placeholder appears? I just fancy some effects for such 'cinema' place!

Anyway, this script is great! Thanks to all helped building it! Such a good combination!
Originally posted by alienyd:
Could you also add the animation so that the black screen fade in before the video placeholder appears?
I don't like animations and the video appears pretty instantly here so no.
Originally posted by Perryking:
Don't work on http://es.youtube.com , only on www.youtube.com
you did read the comment in the file about redirecting to www.youtube.com? if you don't want that just remove that part of the script

when I typed www.youtube.com and hit 'Enter', I would be redirect to de. version (I'm in Germany), same thing when I used a direct link to a specific video page (i.e. http://www.youtube.com/watch?v=MyShkaAwbR8) it then repeatedly tried to redirect to the de. site version, resulting an endless redirect, not until I opened (in another tab) the youtube homepage, and cancel the stupid localized option, does the video page (in the previous tab, automatically jump to the www one). Could you please help me fixing this thing?! I hope that's understandable!
Thanks!
Originally posted by larskl:
you did read the comment in the file about redirecting to www.youtube.com? if you don't want that just remove that part of the script
or just accept cookies from youtube so you can always get the international version
Any idea?
27. January 2009, 12:28:13 (edited)
Originally posted by scatbin:
First of all, youtubes playlist function doesn't work
Adding/removing/playing videos from that list works just fine here. Tested in clean installs of 9.63 and latest 10.00 weekly
Originally posted by scatbin:
Secondly, if you wish to go back a screen you have to double tap the back button
That's indeed caused by the high quality thing. If you don't like it you'll have to remove the high quality lines in the .js
29. January 2009, 22:31:47 (edited)
Would you please combine it with yours to:
- remove elements on youtube page (mostly annoying!)
- keep the video centered, showed in a black screen
- remove auto jump-to middle page (from the above js), where the screen automatically jumps to the middle of the page, to auto vertically center the video area
Besides, how to resize video? I saw you mentioned but never manage to work it out:(
Oh yeah, also, I'd love to lock youtube page - disable scrolling (vertically) when the dark screen is on to always keep the video in sight, or maybe vice versa, let the video float at a relative position while the page is being scrolled, could you please show me how?!
Thanks
Changelog:
* Easier to configure (all settings in the first few lines of the file)
* Options to disable redirects to high quality and international versions
* Option to disable auto-pause
* New button to toggle between 4:3 and 16:9 mode
Download: youtube_screen.js v1.5
Changelog:
* Fix for the new Upload button
* Performance optimization
* Make sure that upload button failure doesn't halt script execution
Download: youtube_screen.js v1.52
opera_youtubescreen152bug.png
Non of the settings in script was changed. I wasn't logged in @ YouTube.
Showing topic replies 1 - 50 of 63.