summaryrefslogtreecommitdiff
path: root/static/index.js
blob: b7056b1c219b689ab14744567290c56c02ae7bb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

function GetSongs() {
    fetch("/api/getSongs").then(r => r.json().then(body => {
        console.log(body);
    }));
}

function SetRandomSong() {
    fetch("/api/randomSong").then(r => r.json().then(body => {
        const player = document.getElementById("mainAudio");
        console.log(player);
        console.log(body);
        player.src = "/api/getSong?name=" + encodeURI(body.Name);
        player.play();
    }));
}