Closed ruiokada closed 5 years ago
Looks good, very elegant solution.
Just 2 more things:
createAudioElement
this should do it:
var reactionFiles = [
{
'audio/ogg': 'public/sounds/react1.ogg',
'audio/mpeg': 'public/sounds/react1.mp3',
},
{
'audio/ogg': 'public/sounds/react2.ogg',
'audio/mpeg': 'public/sounds/react2.mp3',
}
]
Fixed:
- Change snd_react to audioReact so as to be consistent with other variables.
- Load the reaction audio fallbacks as well, based on
createAudioElement
this should do it:
Everything seems to be in order, merging.
As per the concerns raised in comment:
This is a proposed way of dealing with multiple reaction audios. The idea behind this commit is to create audio elements via Javascript but avoid inserting them into the DOM and hard-coding audio elements in HTML.