Controls hide with video full screen.
This commit is contained in:
@@ -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 } );
|
||||
}
|
||||
|
Reference in New Issue
Block a user