Skip to content

Commit

Permalink
Update albums1994.html
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebrg committed Jan 1, 2025
1 parent 9a37dae commit 225e242
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions music/albums1994.html
Original file line number Diff line number Diff line change
Expand Up @@ -214,16 +214,18 @@ <h5 class="modal-title">Article or Video</h5>
event.preventDefault();
const url = this.href;

// Check if the link is a YouTube playlist/album link
if (url.includes('youtube.com/embed/videoseries')) {
iframe.src = url;
} else if (url.includes('youtube.com/watch')) {
// Embed YouTube video
const videoId = url.split('v=')[1]?.split('&')[0]; // Extract video ID
iframe.src = `https://www.youtube.com/embed/${videoId}`;
} else {
// Load Wikipedia page
if (url.includes('wikipedia')) {
iframe.src = url;
} else if (url.includes('youtube.com')) {
if (url.includes('embed/videoseries')) {
iframe.src = url; // Playlist
} else {
const videoId = url.split('v=')[1]?.split('&')[0];
iframe.src = `https://www.youtube.com/embed/${videoId}`; // Video
}
} else if (url.includes('spotify.com')) {
const spotifyUrl = url.replace('open.spotify.com', 'embed.spotify.com');
iframe.src = spotifyUrl;
}

modal.style.display = 'flex'; // Show modal (flex layout for centering)
Expand Down

0 comments on commit 225e242

Please sign in to comment.