mirror of
https://github.com/goodtube4u/goodtube.git
synced 2025-11-22 10:16:11 +00:00
Faster video display on first liad
This commit is contained in:
@@ -731,7 +731,7 @@
|
||||
|
||||
|
||||
// Get the Youtube player
|
||||
// We target 3 elements here, it seems to change for different users? Weird stuff.
|
||||
// We target 4 elements here, it seems to change for different users? Weird stuff.
|
||||
let youtubePlayer = document.querySelector('#player.ytd-watch-flexy');
|
||||
|
||||
if (!youtubePlayer || youtubePlayer.offsetHeight <= 0) {
|
||||
@@ -742,6 +742,11 @@
|
||||
youtubePlayer = document.querySelector('.player-size');
|
||||
}
|
||||
|
||||
// This element helps during the loading of the page (if we use it we see the video a little sooner, which is nice)
|
||||
if (!youtubePlayer || youtubePlayer.offsetHeight <= 0) {
|
||||
youtubePlayer = document.querySelector('.html5-video-player');
|
||||
}
|
||||
|
||||
|
||||
// If we found the Youtube player
|
||||
if (youtubePlayer && youtubePlayer.offsetHeight > 0) {
|
||||
|
||||
Reference in New Issue
Block a user