sound on finishing time
This commit is contained in:
@@ -17,12 +17,15 @@ export class FocusPage implements OnInit, OnDestroy {
|
||||
private timerStarted: number | null = null;
|
||||
state: FocusState = FocusState.STOPPED;
|
||||
|
||||
private endOfTimerChime: HTMLAudioElement;
|
||||
|
||||
pathD: string = 'M100 10 A90 90 0 1 1 0 0';
|
||||
|
||||
dashOffset = 0;
|
||||
|
||||
constructor(private renderer: Renderer2) {}
|
||||
constructor(private renderer: Renderer2) {
|
||||
this.endOfTimerChime = new Audio('../../../assets/race-start-beeps-125125.mp3');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.updateTimeDisplay(this.duration * 60, 0, 1);
|
||||
@@ -55,6 +58,9 @@ export class FocusPage implements OnInit, OnDestroy {
|
||||
|
||||
if (progress >= 1) {
|
||||
progress = 1;
|
||||
this.endOfTimerChime.play().catch(error => {
|
||||
console.error('Error playing audio:', error);
|
||||
});
|
||||
clearInterval(this.interval);
|
||||
}
|
||||
|
||||
@@ -96,7 +102,7 @@ export class FocusPage implements OnInit, OnDestroy {
|
||||
|
||||
reload() {
|
||||
this.state = FocusState.SHORT_BREAK;
|
||||
this.startTimer(5);
|
||||
this.startTimer(0.5);
|
||||
}
|
||||
|
||||
recharge() {
|
||||
|
||||
BIN
src/assets/race-start-beeps-125125.mp3
Normal file
BIN
src/assets/race-start-beeps-125125.mp3
Normal file
Binary file not shown.
Reference in New Issue
Block a user