Move song data to currentSong.data
This commit is contained in:
parent
c7e0d93fb0
commit
2bad02d27e
1 changed files with 4 additions and 1 deletions
|
@ -49,10 +49,12 @@
|
||||||
let source: HTMLAudioElement = $state();
|
let source: HTMLAudioElement = $state();
|
||||||
let mode = $state(new PlaybackState());
|
let mode = $state(new PlaybackState());
|
||||||
let title = $state("");
|
let title = $state("");
|
||||||
|
let artist = $state("");
|
||||||
let queueIndex = $state(0);
|
let queueIndex = $state(0);
|
||||||
let currentSong = $state({
|
let currentSong = $state({
|
||||||
data: {
|
data: {
|
||||||
title,
|
title,
|
||||||
|
artist
|
||||||
},
|
},
|
||||||
queueIndex
|
queueIndex
|
||||||
});
|
});
|
||||||
|
@ -122,7 +124,7 @@
|
||||||
play();
|
play();
|
||||||
}
|
}
|
||||||
|
|
||||||
function newSong(song: number) {
|
function newSong(song: unknown) {
|
||||||
let parameters = [
|
let parameters = [
|
||||||
{ parameter: "id", value: song.id },
|
{ parameter: "id", value: song.id },
|
||||||
//{ parameter: "maxBitRate", value: } // TODO
|
//{ parameter: "maxBitRate", value: } // TODO
|
||||||
|
@ -134,6 +136,7 @@
|
||||||
];
|
];
|
||||||
let url = OpenSubsonic.getApiUrl("stream", parameters);
|
let url = OpenSubsonic.getApiUrl("stream", parameters);
|
||||||
source = new Audio(url); // Assign new URL
|
source = new Audio(url); // Assign new URL
|
||||||
|
currentSong.data = song;
|
||||||
|
|
||||||
// Reassign Event Handlers
|
// Reassign Event Handlers
|
||||||
source.onloadedmetadata = () => {
|
source.onloadedmetadata = () => {
|
||||||
|
|
Loading…
Reference in a new issue