Skip to content

Commit

Permalink
Use audio.oncanplay insteaad of audio.onload in microphone.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Avaer Kazmer committed Oct 15, 2018
1 parent 2e17dd8 commit bdb2789
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions examples/microphone.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,17 @@
frameOfReferenceType: 'stage',
});

audio = document.createElement('audio');
audio.onload = () => {
audio = document.createElement('audio');
audio.oncanplay = () => {
console.log('audio loaded');

session.onselect = () => {
console.log('audio play');

if (!audio.paused) {
audio.pause();
}
audio.currentTime = 0;
audio.play();
};
};
Expand Down

0 comments on commit bdb2789

Please sign in to comment.