mirror of
https://github.com/koel/koel
synced 2024-11-24 21:23:06 +00:00
Override playState of mediaSession for Chrome Android
Per Google Developers official doc: > Note: The browser may consider that the web app is not playing media > when files are seeking or loading. You can override this behaviour by > setting navigator.mediaSession.playbackState to "playing" or "paused". > This comes in handy when you want to make sure your web app UI stays in > sync with the media notification controls.
This commit is contained in:
parent
4618c8744e
commit
cc43d5133a
1 changed files with 2 additions and 0 deletions
|
@ -93,9 +93,11 @@ export const playback = {
|
|||
this.pause()
|
||||
})
|
||||
navigator.mediaSession.setActionHandler('previoustrack', () => {
|
||||
navigator.mediaSession.playbackState = 'playing'
|
||||
this.playPrev()
|
||||
})
|
||||
navigator.mediaSession.setActionHandler('nexttrack', () => {
|
||||
navigator.mediaSession.playbackState = 'playing'
|
||||
this.playNext()
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue