mirror of
https://github.com/koel/koel
synced 2024-11-24 21:23:06 +00:00
Fix play/pause handling bug
This commit is contained in:
parent
cc43d5133a
commit
26e57bd643
1 changed files with 2 additions and 12 deletions
|
@ -80,18 +80,8 @@ export const playback = {
|
|||
event.emit('equalizer:init', this.player.media)
|
||||
|
||||
if ('mediaSession' in navigator) {
|
||||
navigator.mediaSession.setActionHandler('play', () => {
|
||||
if (queueStore.current) {
|
||||
if (queueStore.current.playbackState === 'paused') {
|
||||
this.resume()
|
||||
} else {
|
||||
this.pause()
|
||||
}
|
||||
}
|
||||
})
|
||||
navigator.mediaSession.setActionHandler('pause', () => {
|
||||
this.pause()
|
||||
})
|
||||
navigator.mediaSession.setActionHandler('play', () => this.resume())
|
||||
navigator.mediaSession.setActionHandler('pause', () => this.pause())
|
||||
navigator.mediaSession.setActionHandler('previoustrack', () => {
|
||||
navigator.mediaSession.playbackState = 'playing'
|
||||
this.playPrev()
|
||||
|
|
Loading…
Reference in a new issue