Im using Angular 8 and Typescript
Problem: i want an array to have the same length as the music source of an audio tag, to enable comments that are synchronized with the intended location in the track. Similar as soundcloud.
Technical approach:
I have an audio tag with one audiofile in it. this got a duration i can access with this.audioplayer.duration
now i have an array, public comments = []
which i want to be the same length as the track duration
<div *ngFor="let comment of comments">
</div>
to sync them, i tried
ngAfterViewInit() {
this.comments.length= this.audioplayer.duration }
but im getting invalid array length. Is there a way to make this work?