mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-14 07:39:29 -07:00
Updates for default folder
This commit is contained in:
BIN
server/music/default/Catch the Sun.mp3
Normal file
BIN
server/music/default/Catch the Sun.mp3
Normal file
Binary file not shown.
BIN
server/music/default/Crisp day.mp3
Normal file
BIN
server/music/default/Crisp day.mp3
Normal file
Binary file not shown.
BIN
server/music/default/Rolling Clouds.mp3
Normal file
BIN
server/music/default/Rolling Clouds.mp3
Normal file
Binary file not shown.
BIN
server/music/default/Strong Breeze.mp3
Normal file
BIN
server/music/default/Strong Breeze.mp3
Normal file
Binary file not shown.
@@ -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
|
||||
@@ -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 = () => {
|
||||
|
||||
Reference in New Issue
Block a user