mirror of https://github.com/calzoneman/sync.git
Move hide/unhide player to util
This commit is contained in:
parent
51ea4ce594
commit
775a6752bb
|
@ -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);
|
|
||||||
}
|
|
||||||
|
|
|
@ -1265,7 +1265,7 @@ function fluidLayout() {
|
||||||
$(this).removeClass("container").addClass("container-fluid");
|
$(this).removeClass("container").addClass("container-fluid");
|
||||||
});
|
});
|
||||||
// Video might not be there, but the playlist is
|
// 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);
|
VHEIGHT = ""+parseInt(parseInt(VWIDTH) * 9 / 16);
|
||||||
if($("#ytapiplayer").length > 0) {
|
if($("#ytapiplayer").length > 0) {
|
||||||
$("#ytapiplayer").attr("width", VWIDTH);
|
$("#ytapiplayer").attr("width", VWIDTH);
|
||||||
|
@ -1409,3 +1409,29 @@ function waitUntilDefined(obj, key, fn) {
|
||||||
}
|
}
|
||||||
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);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue