neoGAF - YOUTUBE ME! 3.1

By Nathan Strong Last update Sep 15, 2009 — Installed 393 times.


Script Summary: Inspired by neoGAF - YOUTUBE ME! 2 by hateradio; Adds a button to YouTube URLs to play the linked video inline. New version features UI tweaks and new code design. Also flags malformed YouTube links. Easily customize resolution

I originally was simply trying to customize the "play video" button on hateradio's script, but I decided I wanted to completely change the way the script worked and ended up rewriting it pretty much from scratch.

Here's what's different:

1. When the "Show video" button is clicked, the video appears below the YouTube URL and the "Show Video" turns into "Hide Video." Click that to hide the YouTube video.

2. Malformed YouTube links are flagged with "Bad URL"

3. The inline YouTube resolution defaults to 640x360 (4:3 aspect ratio). The height is calculated based on the width, so all you have to do is change the width variable (and optionally the aspect ratio variable if you want the windows to be widescreen) and the script will take care of the rest.

4. All the elements are only created once, then toggled using "display: none" or "display: block". This should avoid memory leaks and improve performance, although this isn't exactly a processing-intensive script to begin with.

Version 3.1 adds Opera 10 support.