// This code overrides the ImgClick function to add double-clicking support
var cameraDoubleClickTime = 750; // maximum milliseconds between clicks to create a double-click
var lastImgClickTime = 0;
var original_ImgClick = ImgClick;
var ImgClick = function(event, ele)
{
var timeNow = new Date().getTime();
if (timeNow - lastImgClickTime < cameraDoubleClickTime)
{
lastImgClickTime = 0;
if (!isFullScreen())
{
requestFullScreen();
$("#layoutleft").css("width", "0px");
}
else
{
exitFullScreen();
$("#layoutleft").css("width", layoutLeftOriginalWidth + "px");
}
resized();
}
else
{
lastImgClickTime = timeNow;
original_ImgClick(event, ele);
}
};
// Here is some full-screen toggling functionality that isn't in UI2 version 0.9.3.
function toggleFullScreen()
{
if (!isFullScreen())
requestFullScreen();
else
exitFullScreen();
}
function isFullScreen()
{
return document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement;
}
function requestFullScreen()
{
if (document.documentElement.requestFullscreen)
document.documentElement.requestFullscreen();
else if (document.documentElement.msRequestFullscreen)
document.documentElement.msRequestFullscreen();
else if (document.documentElement.mozRequestFullScreen)
document.documentElement.mozRequestFullScreen();
else if (document.documentElement.webkitRequestFullscreen)
document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}
function exitFullScreen()
{
if (document.exitFullscreen)
document.exitFullscreen();
else if (document.msExitFullscreen)
document.msExitFullscreen();
else if (document.mozCancelFullScreen)
document.mozCancelFullScreen();
else if (document.webkitExitFullscreen)
document.webkitExitFullscreen();
}
// Here we override the goLive function to prevent recordings from being closed when hiding the clips bar.
var original_goLive = goLive;
var goLive = function()
{
}
// Here we restore the original functionality of the context menu option "Go Live" which appears when long-pressing the image during recording playback. Otherwise the override above will disable that context menu.
function onRecordContextMenuAction()
{
switch (this.data.alias)
{
case "golive":
original_goLive();
break;
}
}