Skip to content

Commit

Permalink
[FIX] One shot sounds playing again when switching tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
vkalpias committed May 12, 2015
1 parent 593749c commit cbf0700
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/audio/audio_channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ pc.extend(pc, function () {
// Connect up the nodes
this.source.connect(this.gain);
this.gain.connect(context.destination);

if (!this.loop) {
// mark source as paused when it ends
this.source.onended = this.pause.bind(this);
}
}

};
Expand Down

0 comments on commit cbf0700

Please sign in to comment.