Support sounds

This commit is contained in:
Philipp Heckel 2022-03-06 00:02:27 -05:00
parent 09b128f27a
commit dc7ca6e405
13 changed files with 73 additions and 16 deletions

View file

@ -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');