mirror of
https://github.com/scratchfoundation/scratch-audio.git
synced 2025-01-08 13:51:58 -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
|
* @return {Promise} a Promise that resolves when the sound finishes playing
|
||||||
*/
|
*/
|
||||||
finished () {
|
finished () {
|
||||||
const storedContext = this;
|
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
storedContext.bufferSource.onended = function () {
|
this.bufferSource.onended = () => {
|
||||||
this.isPlaying = false;
|
this.isPlaying = false;
|
||||||
resolve();
|
resolve();
|
||||||
}.bind(storedContext);
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue