Playback resolution fix?

This commit is contained in:
maximstewart 2021-02-28 00:32:27 -06:00
parent 95f297d520
commit 2414a593c4
3 changed files with 17 additions and 13 deletions

View File

@ -12,8 +12,8 @@ Better YouTube + works to improve the YouTube experience by providing quick acce
* It shows volume level as you scroll. * 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. * It lets Unix, Linux, and MacOS systems have the ability to download the video using native app calls.
# Version: 1.5.5 # Version: 1.5.6
* Added 1080p playback defaulting. * 1080p playback defaulting... fix ...?
# Download # Download
https://addons.mozilla.org/en-US/firefox/addon/better-youtube-plus/ https://addons.mozilla.org/en-US/firefox/addon/better-youtube-plus/

View File

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

View File

@ -143,22 +143,16 @@
// Video Controler // Video Controler
video = document.getElementsByTagName("video")[0]; // Actual video object (I think...) 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) // Container of actual player (Used for floating window)
containerOfPlyrWndow = document.getElementById("player-container"); containerOfPlyrWndow = document.getElementById("player-container");
part = "https://img.youtube.com/vi/";
} }
const fillUIAndSetupEvents = () => { const fillUIAndSetupEvents = () => {
slugInputTag.value = video.baseURI.slice(32, 32+11); slugInputTag.value = video.baseURI.slice(32, 32+11);
ytRangeStart.value = "0:00"; ytRangeStart.value = "0:00";
// We need to wait for info to load before getting full duration
setTimeout(function () {
videoTimeLength = document.getElementsByClassName("ytp-time-duration")[0].innerText;
ytRangeEnd.value = videoTimeLength;
}, 2000);
// Only setting these up if we need to load controls' info // Only setting these up if we need to load controls' info
if (!controlsAreLoaded) { if (!controlsAreLoaded) {
@ -177,10 +171,20 @@
// Dragable window for floating video event setup // Dragable window for floating video event setup
dragVideo(poppedContainer); dragVideo(poppedContainer);
} // I don't think this works... =[
let resolutionStateChange = setInterval(function () {
// if 1080p not present, api plays the next lowest available resolution. player = document.getElementById("movie_player");
if (video.readyState === 4 && player !== undefined) {
clearInterval(resolutionStateChange);
// ? Something like a meta information and signal object????
// If 1080p not present, api plays the next lowest available resolution.
player.setPlaybackQualityRange("hd1080","hd1080"); player.setPlaybackQualityRange("hd1080","hd1080");
videoTimeLength = document.getElementsByClassName("ytp-time-duration")[0].innerText;
ytRangeEnd.value = videoTimeLength;
}
}, 1000);
}
} }
const setupObservers = () => { const setupObservers = () => {