Before this commit, we tweaked the subtitle position by modifying the
VTT file, line by line with a regex because I did not know it was
possible to use CSS for it.
But apparently there are Shadow DOM elements that we can use instead.
This new approach improves:
- Wrapping long lines. Before, the text would go off the edge of the
screen. Now it wraps intelligently.
- The subtitles move up to get out of the way of the controls when
those are visible.
I don't think it matters whether the open comes from onOpen (opening
magnet, .torrent file, dragging file to dock, menu item) or from
dragging to the window.
These should use the same code path. The only relevant information is
the page of the app that we're on.
This change unifies the two methods, and supports dragging .torrent
files or creating a torrent when the player is active, if the dragged
files are not .srt or .vtt. We go back to the list, or to the create
torrent page in these situations, so it's not confusing for the user.
Always close open modals when handling an open.
This means people who add a lot of torrents will always have their latest torrents at the top when they open the app, instead of having to scroll all the way down
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.
Apparently, electron.* is actually a getter, so whenever a component of
electron is referenced for the first time, it's require()'d. So, there
are theoretical performance benefits to not declaring all electron.*
upfront.
Instead of:
var autoUpdater = electron.autoUpdater
Just use electron.autoUpdater directly when needed.
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).
WebTorrent 0.91 changed how duplicate torrents are handled, which broke
handling in WebTorrent Desktop.
After this PR:
- No more try-catch on client.add -- this has never thrown errors.
- No check for duplicate torrent.key value since client.add no longer
returns the same torrent object when adding a duplicate torrent. It
emits 'error' instead, and that case is already handled :)
Based on @watson's PR #463.
Differences:
- Remove the "Open Folder" link from expanded torrent view.
- Use showItemInFolder instead of openItem electron API
- Add a separator
- Use IPC to invoke electron.shell.showItemInFolder from main process
This works around a WebTorrent bug where calling client.add(torrentFilePath) to add a duplicate torrent -- in other words, one whose infoHash we're already torrenting -- creates a new torrent object and later throws an error. Inconsistently, calling client.add(magnetURI) or client.add(infoHash) to add a duplicate torrent returns the existing torrent object that we're already torrenting and doesn't throw an error.
This also fixes a prety nasty bug where pasting a dupe magnet link changed the torrentKey of an existing torrent, breaking the communication between the main and WebTorrent windows
Fixes#364
* packager: call callbacks consistently
Before this, the callbacks would not being called, which would lead to
an incomplete build on non-OS X platforms when trying to build all for
all platforms.
* packager: Always produce OS X update file regardless of --package option
This makes it consistent with how the windows build always produces the
.nupkg autoupdate files
* packager: fix duplicate npm install
Move "npm prune && npm dedupe" into the release script. Remove an extra
"npm install"
* Make Windows portable app
When a folder named "Portable Settings" exists in same folder as
WebTorrent.exe, then use it instead of the default application config
path.
Closes#358
* packager: remove redundant signing warning
* cross platform zip function
* Set config file path to match config.CONFIG_PATH
* portable app: make electron settings portable
* portable: fix poster/torrent paths
* use cross-zip
* portable app: default download folder inside 'Portable Settings'