mirror of
https://github.com/openvk/openvk
synced 2025-04-23 08:33:02 +03:00
Make repeat button work
This commit is contained in:
parent
d227a14a10
commit
6e49802bf9
1 changed files with 7 additions and 8 deletions
|
@ -98,6 +98,12 @@ class bigPlayer {
|
||||||
}
|
}
|
||||||
|
|
||||||
e.currentTarget.classList.toggle("pressed")
|
e.currentTarget.classList.toggle("pressed")
|
||||||
|
|
||||||
|
if(e.currentTarget.classList.contains("pressed")) {
|
||||||
|
this.player().loop = true
|
||||||
|
} else {
|
||||||
|
this.player().loop = false
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
u(".bigPlayer .arrowsButtons .nextButton").on("click", (e) => {
|
u(".bigPlayer .arrowsButtons .nextButton").on("click", (e) => {
|
||||||
|
@ -111,14 +117,7 @@ class bigPlayer {
|
||||||
u(this.player()).on("ended", (e) => {
|
u(this.player()).on("ended", (e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
||||||
// код не работает, как я понял, оно не хочет нажимать потому что это не действие пользователя
|
|
||||||
if(this.playerNode.querySelector(".repeatButton").classList.contains("pressed")) {
|
|
||||||
this.player().currentTime = 0
|
|
||||||
|
|
||||||
this.player().play()
|
|
||||||
} else {
|
|
||||||
this.showNextTrack()
|
this.showNextTrack()
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
this.player().volume = 0.75
|
this.player().volume = 0.75
|
||||||
|
|
Loading…
Reference in a new issue