defaulting player to 1080p if possible

This commit is contained in:
maximstewart 2021-02-27 23:19:27 -06:00
parent 53adcfaf1e
commit 95f297d520
3 changed files with 13 additions and 7 deletions

View File

@ -1,6 +1,7 @@
# Better Youtube +
Better YouTube + works to improve the YouTube experience by providing quick access to features we'd all like to have from the get-go.
<br/>
* It defaults playback to 1080p if able to.
* It allows quick thumbnail access of the video.
* It allows setting the loop mode easily.
* It allows setting the loop mode to a ranged set.
@ -11,8 +12,8 @@ Better YouTube + works to improve the YouTube experience by providing quick acce
* It shows volume level as you scroll.
* It lets Unix, Linux, and MacOS systems have the ability to download the video using native app calls.
# Version: 1.5.4
* Fixed loop breakage
# Version: 1.5.5
* Added 1080p playback defaulting.
# 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.5.4",
"version": "1.5.5",
"description": "Enhancements for Youtube to have a better experience.",
"applications": {

View File

@ -41,7 +41,7 @@
let ytThumbImgMenu, ytEnhancerMenu, ytEnhancerMenu2; // Menu systems
let ytThumbnailBttn, ytLoopBttn, ytFloatBttn, ytDownloadBttn; // Menu Buttons
let ytMaxDefaultImg, ytHqDefaultImg, ytAMaxDefaultImg, ytAHqDefaultImg; // Thumbnail images
let mainContentArea, playerWindow, containerOfPlyrWndow, video; // Youtube Player container
let mainContentArea, playerWindow, containerOfPlyrWndow, video, player; // Youtube Player container
let videoTimeLength, videoTimeCurent, ytRangeStart, ytRangeEnd,
slugInputTag, endlessPlayTag, ytVideoIntervalLoop, loopingInterval;
@ -142,11 +142,12 @@
slugInputTag = document.getElementById("slugCopyZone");
// Video Controler
video = document.getElementsByTagName("video")[0];
video = document.getElementsByTagName("video")[0]; // Actual video object (I think...)
player = document.getElementById("movie_player"); // ? Something like a meta information and signal object????
part = "https://img.youtube.com/vi/";
// Container of actual player (Used for floating window)
containerOfPlyrWndow = document.getElementById("player-container");
part = "https://img.youtube.com/vi/";
}
const fillUIAndSetupEvents = () => {
@ -175,7 +176,11 @@
video.addEventListener("wheel", manageVolume);
// Dragable window for floating video event setup
dragVideo(poppedContainer);
}
// if 1080p not present, api plays the next lowest available resolution.
player.setPlaybackQualityRange("hd1080","hd1080");
}
const setupObservers = () => {