Minimize to tray

Fixes #150
This commit is contained in:
DC
2016-03-29 02:25:35 -07:00
parent bc5292dd02
commit 23ce394bb9
6 changed files with 46 additions and 9 deletions

View File

@@ -270,6 +270,13 @@ function dispatch (action, ...args) {
}
if (action === 'pause') {
playPause(true)
// Work around virtual-dom issue: it doesn't expose its redraw function,
// and only redraws on requestAnimationFrame(). That means when the user
// 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!
var videoTag = document.querySelector('video')
if (videoTag) videoTag.pause()
}
if (action === 'playbackJump') {
jumpToTime(args[0] /* seconds */)