Skip to content
This repository was archived by the owner on May 26, 2022. It is now read-only.

Conversation

@tarek-eg
Copy link

@tarek-eg tarek-eg commented Apr 10, 2019

Add sound effect
Notification API has sound prop but not supported by any browser now, as a work around we used Audio API

@beeequeue beeequeue self-requested a review April 11, 2019 08:01
@beeequeue beeequeue changed the title add sound effect Add Sound Effect May 2, 2019
const sound = new Audio(soundLink)

if (sound) {
sound.load()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably better if we create and load the sound once instead of every time playSound is called, and then simply call play() whenever we need to.

Possibly pass an Audio instance instead of a string, load the audio if hasn't been already and then play it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants