dispatch a pause event before hiding window on darwin
This commit is contained in:
@@ -48,7 +48,9 @@ function createMainWindow (menu) {
|
|||||||
win.on('close', function (e) {
|
win.on('close', function (e) {
|
||||||
if (process.platform === 'darwin' && !isQuitting) {
|
if (process.platform === 'darwin' && !isQuitting) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
win.hide()
|
win.webContents.executeJavaScript('dispatch("pause")', function () {
|
||||||
|
win.hide()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -187,6 +187,10 @@ function dispatch (action, ...args) {
|
|||||||
// TODO
|
// TODO
|
||||||
// window.history.forward()
|
// window.history.forward()
|
||||||
}
|
}
|
||||||
|
if (action === 'pause') {
|
||||||
|
state.video.isPaused = true
|
||||||
|
update()
|
||||||
|
}
|
||||||
if (action === 'playPause') {
|
if (action === 'playPause') {
|
||||||
state.video.isPaused = !state.video.isPaused
|
state.video.isPaused = !state.video.isPaused
|
||||||
update()
|
update()
|
||||||
|
|||||||
Reference in New Issue
Block a user