diff --git a/main/windows.js b/main/windows.js index 326c1f26..5ea6b7b0 100644 --- a/main/windows.js +++ b/main/windows.js @@ -48,7 +48,9 @@ function createMainWindow (menu) { win.on('close', function (e) { if (process.platform === 'darwin' && !isQuitting) { e.preventDefault() - win.hide() + win.webContents.executeJavaScript('dispatch("pause")', function () { + win.hide() + }) } }) diff --git a/renderer/index.js b/renderer/index.js index 6458274c..7914242b 100644 --- a/renderer/index.js +++ b/renderer/index.js @@ -187,6 +187,10 @@ function dispatch (action, ...args) { // TODO // window.history.forward() } + if (action === 'pause') { + state.video.isPaused = true + update() + } if (action === 'playPause') { state.video.isPaused = !state.video.isPaused update()