I'm playing audio on page load when user clicks on any location on browser in angular
<audio id="rsplayer">
<source src='{{ Url }}' />
</audio>
calling it using this code
var player = <HTMLAudioElement> document.querySelector('#rsplayer');
player.load();
var promise = player.play();
if (promise !== undefined) {
promise.then(_ => {
}).catch(error => {
});
}
audio is being played but the the progress bar and timer are not working.
probably because changeDetecion isn't triggered.
this should help:
player.onprogress = () => { this.changeDetectorRef.detectChanges(); }