Skip to content

Commit 3b5231f

Browse files
committed
Update actions.js
1 parent d5901b4 commit 3b5231f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

store/player/actions.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,8 @@ export function setGlobalSeek (context) {
7777
}
7878

7979
export function sleeptimer (context, mins) {
80-
console.log('sleeptimer')
81-
console.log(mins)
8280
const seconds = mins * 60 // mins to seconds
8381
const milliseconds = seconds * 1000 // conds to milliseconds
84-
console.log(milliseconds)
8582

8683
context.commit('sleepamount', mins)
8784
context.commit('sleepend', Date.now() + milliseconds)
@@ -90,7 +87,6 @@ export function sleeptimer (context, mins) {
9087
// context.state.player.pause()
9188
context.commit('sleepend', null)
9289
context.commit('sleep', null)
93-
console.log('engage fadeout')
9490
fadeOut(context)
9591
}, milliseconds)
9692

@@ -100,9 +96,8 @@ export function sleeptimer (context, mins) {
10096
export function fadeOut (context) {
10197
console.log('fadout')
10298
let to = 20
103-
let vol = 1
10499
const fadeout = setInterval(() => {
105-
vol = to / 20
100+
const vol = to / 20
106101
context.state.player.volume = vol
107102
console.log(vol)
108103
if (to <= 0) {
@@ -130,4 +125,7 @@ export function clearFadeout (context) {
130125
context.commit('fadeout', null)
131126
context.state.player.volume = 1
132127
sleeptimer(context, mins)
128+
const chime = new Audio()
129+
chime.src = 'chime.wav'
130+
chime.play()
133131
}

0 commit comments

Comments
 (0)