Skip to content

Instantly share code, notes, and snippets.

@adammw
Created April 23, 2014 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adammw/11210280 to your computer and use it in GitHub Desktop.
Save adammw/11210280 to your computer and use it in GitHub Desktop.
// youtube sizing logic
var a = m.getElementById("player"),
b = m.getElementById("watch7-container");
if (b && a) {
var c = m.hasClass(b, "watch-wide"),
b = m.lo(); // hash of width and height
if (c) {
var c = !!m.A("ENABLE_AUTO_LARGE"),
d = m.hasClass(window.document.body, "site-center-aligned") && (m.hasClass(window.document.body, "watch-early-bigbear") || m.hasClass(window.document.body, "appbar-flexwatch") || m.hasClass(window.document.body, "appbar-flexwatch-mini")),
e = m.hasClass(window.document.body, "appbar-flexwatch-mini"),
g = m.hasClass(window.document.body, "appbar-flexwatch-540") || m.hasClass(window.document.body, "appbar-flexwatch-540-mini"),
h = 1E3 <= b.width && b.height >= (e ? 690 : 750),
e = d ? e ? 870 : 930 : 1040,
b = b.width >= (d ? 1320 : 1540) && b.height >= e;
if(c && b) {
m.removeClass(a, ["watch-medium", "watch-medium-540", "watch-small"]);
m.addClass(a, "watch-large");
} else {
if(g && h) {
m.removeClass(a, ["watch-small", "watch-medium", "watch-large"]);
m.addClass(a, "watch-medium-540");
} else {
m.removeClass(a, ["watch-small", "watch-medium-540", "watch-large"]);
m.addClass(a, "watch-medium");
}
}
} else {
m.removeClass(a, ["watch-medium", "watch-medium-540", "watch-large"]);
m.addClass(a, "watch-small");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment