Support sounds
This commit is contained in:
parent
09b128f27a
commit
dc7ca6e405
13 changed files with 73 additions and 16 deletions
|
@ -121,6 +121,11 @@ export const subscriptionRoute = (subscription) => {
|
|||
return `/${subscription.topic}`;
|
||||
}
|
||||
|
||||
export const playSound = async (sound) => {
|
||||
const audio = new Audio(`/static/sounds/${sound}.mp3`);
|
||||
return audio.play();
|
||||
};
|
||||
|
||||
// From: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
|
||||
export async function* fetchLinesIterator(fileURL, headers) {
|
||||
const utf8Decoder = new TextDecoder('utf-8');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue