This bug was subtle. Basically, on OS X only, we use
window.setAspectRatio() to make the player window match the video size.
But this is maintained even in fullscreen mode, which makes the window
actually not use up the fullscreen, and there are black bars above and
below the video player controls, which looks really weird.
Unset the aspect ratio in fullscreen mode, then set it again upon
leaving fullscreen mode.
The goal here is to remove shortcut handling from the renderer and
unify it all in menu.js and shortcuts.ks (for alternate shortcuts).
I would rather name it "Play" and change to "Pause" when video is
playing, but Electron doesn't support this (yet).
The Window menu is apparently an OS X only convention. I couldn't find
a single app on Windows or Linux that had this menu or even a
"minimize" menu item.
Just some code cleanup to make menu.js more internally consistent.
- Name the electron.dialog returned value `selectedPaths` which is more
accurate.
- Move the file menu into the `template` object, like the rest of the
menus. Then reach in afterwards for OS-specific tweaks.
* Separate hidden window, with its own renderer process, for WebTorrent
(Must be a window. You cannot run WebRTC at all in a Web Worker, and you can't
run it well in a node process like the electron main process.)
* Disabled the create-torrent-modal for now. That gives us a consistent UX
regardless of whether the user dragged files or folders onto the app or opened
the Create New Torrent menu item.
* Main process routes all messages between the main and webtorrent windows.
* The renderer index.js is smaller now (but still too big), with the WebTorrent
interface moved to webtorrent.js / it's own process.
* The UI should be faster now, and should not lag under load.
`globalShortcut` will register the shortcut at the OS level, even when
the app is not focused.
Using `localShortcut` would work, but let's put it in the top menu
instead, where all the other shortcuts are.