Updates for default folder

This commit is contained in:
Matt Walsh
2025-03-24 18:24:49 -05:00
parent 65444978b7
commit e9164d8c36
15 changed files with 169 additions and 30 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,2 +1,3 @@
.mp3 files placed in this folder will be available via the un-mute button in the application.
No subdirectories will be scanned, and music will be played in a random order.
No subdirectories will be scanned, and music will be played in a random order.
The default folder will be used only if no .mp3 files are found in this /server/music folder

View File

@@ -63,12 +63,17 @@ const toggleMedia = (forcedState) => {
stateChanged();
};
const startMedia = () => {
const startMedia = async () => {
// if there's not media player yet, enable it
if (!player) {
initializePlayer();
} else {
player.play();
try {
await player.play();
} catch (e) {
console.error('Couldn\'t play music');
console.error(e);
}
}
};
@@ -128,11 +133,12 @@ const initializePlayer = () => {
console.log('player initialized');
};
const playerCanPlay = () => {
const playerCanPlay = async () => {
// check to make sure they user still wants music (protect against slow loading music)
if (!mediaPlaying.value) return;
// start playing
player.play();
startMedia();
};
const playerEnded = () => {