@ViewChild('audio', { static: true }) private audio: ElementRef;
private audioEl: HTMLAudioElement;
onCanplay(){
this.play();
}
play(){
this.audioEl.play();
}
报错Cannot read property 'play' of undefined。
@ViewChild('audio', { static: true }) private audio: ElementRef;
private audioEl: HTMLAudioElement;
onCanplay(){
this.play();
}
play(){
this.audioEl.play();
}
报错Cannot read property 'play' of undefined。