Remove Invidious integration and replace iframe video with button linking to YouTube in a new tab
This commit is contained in:
parent
8aa6fd39d8
commit
ca6ccdfa29
@ -10,10 +10,6 @@
|
|||||||
|
|
||||||
// API to StreamerSongList
|
// API to StreamerSongList
|
||||||
const streamerSongListApi = "https://api.streamersonglist.com/v1/streamers/";
|
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>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
/* ========================== */
|
/* ========================== */
|
||||||
@ -80,8 +76,8 @@
|
|||||||
placeholder="Search..." onkeyup="search(this.value)">
|
placeholder="Search..." onkeyup="search(this.value)">
|
||||||
<div id="songs" style="margin-top: 20px"></div>
|
<div id="songs" style="margin-top: 20px"></div>
|
||||||
|
|
||||||
<iframe width="100%" height="auto" allowfullscreen style="max-width: 100%;aspect-ratio: 16 / 9;" id="youtube"
|
<div style="width: 100%;aspect-ratio: 16 / 9; background-color: black; align-content: center; text-align: center;" id="youtube"
|
||||||
hidden></iframe>
|
hidden></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -245,9 +241,16 @@
|
|||||||
song.appendChild(title);
|
song.appendChild(title);
|
||||||
let iframe = document.getElementById('youtube').cloneNode(false);
|
let iframe = document.getElementById('youtube').cloneNode(false);
|
||||||
iframe.hidden = 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.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.referrerpolicy = "no-referrer-when-downgrade"
|
||||||
iframe.frameborder = "0"
|
// 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);
|
song.appendChild(iframe);
|
||||||
parent.appendChild(song);
|
parent.appendChild(song);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user