sound: remove preloading
Sound playing is basically instant -- I was over-engineering when I added this.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
module.exports = {
|
||||
preload,
|
||||
play
|
||||
}
|
||||
|
||||
@@ -47,17 +46,6 @@ const sounds = {
|
||||
}
|
||||
}
|
||||
|
||||
function preload () {
|
||||
for (let name in sounds) {
|
||||
if (!cache[name]) {
|
||||
const sound = sounds[name]
|
||||
const audio = cache[name] = new window.Audio()
|
||||
audio.volume = sound.volume
|
||||
audio.src = sound.url
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function play (name) {
|
||||
let audio = cache[name]
|
||||
if (!audio) {
|
||||
|
||||
@@ -132,7 +132,6 @@ function onState (err, _state) {
|
||||
// Runs a few seconds after the app loads, to avoid slowing down startup time
|
||||
function delayedInit () {
|
||||
lazyLoadCast()
|
||||
sound.preload()
|
||||
}
|
||||
|
||||
// Lazily loads Chromecast and Airplay support
|
||||
|
||||
Reference in New Issue
Block a user