sound: remove preloading

Sound playing is basically instant -- I was over-engineering when I
added this.
This commit is contained in:
Feross Aboukhadijeh
2016-09-30 15:32:19 -07:00
committed by DC
parent 76e071e965
commit ecd877551e
2 changed files with 0 additions and 13 deletions

View File

@@ -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) {

View File

@@ -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