Audio context this binding

This commit is contained in:
Will Scullin 2021-04-25 12:09:30 -07:00
parent 66d8fdc2c2
commit 6c4844cb87
No known key found for this signature in database
GPG Key ID: 26DCD1042C6638CD
1 changed files with 4 additions and 4 deletions

View File

@ -86,7 +86,7 @@ export class Audio implements OptionHandler {
}
autoStart() {
autoStart = () => {
if (this.audioContext && !this.started) {
this.samples = [];
this.audioContext.resume();
@ -94,14 +94,14 @@ export class Audio implements OptionHandler {
}
}
start() {
start = () => {
if (this.audioContext) {
this.samples = [];
this.audioContext.resume();
}
}
isEnabled() {
isEnabled = () => {
return this.sound;
}
@ -121,7 +121,7 @@ export class Audio implements OptionHandler {
];
}
setOption(name: string, value: boolean) {
setOption = (name: string, value: boolean) => {
switch (name) {
case SOUND_ENABLED_OPTION:
this.sound = value;