Here is a straightforward Angular application I created to play audio using the JavaScript web Audio Object:
app.component.ts
export class AppComponent {
title = 'media player';
audio;
currentTime: number;
constructor() {
this.audio = new Audio();
this.audio.src = './Music/demo2.MP3';
this.audio.play();
this.currentTime = this.audio.currentTime;
}
}
In addition, here is the code snippet from app.component.ts:
<h4>{{ currentTime }}</h4>
Although everything is functional, the view does not update when the model changes.