Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alarm looped #1

Open
askans opened this issue Feb 22, 2022 · 1 comment
Open

Alarm looped #1

askans opened this issue Feb 22, 2022 · 1 comment

Comments

@askans
Copy link

askans commented Feb 22, 2022

Vielen Dank für das wunderbare YouTube Tutorial!

Mit dem Code habe ich eine Challenge, und zwar hört der Alarm nicht auf sich zu wiederholen. Man muss die Seite wieder laden um den Sound zu stoppen. Gibt es eine Möglichkeit, daß der Alarm nur einmal abgespielt wird?

Viele Grüße!

@cologneOrange
Copy link

Auch wenn es schon sehr lange her ist, dass dieses Video gepostet wurde, aber mich hat dieses Problem auch beschäftigt. Mich hat gestört, dass man den Timer nicht stoppen oder zurücksetzen konnte. Daher habe ich eine function stopTimer() erstellt. Hier wird neben des Zurücksetzen des Timers auf 05:00 Minuten noch der Alarm ausgeschaltet:
(Man kann das bestimmt einfacher lösen, aber für diese Lösung habe ich sehr lange ausprobiert)

alarm.pause();
alarm.currentTime = 0;

Nur falls jemand das gleiche Problem haben sollte. Es funktioniert wenigstens :)
LG

PS:
Danke vielmals für das tolle Tutorial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants