Playback resolution fix?

master
maximstewart 3 years ago
parent 95f297d520
commit 2414a593c4

@ -12,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.5
* Added 1080p playback defaulting.
# Version: 1.5.6
* 1080p playback defaulting... fix ...?
# Download
https://addons.mozilla.org/en-US/firefox/addon/better-youtube-plus/

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

@ -143,22 +143,16 @@
// Video Controler
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 = () => {
slugInputTag.value = video.baseURI.slice(32, 32+11);
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
if (!controlsAreLoaded) {
@ -177,10 +171,20 @@
// Dragable window for floating video event setup
dragVideo(poppedContainer);
// I don't think this works... =[
let resolutionStateChange = setInterval(function () {
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");
videoTimeLength = document.getElementsByClassName("ytp-time-duration")[0].innerText;
ytRangeEnd.value = videoTimeLength;
}
}, 1000);
}
// if 1080p not present, api plays the next lowest available resolution.
player.setPlaybackQualityRange("hd1080","hd1080");
}
const setupObservers = () => {

Loading…
Cancel
Save