Controls hide with video full screen.

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

View File

@ -9,8 +9,8 @@ Better YouTube + works to improve the YouTube experience by providing quick acce
* It allows for quick access to the YouTube video slug.
* It lets Unix, Linux, and MacOS systems the ability to download the video using native app calls.
# Version: 1.3.6
* Added download feature for Unix, Linux, and MacOS systems using native messaging.
# Version: 1.3.7
* Controls hide with video full screen.
# Download
https://addons.mozilla.org/en-US/firefox/addon/better-youtube-plus/

View File

@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Better Youtube +",
"version": "1.3.6",
"version": "1.3.7",
"description": "Enhancements for Youtube to have a better experience.",
"applications": {

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 } );
}