mirror of
https://github.com/goodtube4u/goodtube.git
synced 2025-11-22 10:16:11 +00:00
Buffering updates
This commit is contained in:
@@ -592,7 +592,7 @@
|
||||
// Turn first load off
|
||||
goodTube_player_firstLoad = false;
|
||||
}
|
||||
// On other loads
|
||||
// On other loads (picture in picture only currently)
|
||||
else {
|
||||
// Load the video via the iframe api
|
||||
goodTube_player.contentWindow.postMessage('goodTube_load_'+goodTube_getParams['v'], '*');
|
||||
|
||||
56
goodtube.js
56
goodtube.js
@@ -1544,46 +1544,46 @@
|
||||
if (goodTube_bufferingTimeout) {
|
||||
clearTimeout(goodTube_bufferingTimeout);
|
||||
}
|
||||
if (goodTube_bufferCountTimeout) {
|
||||
clearTimeout(goodTube_bufferCountTimeout);
|
||||
}
|
||||
// if (goodTube_bufferCountTimeout) {
|
||||
// clearTimeout(goodTube_bufferCountTimeout);
|
||||
// }
|
||||
|
||||
// If we're at the start of the video, don't do anything
|
||||
if (goodTube_player.currentTime <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If we're not seeking
|
||||
if (!goodTube_seeking) {
|
||||
goodTube_bufferCountTimeout = setTimeout(function() {
|
||||
// And we've had to wait for it to buffer for at least 1 second 3 times, select the next server
|
||||
goodTube_bufferCount++;
|
||||
// // If we're not seeking
|
||||
// if (!goodTube_seeking) {
|
||||
// goodTube_bufferCountTimeout = setTimeout(function() {
|
||||
// // And we've had to wait for it to buffer for at least 1 second 3 times, select the next server
|
||||
// goodTube_bufferCount++;
|
||||
|
||||
if (goodTube_bufferCount >= 3) {
|
||||
// Clear any buffering timeouts
|
||||
if (goodTube_bufferingTimeout) {
|
||||
clearTimeout(goodTube_bufferingTimeout);
|
||||
}
|
||||
if (goodTube_bufferCountTimeout) {
|
||||
clearTimeout(goodTube_bufferCountTimeout);
|
||||
}
|
||||
// if (goodTube_bufferCount >= 3) {
|
||||
// // Clear any buffering timeouts
|
||||
// if (goodTube_bufferingTimeout) {
|
||||
// clearTimeout(goodTube_bufferingTimeout);
|
||||
// }
|
||||
// if (goodTube_bufferCountTimeout) {
|
||||
// clearTimeout(goodTube_bufferCountTimeout);
|
||||
// }
|
||||
|
||||
// Debug message
|
||||
console.log('[GoodTube] Video buffering too often - selecting next video source...');
|
||||
// // Debug message
|
||||
// console.log('[GoodTube] Video buffering too often - selecting next video source...');
|
||||
|
||||
// Reset the buffer count
|
||||
goodTube_bufferCount = 0;
|
||||
// // Reset the buffer count
|
||||
// goodTube_bufferCount = 0;
|
||||
|
||||
// Set the player time to be restored when the new server loads
|
||||
goodTube_player_restoreTime = goodTube_player.currentTime;
|
||||
// // Set the player time to be restored when the new server loads
|
||||
// goodTube_player_restoreTime = goodTube_player.currentTime;
|
||||
|
||||
// Select the next server
|
||||
goodTube_player_selectVideoServer('automatic', true);
|
||||
// // Select the next server
|
||||
// goodTube_player_selectVideoServer('automatic', true);
|
||||
|
||||
return;
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
// return;
|
||||
// }
|
||||
// }, 1000);
|
||||
// }
|
||||
|
||||
// Only do this for HD servers (Invidious and Piped)
|
||||
if ((goodTube_videoServer_type === 2 || goodTube_videoServer_type === 3)) {
|
||||
|
||||
2
goodtube.min.js
vendored
2
goodtube.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user