Fixing 1080p default playback
This commit is contained in:
@@ -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, player; // Youtube Player container
|
||||
let mainContentArea, playerWindow, containerOfPlyrWndow, video; // Youtube Player container
|
||||
let videoTimeLength, videoTimeCurent, ytRangeStart, ytRangeEnd,
|
||||
slugInputTag, endlessPlayTag, ytVideoIntervalLoop, loopingInterval;
|
||||
|
||||
@@ -153,6 +153,10 @@
|
||||
slugInputTag.value = video.baseURI.slice(32, 32+11);
|
||||
ytRangeStart.value = "0:00";
|
||||
|
||||
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) {
|
||||
@@ -170,20 +174,6 @@
|
||||
video.addEventListener("wheel", manageVolume);
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user