I have a play and a pause button:
<div *ngIf="!playToggle">
<button (click)="playTimeLine(); playToggle = true">
<i class="fa fa-play" aria-hidden="true"></i>
</button>
</div>
<div *ngIf="playToggle">
<button (click)="pauseTimeLine(); playToggle = false">
<i class="fa fa-pause" aria-hidden="true"></i>
</button>
</div>
If the play button is clicked it calls the playTimeLine function:
currentTime = 0;
playTimeLine(value) {
setInterval(() => {
this.currentTime = this.currentTime + 10;
console.log(this.currentTime);
}, 1000);
}
I would like to add a pause function that pauses the interval. But it also makes it possible to resume it from the point it was paused.