Controls hide with video full screen.

This commit is contained in:
2019-02-02 23:48:26 -06:00
parent a638cefe21
commit 0428abcc6b
3 changed files with 16 additions and 4 deletions

View File

@@ -1,5 +1,4 @@
(function() {
// Declare variables
let slugInputTag, ytThumbImgMenu, ytEnhancerMenu; // Menu systems
let ytThumbnailBttn, ytMaxDefaultImg, ytHqDefaultImg, // Buttons & Images
@@ -118,6 +117,7 @@
ytFloatBttn.addEventListener("click", toggleFloat);
ytDownloadBttn.addEventListener("click", downloadVideo);
video.addEventListener("wheel", manageVolume);
video.addEventListener("dblclick", controlManager);
// Dragable window for floating video
dragVideo(poppedContainer);
@@ -149,6 +149,8 @@
ytRangeStart.id = "rangeStartID";
ytRangeEnd.id = "rangeEndID";
poppedContainer.style.display = "none";
ytEnhancerMenu.style.display = "block";
slugInputTag.style.display = "block";
ytIfrm.setAttribute("allow", "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture");
ytIfrm.setAttribute("frameborder", "0");
@@ -159,6 +161,16 @@
}
// Functions
const controlManager = () => {
if (ytEnhancerMenu.style.display == "block") {
ytEnhancerMenu.style.display = "none";
slugInputTag.style.display = "none";
} else {
ytEnhancerMenu.style.display = "block";
slugInputTag.style.display = "block";
}
}
const downloadVideo = () => {
browser.runtime.sendMessage( { "url": video.baseURI } );
}