From 775a6752bbe0f1f29f964be1d951b832acbe04e1 Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Mon, 5 Aug 2013 23:11:56 -0400 Subject: [PATCH] Move hide/unhide player to util --- www/assets/js/player.js | 26 -------------------------- www/assets/js/util.js | 28 +++++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/www/assets/js/player.js b/www/assets/js/player.js index ec86608b..ba5254f8 100644 --- a/www/assets/js/player.js +++ b/www/assets/js/player.js @@ -793,29 +793,3 @@ function handleMediaUpdate(data) { } }); } - -function hidePlayer() { - if(!PLAYER) - return; - - if(!/(chrome|MSIE)/ig.test(navigator.userAgent)) - return; - - PLAYER.size = { - width: $("#ytapiplayer").attr("width"), - height: $("#ytapiplayer").attr("height") - }; - $("#ytapiplayer").attr("width", 1) - .attr("height", 1); -} - -function unhidePlayer() { - if(!PLAYER) - return; - - if(!/(chrome|MSIE)/ig.test(navigator.userAgent)) - return; - - $("#ytapiplayer").attr("width", PLAYER.size.width) - .attr("height", PLAYER.size.height); -} diff --git a/www/assets/js/util.js b/www/assets/js/util.js index a76a0ed4..247500e1 100644 --- a/www/assets/js/util.js +++ b/www/assets/js/util.js @@ -1265,7 +1265,7 @@ function fluidLayout() { $(this).removeClass("container").addClass("container-fluid"); }); // Video might not be there, but the playlist is - VWIDTH = $("#queue").css("width").replace("px", ""); + VWIDTH = $("#videowidth").css("width").replace("px", ""); VHEIGHT = ""+parseInt(parseInt(VWIDTH) * 9 / 16); if($("#ytapiplayer").length > 0) { $("#ytapiplayer").attr("width", VWIDTH); @@ -1409,3 +1409,29 @@ function waitUntilDefined(obj, key, fn) { } fn(); } + +function hidePlayer() { + if(!PLAYER) + return; + + if(!/(chrome|MSIE)/ig.test(navigator.userAgent)) + return; + + PLAYER.size = { + width: $("#ytapiplayer").attr("width"), + height: $("#ytapiplayer").attr("height") + }; + $("#ytapiplayer").attr("width", 1) + .attr("height", 1); +} + +function unhidePlayer() { + if(!PLAYER) + return; + + if(!/(chrome|MSIE)/ig.test(navigator.userAgent)) + return; + + $("#ytapiplayer").attr("width", PLAYER.size.width) + .attr("height", PLAYER.size.height); +}