Skip to content

Commit

Permalink
removed repeat emit and isPlaying set
Browse files Browse the repository at this point in the history
  • Loading branch information
Digital authored and Digital committed May 16, 2024
1 parent 2f5e741 commit b16c0d9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions v2/src/components/VNewPersistentPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -447,25 +447,23 @@ const togglePlay = () => {
// Play or pause the sound.
if ($mediaPlayerRef.value && isPlayable.value) {
if (isPlaying.value) {
emit("toggle-play", false)
isPlaying.value = false
$mediaPlayerRef.value.pause()
} else {
isPlaying.value = true
emit("toggle-play", true)
$mediaPlayerRef.value.play()
}
}
}
// exposed method to handle the play
const play = () => {
if ($mediaPlayerRef.value && isPlayable.value) {
isPlaying.value = true
$mediaPlayerRef.value.play()
}
}
// exposed method to handle the pause
const pause = () => {
if ($mediaPlayerRef.value && isPlayable.value) {
isPlaying.value = false
$mediaPlayerRef.value.pause()
}
}
Expand Down

0 comments on commit b16c0d9

Please sign in to comment.