Mobile playlist fix

This commit is contained in:
goodtube4u
2024-07-23 09:54:08 +10:00
parent 66f58888c7
commit ef6a867bf5
2 changed files with 15 additions and 18 deletions

View File

@@ -5701,28 +5701,11 @@
// Generate playlist links
let goodTube_playlistLinks = [];
function goodTube_generatePlaylistLinks() {
// Target the playlist container
let playlistContainer = document.getElementById('goodTube_playlistContainer');
// Add the playlist container if we don't have it
if (!playlistContainer) {
playlistContainer = document.createElement('div');
playlistContainer.setAttribute('id', 'goodTube_playlistContainer');
playlistContainer.style.display = 'none';
document.body.appendChild(playlistContainer);
}
// Empty the playlist container
playlistContainer.innerHTML = '';
// If we're not viewing a playlist, just return.
if (typeof goodTube_getParams['i'] === 'undefined' && typeof goodTube_getParams['index'] === 'undefined' && typeof goodTube_getParams['list'] === 'undefined') {
return;
}
// Otherwise we are viewing a playlist, so populate the playlist container
let youtubeFrameAPI = document.getElementById('movie_player');
// Get the playlist items
let playlistLinks = false;
let playlistTitles = false;
@@ -5740,6 +5723,20 @@
// If the playlist links have changed
if (playlistLinks.length > 0 && playlistLinks.length !== goodTube_playlistLinks.length) {
// Target the playlist container
let playlistContainer = document.getElementById('goodTube_playlistContainer');
// Add the playlist container if we don't have it
if (!playlistContainer) {
playlistContainer = document.createElement('div');
playlistContainer.setAttribute('id', 'goodTube_playlistContainer');
playlistContainer.style.display = 'none';
document.body.appendChild(playlistContainer);
}
// Empty the playlist container
playlistContainer.innerHTML = '';
// For each playlist item
let i = 0;
playlistLinks.forEach((playlistItem) => {

2
goodtube.min.js vendored

File diff suppressed because one or more lines are too long