2
我想從audio.onerror函數訪問isDisabled變量,並且想重置isDisabled的值,但無法設置它。如何訪問音頻對象的onerror事件中的全局變量
public isDisabled: boolean = false;
private verifyPrompt(url: string): boolean{
let audio = new Audio(this.promptMessageUrl);
this.isDisabled =
audio.load;
audio.onerror = function(e){
this.isDisabled = true;
}
}