Commit c08b51d8 authored by Xiaowu Zhang's avatar Xiaowu Zhang

solve audio control can not play sound

parent 3cc9b1f5
...@@ -10,13 +10,12 @@ ...@@ -10,13 +10,12 @@
gadget.analyser.connect(gadget.gain); gadget.analyser.connect(gadget.gain);
gadget.gain.gain.value = gadget.volume; gadget.gain.gain.value = gadget.volume;
gadget.gain.connect(gadget.audioCtx.destination); gadget.gain.connect(gadget.audioCtx.destination);
gadget.audio.stop();
gadget.audio.src = URL.createObjectURL(file); gadget.audio.src = URL.createObjectURL(file);
gadget.audio.load(); gadget.audio.load();
gadget.decoded = true; gadget.decoded = true;
}) })
.declareMethod('stopSong', function () { .declareMethod('stopSong', function () {
this.audio.stop(); this.audio.pause();
}) })
.declareMethod('playSong', function () { .declareMethod('playSong', function () {
this.audio.play(); this.audio.play();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment