Advertisement
Guest User

Untitled

a guest
Jun 19th, 2013
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.16 KB | None | 0 0
  1. var myYouTubePlayer = function() {
  2. if (!window['YT']) {
  3. var YT = {};
  4. }
  5. if (!YT.Player) {
  6. (function() {
  7. var g, h = this;
  8.  
  9. function l(a) {
  10. a = a.split(".");
  11. for (var b = h, c; c = a.shift();) if (null != b[c]) b = b[c];
  12. else
  13. return null;
  14. return b
  15. }
  16.  
  17. function n(a) {
  18. var b = typeof a;
  19. if ("object" == b) if (a) {
  20. if (a instanceof Array) return "array";
  21. if (a instanceof Object) return b;
  22. var c = Object.prototype.toString.call(a);
  23. if ("[object Window]" == c) return "object";
  24. if ("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("splice")) return "array";
  25. if ("[object Function]" == c || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) return "function"
  26. } else
  27. return "null";
  28. else if ("function" == b && "undefined" == typeof a.call) return "object";
  29. return b
  30. }
  31.  
  32. function p(a) {
  33. return "string" == typeof a
  34. }
  35.  
  36. function aa(a) {
  37. var b = typeof a;
  38. return "object" == b && null != a || "function" == b
  39. }
  40. var ba = "closure_uid_" + (1E9 * Math.random() >>> 0),
  41. ca = 0;
  42.  
  43. function da(a, b, c) {
  44. return a.call.apply(a.bind, arguments)
  45. }
  46.  
  47. function ea(a, b, c) {
  48. if (!a) throw Error();
  49. if (2 < arguments.length) {
  50. var d = Array.prototype.slice.call(arguments, 2);
  51. return function() {
  52. var c = Array.prototype.slice.call(arguments);
  53. Array.prototype.unshift.apply(c, d);
  54. return a.apply(b, c)
  55. }
  56. }
  57. return function() {
  58. return a.apply(b, arguments)
  59. }
  60. }
  61.  
  62. function q(a, b, c) {
  63. q = Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? da : ea;
  64. return q.apply(null, arguments)
  65. }
  66.  
  67. function r(a, b) {
  68. var c = a.split("."),
  69. d = h;
  70. c[0] in d || !d.execScript || d.execScript("var " + c[0]);
  71. for (var e; c.length && (e = c.shift());) c.length || void 0 === b ? d = d[e] ? d[e] : d[e] = {} : d[e] = b
  72. }
  73.  
  74. function s(a, b) {
  75. function c() {}
  76. c.prototype = b.prototype;
  77. a.u = b.prototype;
  78. a.prototype = new c
  79. }
  80. Function.prototype.bind = Function.prototype.bind ||
  81. function(a, b) {
  82. if (1 < arguments.length) {
  83. var c = Array.prototype.slice.call(arguments, 1);
  84. c.unshift(this, a);
  85. return q.apply(null, c)
  86. }
  87. return q(this, a)
  88. };
  89. var v = Array.prototype,
  90. fa = v.indexOf ?
  91. function(a, b, c) {
  92. return v.indexOf.call(a, b, c)
  93. } : function(a, b, c) {
  94. c = null == c ? 0 : 0 > c ? Math.max(0, a.length + c) : c;
  95. if (p(a)) return p(b) && 1 == b.length ? a.indexOf(b, c) : -1;
  96. for (; c < a.length; c++) if (c in a && a[c] === b) return c;
  97. return -1
  98. },
  99. w = v.forEach ?
  100. function(a, b, c) {
  101. v.forEach.call(a, b, c)
  102. } : function(a, b, c) {
  103. for (var d = a.length, e = p(a) ? a.split("") : a, f = 0; f < d; f++) f in e && b.call(c, e[f], f, a)
  104. };
  105.  
  106. function ga(a, b) {
  107. var c;
  108. t: {
  109. c = a.length;
  110. for (var d = p(a) ? a.split("") : a, e = 0; e < c; e++) if (e in d && b.call(void 0, d[e], e, a)) {
  111. c = e;
  112. break t
  113. }
  114. c = -1
  115. }
  116. return 0 > c ? null : p(a) ? a.charAt(c) : a[c]
  117. }
  118.  
  119. function ha(a) {
  120. return v.concat.apply(v, arguments)
  121. }
  122.  
  123. function ia(a) {
  124. var b = a.length;
  125. if (0 < b) {
  126. for (var c = Array(b), d = 0; d < b; d++) c[d] = a[d];
  127. return c
  128. }
  129. return []
  130. }
  131.  
  132. function ja(a, b, c) {
  133. return 2 >= arguments.length ? v.slice.call(a, b) : v.slice.call(a, b, c)
  134. };
  135.  
  136. function ka(a) {
  137. var b = x,
  138. c;
  139. for (c in b) if (a.call(void 0, b[c], c, b)) return c
  140. };
  141. var y, z, A, C;
  142.  
  143. function la() {
  144. return h.navigator ? h.navigator.userAgent : null
  145. }
  146. C = A = z = y = !1;
  147. var D;
  148. if (D = la()) {
  149. var ma = h.navigator;
  150. y = 0 == D.indexOf("Opera");
  151. z = !y && -1 != D.indexOf("MSIE");
  152. A = !y && -1 != D.indexOf("WebKit");
  153. C = !y && !A && "Gecko" == ma.product
  154. }
  155. var E = z,
  156. F = C,
  157. na = A;
  158.  
  159. function oa() {
  160. var a = h.document;
  161. return a ? a.documentMode : void 0
  162. }
  163. var G;
  164. t: {
  165. var H = "",
  166. I;
  167. if (y && h.opera) var J = h.opera.version,
  168. H = "function" == typeof J ? J() : J;
  169. else if (F ? I = /rv\:([^\);]+)(\)|;)/ : E ? I = /MSIE\s+([^\);]+)(\)|;)/ : na && (I = /WebKit\/(\S+)/), I) var pa = I.exec(la()),
  170. H = pa ? pa[1] : "";
  171. if (E) {
  172. var qa = oa();
  173. if (qa > parseFloat(H)) {
  174. G = String(qa);
  175. break t
  176. }
  177. }
  178. G = H
  179. }
  180. var ra = G,
  181. sa = {};
  182.  
  183. function ta(a) {
  184. if (!sa[a]) {
  185. for (var b = 0, c = String(ra).replace(/^[\s\xa0]+|[\s\xa0]+$/g, "").split("."), d = String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g, "").split("."), e = Math.max(c.length, d.length), f = 0; 0 == b && f < e; f++) {
  186. var m = c[f] || "",
  187. k = d[f] || "",
  188. B = RegExp("(\\d*)(\\D*)", "g"),
  189. Qa = RegExp("(\\d*)(\\D*)", "g");
  190. do {
  191. var t = B.exec(m) || ["", "", ""],
  192. u = Qa.exec(k) || ["", "", ""];
  193. if (0 == t[0].length && 0 == u[0].length) break;
  194. b = ((0 == t[1].length ? 0 : parseInt(t[1], 10)) < (0 == u[1].length ? 0 : parseInt(u[1], 10)) ? -1 : (0 == t[1].length ? 0 : parseInt(t[1], 10)) > (0 == u[1].length ? 0 : parseInt(u[1], 10)) ? 1 : 0) || ((0 == t[2].length) < (0 == u[2].length) ? -1 : (0 == t[2].length) > (0 == u[2].length) ? 1 : 0) || (t[2] < u[2] ? -1 : t[2] > u[2] ? 1 : 0)
  195. } while (0 == b)
  196. }
  197. sa[a] = 0 <= b
  198. }
  199. }
  200. var ua = h.document,
  201. va = ua && E ? oa() || ("CSS1Compat" == ua.compatMode ? parseInt(ra, 10) : 5) : void 0;
  202. if (F || E) {
  203. var K;
  204. if (K = E) K = E && 9 <= va;
  205. K || F && ta("1.9.1")
  206. }
  207. E && ta("9");
  208.  
  209. function wa() {
  210. var a, b, c, d;
  211. a = document;
  212. if (a.querySelectorAll && a.querySelector) return a.querySelectorAll(".yt-player");
  213. if (a.getElementsByClassName) {
  214. var e = a.getElementsByClassName("yt-player");
  215. return e
  216. }
  217. e = a.getElementsByTagName("*");
  218. d = {};
  219. for (b = c = 0; a = e[b]; b++) {
  220. var f = a.className;
  221. "function" == typeof f.split && 0 <= fa(f.split(/\s+/), "yt-player") && (d[c++] = a)
  222. }
  223. d.length = c;
  224. return d
  225. }
  226.  
  227. function xa(a, b) {
  228. for (var c = 0; a;) {
  229. if (b(a)) return a;
  230. a = a.parentNode;
  231. c++
  232. }
  233. return null
  234. };
  235.  
  236. function ya(a) {
  237. a = String(a);
  238. if (/^\s*$/.test(a) ? 0 : /^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g, "@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g, ""))) try {
  239. return eval("(" + a + ")")
  240. } catch (b) {}
  241. throw Error("Invalid JSON string: " + a);
  242. }
  243.  
  244. function za() {}
  245.  
  246. function L(a, b, c) {
  247. switch (typeof b) {
  248. case "string":
  249. Aa(b, c);
  250. break;
  251. case "number":
  252. c.push(isFinite(b) && !isNaN(b) ? b : "null");
  253. break;
  254. case "boolean":
  255. c.push(b);
  256. break;
  257. case "undefined":
  258. c.push("null");
  259. break;
  260. case "object":
  261. if (null == b) {
  262. c.push("null");
  263. break
  264. }
  265. if ("array" == n(b)) {
  266. var d = b.length;
  267. c.push("[");
  268. for (var e = "", f = 0; f < d; f++) c.push(e), L(a, b[f], c), e = ",";
  269. c.push("]");
  270. break
  271. }
  272. c.push("{");
  273. d = "";
  274. for (e in b) Object.prototype.hasOwnProperty.call(b, e) && (f = b[e], "function" != typeof f && (c.push(d), Aa(e, c), c.push(":"), L(a, f, c), d = ","));
  275. c.push("}");
  276. break;
  277. case "function":
  278. break;
  279. default:
  280. throw Error("Unknown type: " + typeof b);
  281. }
  282. }
  283. var M = {
  284. '"': '\\"',
  285. "\\": "\\\\",
  286. "/": "\\/",
  287. "\b": "\\b",
  288. "\f": "\\f",
  289. "\n": "\\n",
  290. "\r": "\\r",
  291. "\t": "\\t",
  292. "\x0B": "\\u000b"
  293. },
  294. Ba = /\uffff/.test("\uffff") ? /[\\\"\x00-\x1f\x7f-\uffff]/g : /[\\\"\x00-\x1f\x7f-\xff]/g;
  295.  
  296. function Aa(a, b) {
  297. b.push('"', a.replace(Ba, function(a) {
  298. if (a in M) return M[a];
  299. var b = a.charCodeAt(0),
  300. e = "\\u";
  301. 16 > b ? e += "000" : 256 > b ? e += "00" : 4096 > b && (e += "0");
  302. return M[a] = e + b.toString(16)
  303. }), '"')
  304. };
  305.  
  306. function N() {}
  307. N.prototype.q = !1;N.prototype.dispose = function() {
  308. this.q || (this.q = !0, this.j())
  309. };N.prototype.j = function() {
  310. if (this.C) for (; this.C.length;) this.C.shift()()
  311. };
  312.  
  313. function O() {
  314. this.a = [];
  315. this.b = {}
  316. }
  317. s(O, N);O.prototype.w = 1;O.prototype.h = 0;
  318.  
  319. function Ca(a, b, c, d) {
  320. var e = a.b[b];
  321. e || (e = a.b[b] = []);
  322. var f = a.w;
  323. a.a[f] = b;
  324. a.a[f + 1] = c;
  325. a.a[f + 2] = d;
  326. a.w = f + 3;
  327. e.push(f)
  328. }
  329.  
  330. function Da(a, b, c) {
  331. var d = P;
  332. if (a = d.b[a]) {
  333. var e = d.a;
  334. (a = ga(a, function(a) {
  335. return e[a + 1] == b && e[a + 2] == c
  336. })) && Ea(d, a)
  337. }
  338. }
  339.  
  340. function Ea(a, b) {
  341. if (0 != a.h) a.d || (a.d = []), a.d.push(b);
  342. else {
  343. var c = a.a[b];
  344. if (c) {
  345. if (c = a.b[c]) {
  346. var d = fa(c, b);
  347. 0 <= d && v.splice.call(c, d, 1)
  348. }
  349. delete a.a[b];
  350. delete a.a[b + 1];
  351. delete a.a[b + 2]
  352. }
  353. }
  354. }
  355. O.prototype.A = function(a, b) {
  356. var c = this.b[a];
  357. if (c) {
  358. this.h++;
  359. for (var d = ja(arguments, 1), e = 0, f = c.length; e < f; e++) {
  360. var m = c[e];
  361. this.a[m + 1].apply(this.a[m + 2], d)
  362. }
  363. this.h--;
  364. if (this.d && 0 == this.h) for (; c = this.d.pop();) Ea(this, c);
  365. return 0 != e
  366. }
  367. return !1
  368. };O.prototype.j = function() {
  369. O.u.j.call(this);
  370. delete this.a;
  371. delete this.b;
  372. delete this.d
  373. };
  374. var Fa = RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");
  375.  
  376. function Ga(a) {
  377. if (Q) {
  378. Q = !1;
  379. var b = h.location;
  380. if (b) {
  381. var c = b.href;
  382. if (c && (c = (c = Ga(c)[3] || null) && decodeURIComponent(c)) && c != b.hostname) throw Q = !0, Error();
  383. }
  384. }
  385. return a.match(Fa)
  386. }
  387. var Q = na;
  388.  
  389. function Ha(a, b, c) {
  390. if ("array" == n(b)) for (var d = 0; d < b.length; d++) Ha(a, String(b[d]), c);
  391. else null != b && c.push("&", a, "" === b ? "" : "=", encodeURIComponent(String(b)))
  392. };
  393.  
  394. function R(a, b) {
  395. return a.dataset ? a.dataset[Ia(b)] : a.getAttribute("data-" + b)
  396. }
  397. var Ja = {};
  398.  
  399. function Ia(a) {
  400. return Ja[a] || (Ja[a] = String(a).replace(/\-([a-z])/g, function(a, c) {
  401. return c.toUpperCase()
  402. }))
  403. };
  404. var S = l("yt.dom.getNextId_");
  405. if (!S) {
  406. S = function() {
  407. return ++Ka
  408. };
  409. r("yt.dom.getNextId_", S);
  410. var Ka = 0
  411. };r("yt.config_", window.yt && window.yt.config_ || {});r("yt.tokens_", window.yt && window.yt.tokens_ || {});r("yt.globals_", window.yt && window.yt.globals_ || {});r("yt.msgs_", window.yt && window.yt.msgs_ || {});r("yt.timeouts_", window.yt && window.yt.timeouts_ || []);
  412. var La = window.yt && window.yt.intervals_ || [];r("yt.intervals_", La);
  413.  
  414. function Ma(a) {
  415. "function" == n(a) && (a = Na(a));
  416. a = window.setInterval(a, 250);
  417. La.push(a);
  418. return a
  419. }
  420.  
  421. function Na(a) {
  422. return window.yterr ?
  423. function() {
  424. try {
  425. return a.apply(this, arguments)
  426. } catch (b) {
  427. var c = l("yt.www.onException");
  428. c && c(b);
  429. throw b;
  430. }
  431. } : a
  432. };
  433.  
  434. function T(a) {
  435. if (a = a || window.event) {
  436. for (var b in a) b in Oa || (this[b] = a[b]);
  437. this.scale = a.scale;
  438. this.rotation = a.rotation;
  439. (b = a.target || a.srcElement) && 3 == b.nodeType && (b = b.parentNode);
  440. this.target = b;
  441. if (b = a.relatedTarget) try {
  442. b = b.nodeName && b
  443. } catch (c) {
  444. b = null
  445. } else "mouseover" == this.type ? b = a.fromElement : "mouseout" == this.type && (b = a.toElement);
  446. this.relatedTarget = b;
  447. this.clientX = void 0 != a.clientX ? a.clientX : a.pageX;
  448. this.clientY = void 0 != a.clientY ? a.clientY : a.pageY;
  449. if (document.body && document.documentElement) {
  450. b = document.body.scrollLeft + document.documentElement.scrollLeft;
  451. var d = document.body.scrollTop + document.documentElement.scrollTop;
  452. this.pageX = void 0 != a.pageX ? a.pageX : a.clientX + b;
  453. this.pageY = void 0 != a.pageY ? a.pageY : a.clientY + d
  454. }
  455. this.keyCode = a.keyCode ? a.keyCode : a.which;
  456. this.charCode = a.charCode || ("keypress" == this.type ? this.keyCode : 0);
  457. this.altKey = a.altKey;
  458. this.ctrlKey = a.ctrlKey;
  459. this.shiftKey = a.shiftKey;
  460. "MozMousePixelScroll" == this.type ? (this.wheelDeltaX = a.axis == a.HORIZONTAL_AXIS ? a.detail : 0, this.wheelDeltaY = a.axis == a.HORIZONTAL_AXIS ? 0 : a.detail) : window.opera ? (this.wheelDeltaX = 0, this.wheelDeltaY = a.detail) : 0 == a.wheelDelta % 120 ? "WebkitTransform" in document.documentElement.style ? window.a && 0 == navigator.platform.indexOf("Mac") ? (this.wheelDeltaX = a.wheelDeltaX / -30, this.wheelDeltaY = a.wheelDeltaY / -30) : (this.wheelDeltaX = a.wheelDeltaX / -1.2, this.wheelDeltaY = a.wheelDeltaY / -1.2) : (this.wheelDeltaX = 0, this.wheelDeltaY = a.wheelDelta / -1.6) : (this.wheelDeltaX = a.wheelDeltaX / -3, this.wheelDeltaY = a.wheelDeltaY / -3)
  461. }
  462. }
  463. g = T.prototype;g.type = "";g.target = null;
  464. g.relatedTarget = null;g.currentTarget = null;g.data = null;g.keyCode = 0;g.charCode = 0;g.altKey = !1;g.ctrlKey = !1;g.shiftKey = !1;g.clientX = 0;g.clientY = 0;g.pageX = 0;g.pageY = 0;g.wheelDeltaX = 0;g.wheelDeltaY = 0;g.rotation = 0;g.scale = 1;
  465. var Oa = {
  466. stopPropagation: 1,
  467. preventMouseEvent: 1,
  468. preventManipulation: 1,
  469. preventDefault: 1,
  470. layerX: 1,
  471. layerY: 1,
  472. scale: 1,
  473. rotation: 1
  474. };
  475. var x = l("yt.events.listeners_") || {};r("yt.events.listeners_", x);
  476. var Pa = l("yt.events.counter_") || {
  477. count: 0
  478. };r("yt.events.counter_", Pa);
  479.  
  480. function Ra(a, b, c) {
  481. return ka(function(d) {
  482. return d[0] == a && d[1] == b && d[2] == c && !1 == d[4]
  483. })
  484. }
  485.  
  486. function Sa(a, b, c) {
  487. if (a && (a.addEventListener || a.attachEvent)) {
  488. var d = Ra(a, b, c);
  489. if (!d) {
  490. var d = ++Pa.count + "",
  491. e = !("mouseenter" != b && "mouseleave" != b || !a.addEventListener || "onmouseenter" in document),
  492. f;
  493. f = e ?
  494. function(d) {
  495. d = new T(d);
  496. if (!xa(d.relatedTarget, function(b) {
  497. return b == a
  498. })) return d.currentTarget = a, d.type = b, c.call(a, d)
  499. } : function(b) {
  500. b = new T(b);
  501. b.currentTarget = a;
  502. return c.call(a, b)
  503. };
  504. f = Na(f);
  505. x[d] = [a, b, c, f, !1];
  506. a.addEventListener ? "mouseenter" == b && e ? a.addEventListener("mouseover", f, !1) : "mouseleave" == b && e ? a.addEventListener("mouseout", f, !1) : "mousewheel" == b && "MozBoxSizing" in document.documentElement.style ? a.addEventListener("MozMousePixelScroll", f, !1) : a.addEventListener(b, f, !1) : a.attachEvent("on" + b, f)
  507. }
  508. }
  509. }
  510.  
  511. function Ta(a) {
  512. "string" == typeof a && (a = [a]);
  513. w(a, function(a) {
  514. if (a in x) {
  515. var c = x[a],
  516. d = c[0],
  517. e = c[1],
  518. f = c[3],
  519. c = c[4];
  520. d.removeEventListener ? d.removeEventListener(e, f, c) : d.detachEvent("on" + e, f);
  521. delete x[a]
  522. }
  523. })
  524. };
  525. var Ua = {},
  526. Va = [],
  527. P = new O;
  528.  
  529. function Wa() {
  530. w(Va, function(a) {
  531. a()
  532. })
  533. }
  534.  
  535. function Xa(a, b) {
  536. P.A.apply(P, arguments)
  537. };
  538.  
  539. function U(a, b) {
  540. this.g = b;
  541. this.h = this.a = null;
  542. this.b = this.id = 0;
  543. this.s = !1;
  544. this.j = this.d = null;
  545. var c = p(a) ? document.getElementById(a) : a;
  546. if (c) {
  547. if ("iframe" != c.tagName.toLowerCase()) {
  548. for (var d = c, e = document.createElement("iframe"), d = d.attributes, f = 0, m = d.length; f < m; f++) {
  549. var k = d[f].value;
  550. null != k && ("" != k && "null" != k) && e.setAttribute(d[f].name, k)
  551. }
  552. e.setAttribute("frameBorder", 0);
  553. e.setAttribute("allowfullscreen", 1);
  554. e.setAttribute("title", "YouTube " + V(this.g, "title"));
  555. (d = V(this.g, "width")) && e.setAttribute("width", d);
  556. (d = V(this.g, "height")) && e.setAttribute("height", d);
  557. d = this.p();
  558. d.enablejsapi = window.postMessage ? 1 : 0;
  559. window.location.host && (d.origin = window.location.protocol + "//" + window.location.host);
  560. var f = V(this.g, "host") + this.t() + "?",
  561. m = [],
  562. B;
  563. for (B in d) Ha(B, d[B], m);
  564. m[0] = "";
  565. e.src = f + m.join("");
  566. this.h = c;
  567. (B = c.parentNode) && B.replaceChild(e, c);
  568. c = e
  569. }
  570. this.a = c;
  571. this.id = this[ba] || (this[ba] = ++ca);
  572. this.a.id && (Ua[this.a.id] = this);
  573. window.postMessage && (this.d = new O, Ya(this))
  574. }
  575. }
  576. g = U.prototype;
  577. g.M = function() {
  578. this.a.id && (Ua[this.a.id] = null);
  579. var a = this.d;
  580. a && "function" == typeof a.dispose && a.dispose();
  581. if (this.h) {
  582. var a = this.a,
  583. b = a.parentNode;
  584. b && b.replaceChild(this.h, a)
  585. } else(a = this.a) && a.parentNode && a.parentNode.removeChild(a);
  586. W && (W[this.id] = null);
  587. this.g = null;
  588. var a = this.a,
  589. c;
  590. for (c in x) x[c][0] == a && Ta(c);
  591. this.h = this.a = null
  592. };
  593.  
  594. function Ya(a) {
  595. Za(a.g, a, a.id);
  596. a.b = Ma(q(a.v, a));
  597. Sa(a.a, "load", q(function() {
  598. window.clearInterval(this.b);
  599. this.b = Ma(q(this.v, this))
  600. }, a))
  601. }
  602. g.p = function() {
  603. return {}
  604. };
  605. g.v = function() {
  606. this.a && this.a.contentWindow ? $a(this, {
  607. event: "listening"
  608. }) : window.clearInterval(this.b)
  609. };g.B = function(a) {
  610. this.o(a.event, a)
  611. };g.addEventListener = function(a, b) {
  612. var c = b;
  613. "string" == typeof b && (c = function() {
  614. window[b].apply(window, arguments)
  615. });
  616. Ca(this.d, a, c);
  617. X(this, "addEventListener", [a]);
  618. return this
  619. };g.o = function(a, b) {
  620. if (!this.d.q) {
  621. var c = {
  622. target: this,
  623. data: b
  624. };
  625. this.d.A(a, c);
  626. this.j && Xa(this.j + "." + a, c)
  627. }
  628. };
  629.  
  630. function X(a, b, c) {
  631. c = c || [];
  632. c = Array.prototype.slice.call(c);
  633. $a(a, {
  634. event: "command",
  635. func: b,
  636. args: c
  637. })
  638. }
  639.  
  640. function $a(a, b) {
  641. b.id = a.id;
  642. var c;
  643. c = [];
  644. L(new za, b, c);
  645. c = c.join("");
  646. var d = Ga(a.a.src),
  647. e = d[1],
  648. f = d[2],
  649. m = d[3],
  650. d = d[4],
  651. k = "";
  652. e && (k += e + ":");
  653. m && (k += "//", f && (k += f + "@"), k += m, d && (k += ":" + d));
  654. a.a.contentWindow.postMessage(c, k)
  655. }
  656. g.O = function(a, b) {
  657. this.a.width = a;
  658. this.a.height = b;
  659. return this
  660. };g.N = function() {
  661. return this.a
  662. };
  663. var ab = "corp.google.com youtube.com youtube-nocookie.com prod.google.com sandbox.google.com docs.google.com drive.google.com play.google.com".split(" ");
  664. var bb = window.YTConfig || {};
  665.  
  666. function Y(a) {
  667. this.b = a || {};
  668. this.a = {};
  669. this.a.width = 640;
  670. this.a.height = 390;
  671. this.a.title = "";
  672. this.a.host = ("https:" == document.location.protocol ? "https:" : "http:") + "//www.youtube.com"
  673. }
  674. var W = null;
  675.  
  676. function V(a, b) {
  677. for (var c = [a.b, bb, a.a], d = 0; d < c.length; d++) {
  678. var e = c[d][b];
  679. if (void 0 != e) return e
  680. }
  681. return null
  682. }
  683.  
  684. function Za(a, b, c) {
  685. W || (W = {}, Sa(window, "message", q(a.d, a)));
  686. W[c] = b
  687. }
  688. Y.prototype.d = function(a) {
  689. if (a.origin == V(this, "host") || RegExp("^https?://([a-z0-9-]{1,63}\\.)*(" + ab.join("|").replace(/\./g, ".") + ")(:[0-9]+)?([/?#]|$)", "i").test(a.origin)) {
  690. var b;
  691. try {
  692. b = ya(a.data)
  693. } catch (c) {
  694. return
  695. }
  696. if (a = W[b.id]) {
  697. if (!a.s) {
  698. a.s = !0;
  699. var d = V(a.g, "events"),
  700. e;
  701. for (e in d) d.hasOwnProperty(e) && a.addEventListener(e, d[e])
  702. }
  703. a.B(b)
  704. }
  705. }
  706. };
  707.  
  708. function cb(a) {
  709. Y.call(this, a);
  710. this.a.title = "video player";
  711. this.a.videoId = ""
  712. }
  713. s(cb, Y);
  714.  
  715. function Z(a, b) {
  716. U.call(this, a, new cb(b));
  717. this.j = "player";
  718. this.k = {};
  719. this.i = {}
  720. }
  721. s(Z, U);
  722.  
  723. function db(a) {
  724. if ("iframe" != a.tagName.toLowerCase()) {
  725. var b = a.getAttribute("videoid") || R(a, "videoid");
  726. if (b) {
  727. var c = a.getAttribute("width") || R(a, "width"),
  728. d = a.getAttribute("height") || R(a, "height");
  729. new Z(a, {
  730. videoId: b,
  731. width: c,
  732. height: d
  733. })
  734. }
  735. }
  736. }
  737. g = Z.prototype;g.t = function() {
  738. return "/embed/" + V(this.g, "videoId")
  739. };g.p = function() {
  740. return V(this.g, "playerVars") || {}
  741. };
  742. g.B = function(a) {
  743. var b = a.event;
  744. a = a.info;
  745. switch (b) {
  746. case "apiInfoDelivery":
  747. if (aa(a)) for (var c in a) this.i[c] = a[c];
  748. break;
  749. case "infoDelivery":
  750. eb(this, a);
  751. break;
  752. case "initialDelivery":
  753. window.clearInterval(this.b);
  754. this.k = {};
  755. this.i = {};
  756. fb(this, a.apiInterface);
  757. eb(this, a);
  758. break;
  759. default:
  760. this.o(b, a)
  761. }
  762. };
  763.  
  764. function eb(a, b) {
  765. if (aa(b)) for (var c in b) a.k[c] = b[c]
  766. }
  767.  
  768. function fb(a, b) {
  769. w(b, function(a) {
  770. this[a] || (0 == a.search("cue") || 0 == a.search("load") ? this[a] = function() {
  771. this.k = {};
  772. this.i = {};
  773. X(this, a, arguments);
  774. return this
  775. } : 0 == a.search("get") || 0 == a.search("is") ? this[a] = function() {
  776. var b = 0;
  777. 0 == a.search("get") ? b = 3 : 0 == a.search("is") && (b = 2);
  778. return this.k[a.charAt(b).toLowerCase() + a.substr(b + 1)]
  779. } : this[a] = function() {
  780. X(this, a, arguments);
  781. return this
  782. })
  783. }, a)
  784. }
  785. g.L = function() {
  786. var a = this.a.cloneNode(!1),
  787. b = this.k.videoData,
  788. c = V(this.g, "host");
  789. a.src = b && b.video_id ? c + "/embed/" + b.video_id : a.src;
  790. b = document.createElement("div");
  791. b.appendChild(a);
  792. return b.innerHTML
  793. };g.K = function(a) {
  794. return this.i.namespaces ? a ? this.i[a].options || [] : this.i.namespaces || [] : []
  795. };g.J = function(a, b) {
  796. if (this.i.namespaces && a && b) return this.i[a][b]
  797. };
  798.  
  799. function gb(a) {
  800. Y.call(this, a);
  801. this.a.host = "https://www.youtube.com";
  802. this.a.title = "upload widget";
  803. this.a.height = 0.67 * V(this, "width")
  804. }
  805. s(gb, Y);
  806.  
  807. function $(a, b) {
  808. U.call(this, a, new gb(b))
  809. }
  810. s($, U);g = $.prototype;g.t = function() {
  811. return "/upload_embed"
  812. };g.p = function() {
  813. var a = {},
  814. b = V(this.g, "webcamOnly");
  815. null != b && (a.webcam_only = b);
  816. return a
  817. };g.o = function(a, b) {
  818. $.u.o.call(this, a, b);
  819. "onApiReady" == a && X(this, "hostWindowReady")
  820. };g.F = function(a) {
  821. X(this, "setVideoDescription", arguments)
  822. };
  823. g.G = function(a) {
  824. X(this, "setVideoKeywords", arguments)
  825. };g.H = function(a) {
  826. X(this, "setVideoPrivacy", arguments)
  827. };g.D = function(a) {
  828. X(this, "setParentVideoId", arguments)
  829. };g.I = function(a) {
  830. X(this, "setVideoTitle", arguments)
  831. };r("YT.PlayerState.UNSTARTED", -1);r("YT.PlayerState.ENDED", 0);r("YT.PlayerState.PLAYING", 1);r("YT.PlayerState.PAUSED", 2);r("YT.PlayerState.BUFFERING", 3);r("YT.PlayerState.CUED", 5);r("YT.UploadWidgetEvent.API_READY", "onApiReady");r("YT.UploadWidgetEvent.UPLOAD_SUCCESS", "onUploadSuccess");r("YT.UploadWidgetEvent.PROCESSING_COMPLETE", "onProcessingComplete");r("YT.UploadWidgetEvent.STATE_CHANGE", "onStateChange");r("YT.UploadWidgetState.IDLE", 0);r("YT.UploadWidgetState.PENDING", 1);
  832. r("YT.UploadWidgetState.ERROR", 2);r("YT.UploadWidgetState.PLAYBACK", 3);r("YT.UploadWidgetState.RECORDING", 4);r("YT.UploadWidgetState.STOPPED", 5);r("YT.get", function(a) {
  833. return Ua[a]
  834. });r("YT.scan", Wa);r("YT.subscribe", function(a, b, c) {
  835. Ca(P, a, b, c)
  836. });r("YT.unsubscribe", function(a, b, c) {
  837. Da(a, b, c)
  838. });r("YT.Player", Z);r("YT.UploadWidget", $);U.prototype.destroy = U.prototype.M;U.prototype.setSize = U.prototype.O;U.prototype.getIframe = U.prototype.N;U.prototype.addEventListener = U.prototype.addEventListener;
  839. Z.prototype.getVideoEmbedCode = Z.prototype.L;Z.prototype.getOptions = Z.prototype.K;Z.prototype.getOption = Z.prototype.J;$.prototype.setParentVideoId = $.prototype.D;$.prototype.setVideoDescription = $.prototype.F;$.prototype.setVideoKeywords = $.prototype.G;$.prototype.setVideoPrivacy = $.prototype.H;$.prototype.setVideoTitle = $.prototype.I;
  840. var hb = l("onYTReady");hb && hb();
  841. var ib = l("onYouTubeIframeAPIReady");ib && ib();
  842. var jb = l("onYouTubePlayerAPIReady");jb && jb();
  843. Va.push(function() {
  844. var a = ia(document.getElementsByTagName("yt:player")),
  845. b;
  846. b = document;
  847. b = b.querySelectorAll && b.querySelector ? b.querySelectorAll(".yt-player") : b.getElementsByClassName ? b.getElementsByClassName("yt-player") : wa();
  848. b = ia(b);
  849. w(ha(a, b), db)
  850. });Wa();
  851. })();
  852. }
  853. };
  854.  
  855. //----------include these lines in your $(document).ready()
  856. // myYouTubePlayer();
  857. //----------or do it here
  858. /*if(typeof jQuery!='undefined') {
  859. jQuery(document).ready(function(){
  860. myYouTubePlayer();
  861. });
  862. } else {
  863. document.addEventListener('DOMContentLoaded',function(){
  864. myYouTubePlayer();
  865. });
  866. } */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement