Remove Invidious integration and replace iframe video with button linking to YouTube in a new tab

This commit is contained in:
Arindy 2026-02-06 20:38:36 +01:00
parent 8aa6fd39d8
commit ca6ccdfa29

View File

@ -10,10 +10,6 @@
// API to StreamerSongList
const streamerSongListApi = "https://api.streamersonglist.com/v1/streamers/";
// Invidious instance to use for youtube videos
// Acts as proxy to work locally
const invidiousUrl = 'https://inv.nadeko.net';
</script>
<style>
/* ========================== */
@ -80,8 +76,8 @@
placeholder="Search..." onkeyup="search(this.value)">
<div id="songs" style="margin-top: 20px"></div>
<iframe width="100%" height="auto" allowfullscreen style="max-width: 100%;aspect-ratio: 16 / 9;" id="youtube"
hidden></iframe>
<div style="width: 100%;aspect-ratio: 16 / 9; background-color: black; align-content: center; text-align: center;" id="youtube"
hidden></div>
</div>
<script>
@ -245,9 +241,16 @@
song.appendChild(title);
let iframe = document.getElementById('youtube').cloneNode(false);
iframe.hidden = false;
iframe.src = invidiousUrl + '/embed/' + link.split("?v=")[1].split("&")[0] + '?iv_load_policy=3&related_videos=false&thin_mode=true&player_style=youtube&t=0';
iframe.referrerpolicy = "no-referrer-when-downgrade"
iframe.frameborder = "0"
// iframe.src = invidiousUrl + '/embed/' + link.split("?v=")[1].split("&")[0] + '?iv_load_policy=3&related_videos=false&thin_mode=true&player_style=youtube&t=0';
// iframe.referrerpolicy = "no-referrer-when-downgrade"
// iframe.frameborder = "0"
var button = document.createElement('button');
button.textContent = 'Open in new Tab';
button.onclick = function () {
window.open(link, '_blank');
}
button.target = '_blank';
iframe.appendChild(button);
song.appendChild(iframe);
parent.appendChild(song);
}