mirror of
https://github.com/scratchfoundation/scratch-audio.git
synced 2024-12-22 22:12:48 -05:00
Use arrow functions
This commit is contained in:
parent
43e0408434
commit
90af375b03
1 changed files with 2 additions and 3 deletions
|
@ -75,12 +75,11 @@ class SoundPlayer {
|
|||
* @return {Promise} a Promise that resolves when the sound finishes playing
|
||||
*/
|
||||
finished () {
|
||||
const storedContext = this;
|
||||
return new Promise(resolve => {
|
||||
storedContext.bufferSource.onended = function () {
|
||||
this.bufferSource.onended = () => {
|
||||
this.isPlaying = false;
|
||||
resolve();
|
||||
}.bind(storedContext);
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue