ensure video is paused before hiding window
This commit is contained in:
@@ -197,9 +197,15 @@ function dispatch (action, ...args) {
|
||||
// window.history.forward()
|
||||
}
|
||||
if (action === 'pause') {
|
||||
if (state.url !== 'player' || state.video.isPaused) {
|
||||
ipcRenderer.send('paused-video')
|
||||
}
|
||||
state.video.isPaused = true
|
||||
update()
|
||||
}
|
||||
if (action === 'videoPaused') {
|
||||
ipcRenderer.send('paused-video')
|
||||
}
|
||||
if (action === 'playPause') {
|
||||
state.video.isPaused = !state.video.isPaused
|
||||
update()
|
||||
|
||||
@@ -36,6 +36,7 @@ function Player (state, dispatch) {
|
||||
ondblclick=${() => dispatch('toggleFullScreen')}
|
||||
onloadedmetadata=${onLoadedMetadata}
|
||||
onended=${onEnded}
|
||||
onpause=${() => dispatch('videoPaused')}
|
||||
autoplay>
|
||||
</video>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user