Pause audio reliably when closing the window
Before it only paused video...
This commit is contained in:
@@ -243,8 +243,8 @@ function dispatch (action, ...args) {
|
|||||||
// and only redraws on requestAnimationFrame(). That means when the user
|
// and only redraws on requestAnimationFrame(). That means when the user
|
||||||
// closes the window (hide window / minimize to tray) and we want to pause
|
// closes the window (hide window / minimize to tray) and we want to pause
|
||||||
// the video, we update the vdom but it keeps playing until you reopen!
|
// the video, we update the vdom but it keeps playing until you reopen!
|
||||||
var videoTag = document.querySelector('video')
|
var mediaTag = document.querySelector('video,audio')
|
||||||
if (videoTag) videoTag.pause()
|
if (mediaTag) mediaTag.pause()
|
||||||
}
|
}
|
||||||
if (action === 'playbackJump') {
|
if (action === 'playbackJump') {
|
||||||
jumpToTime(args[0] /* seconds */)
|
jumpToTime(args[0] /* seconds */)
|
||||||
|
|||||||
Reference in New Issue
Block a user