File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed
Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "extends": "@parcel/config-default",
3+ "transformers": {
4+ "*.{wav,mp3}": [
5+ "@parcel/transformer-raw"
6+ ]
7+ }
8+ }
Original file line number Diff line number Diff line change 1+ import tickTackSoundUrl from '../sound/tick-tack.wav' ;
2+ import stopSoundUrl from '../sound/stop.mp3' ;
13import './helper.js' ;
24import { TimerStatus } from './TimerStatus.js' ;
35import {
@@ -33,8 +35,15 @@ function TimerController(reference) {
3335 const DEFAULT_INTERVAL = 1000 ;
3436 const DEFAULT_SECONDS = 30 ;
3537
36- const tickTackSound = new Audio ( './asset/sound/tick-tack.wav' ) ;
37- const stopSound = new Audio ( './asset/sound/stop.mp3' ) ;
38+ const tickTackSound = new Audio ( tickTackSoundUrl ) ;
39+ const stopSound = new Audio ( stopSoundUrl ) ;
40+ tickTackSound . addEventListener ( 'error' , e => {
41+ console . error ( 'Erro ao carregar tick-tack.wav:' , e ) ;
42+ } ) ;
43+
44+ stopSound . addEventListener ( 'error' , e => {
45+ console . error ( 'Erro ao carregar stop.mp3:' , e ) ;
46+ } ) ;
3847
3948 let lastTimerStatus = TimerStatus . STOPPED ;
4049 let previousTimerValue = DEFAULT_SECONDS ;
@@ -166,7 +175,6 @@ function TimerController(reference) {
166175 if ( canStart ) {
167176 let seconds = getInputsValueAsSeconds ( ) ;
168177 seconds -- ;
169-
170178 if ( seconds <= 10 ) {
171179 lastTimerStatus = TimerStatus . COUNTDOWN ;
172180 playCountdownSound ( ) ;
You can’t perform that action at this time.
0 commit comments