12
README.md
@@ -1,4 +1,4 @@
|
||||
# WebTorrent.app
|
||||
# <img src="WebTorrent.png" width="35"> WebTorrent.app
|
||||
|
||||
[![Gitter][webtorrent-gitter-image]][webtorrent-gitter-url]
|
||||
[![Travis Build][webtorrent-app-travis-image]][webtorrent-app-travis-url]
|
||||
@@ -11,7 +11,7 @@
|
||||
#### WebTorrent, the streaming torrent client. For OS X, Windows, and Linux.
|
||||
|
||||
<p align="center">
|
||||
<img src="./resources/screenshot.png" width="562" height="630" alt="screenshot" align="center">
|
||||
<img src="./static/screenshot.png" width="562" height="630" alt="screenshot" align="center">
|
||||
</p>
|
||||
|
||||
## How to Contribute
|
||||
@@ -28,14 +28,14 @@ $ npm install
|
||||
$ npm start
|
||||
```
|
||||
|
||||
### Build binaries
|
||||
### Package app
|
||||
|
||||
Builds app binaries for OS X, Linux, and Windows.
|
||||
|
||||
```
|
||||
$ npm run build
|
||||
$ npm run package
|
||||
```
|
||||
|
||||
Builds the app for OS X, Linux, and Windows, using [electron-packager](https://github.com/maxogden/electron-packager).
|
||||
|
||||
|
||||
## License
|
||||
|
||||
|
||||
BIN
WebTorrent.icns
Normal file
BIN
WebTorrent.ico
Normal file
|
After Width: | Height: | Size: 361 KiB |
BIN
WebTorrent.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
111
bin/package.js
Executable file
@@ -0,0 +1,111 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var cp = require('child_process')
|
||||
var electronPackager = require('electron-packager')
|
||||
var fs = require('fs')
|
||||
var path = require('path')
|
||||
var pkg = require('../package.json')
|
||||
|
||||
var all = {
|
||||
// Build 64 bit binaries only.
|
||||
arch: 'x64',
|
||||
|
||||
// The application source directory.
|
||||
dir: path.join(__dirname, '..'),
|
||||
|
||||
// The release version of the application. Maps to the `ProductVersion` metadata
|
||||
// property on Windows, and `CFBundleShortVersionString` on OS X.
|
||||
'app-version': pkg.version,
|
||||
|
||||
// Package the application's source code into an archive, using Electron's archive
|
||||
// format. Mitigates issues around long path names on Windows and slightly speeds up
|
||||
// require().
|
||||
asar: false,
|
||||
|
||||
// The build version of the application. Maps to the FileVersion metadata property on
|
||||
// Windows, and CFBundleVersion on OS X. We're using the short git hash (e.g. 'e7d837e')
|
||||
'build-version': cp.execSync('git rev-parse --short HEAD').toString().replace('\n', ''),
|
||||
|
||||
// Pattern which specifies which files to ignore when copying files to create the
|
||||
// package(s).
|
||||
ignore: /^\/(dist|static\/screenshot.png)$/,
|
||||
|
||||
// The base directory where the finished package(s) are created.
|
||||
out: path.join(__dirname, '..', 'dist'),
|
||||
|
||||
// Replace an already existing output directory.
|
||||
overwrite: true,
|
||||
|
||||
// Runs `npm prune --production` which remove the packages specified in
|
||||
// "devDependencies" before starting to package the app.
|
||||
prune: true,
|
||||
|
||||
// The Electron version with which the app is built (without the leading 'v')
|
||||
version: pkg.devDependencies['electron-prebuilt']
|
||||
}
|
||||
|
||||
var darwin = {
|
||||
platform: 'darwin',
|
||||
|
||||
// The bundle identifier to use in the application's plist (OS X only).
|
||||
'app-bundle-id': 'io.webtorrent.app',
|
||||
|
||||
// The application category type, as shown in the Finder via "View" -> "Arrange by
|
||||
// Application Category" when viewing the Applications directory (OS X only).
|
||||
'app-category-type': 'public.app-category.utilities',
|
||||
|
||||
// The bundle identifier to use in the application helper's plist (OS X only).
|
||||
'helper-bundle-id': 'io.webtorrent.app.helper',
|
||||
|
||||
// Application icon.
|
||||
icon: path.join(__dirname, '..', 'WebTorrent.icns')
|
||||
}
|
||||
|
||||
var win32 = {
|
||||
platform: 'win32',
|
||||
|
||||
// Object hash of application metadata to embed into the executable (Windows only)
|
||||
'version-string': {
|
||||
|
||||
// Company that produced the file.
|
||||
CompanyName: 'WebTorrent',
|
||||
|
||||
// Copyright notices that apply to the file. This should include the full text of all
|
||||
// notices, legal symbols, copyright dates, and so on.
|
||||
LegalCopyright: fs.readFileSync(path.join(__dirname, '..', 'LICENSE'), 'utf8'),
|
||||
|
||||
// File description to be presented to users.
|
||||
FileDescription: 'Streaming torrent client',
|
||||
|
||||
// Original name of the file, not including a path. This information enables an
|
||||
// application to determine whether a file has been renamed by a user. The format of
|
||||
// the name depends on the file system for which the file was created.
|
||||
OriginalFilename: 'WebTorrent.exe',
|
||||
|
||||
// Name of the product with which the file is distributed.
|
||||
ProductName: 'WebTorrent',
|
||||
|
||||
// Internal name of the file, if one exists, for example, a module name if the file
|
||||
// is a dynamic-link library. If the file has no internal name, this string should be
|
||||
// the original filename, without extension. This string is required.
|
||||
InternalName: 'WebTorrent'
|
||||
},
|
||||
|
||||
// Application icon.
|
||||
icon: path.join(__dirname, '..', 'WebTorrent.ico')
|
||||
}
|
||||
|
||||
var linux = {
|
||||
platform: 'linux'
|
||||
|
||||
// Note: Application icon for Linux is specified via the BrowserWindow `icon` option.
|
||||
}
|
||||
|
||||
electronPackager(Object.assign({}, all, darwin), done)
|
||||
electronPackager(Object.assign({}, all, win32), done)
|
||||
electronPackager(Object.assign({}, all, linux), done)
|
||||
|
||||
function done (err, appPath) {
|
||||
if (err) console.error(err.message || err)
|
||||
else console.log('Built ' + appPath)
|
||||
}
|
||||
19
config.js
@@ -2,13 +2,14 @@ var path = require('path')
|
||||
|
||||
module.exports = {
|
||||
APP_NAME: 'WebTorrent',
|
||||
INDEX: 'file://' + path.resolve(__dirname, 'renderer', 'index.html'),
|
||||
SOUND_ADD: 'file://' + path.resolve(__dirname, 'resources', 'sound', 'add.wav'),
|
||||
SOUND_DELETE: 'file://' + path.resolve(__dirname, 'resources', 'sound', 'delete.wav'),
|
||||
SOUND_DISABLE: 'file://' + path.resolve(__dirname, 'resources', 'sound', 'disable.wav'),
|
||||
SOUND_DONE: 'file://' + path.resolve(__dirname, 'resources', 'sound', 'done.wav'),
|
||||
SOUND_ENABLE: 'file://' + path.resolve(__dirname, 'resources', 'sound', 'enable.wav'),
|
||||
SOUND_ERROR: 'file://' + path.resolve(__dirname, 'resources', 'sound', 'error.wav'),
|
||||
SOUND_PLAY: 'file://' + path.resolve(__dirname, 'resources', 'sound', 'play.wav'),
|
||||
SOUND_STARTUP: 'file://' + path.resolve(__dirname, 'resources', 'sound', 'startup.wav')
|
||||
APP_ICON: path.join(__dirname, 'WebTorrent.png'),
|
||||
INDEX: 'file://' + path.join(__dirname, 'renderer', 'index.html'),
|
||||
SOUND_ADD: 'file://' + path.join(__dirname, 'static', 'sound', 'add.wav'),
|
||||
SOUND_DELETE: 'file://' + path.join(__dirname, 'static', 'sound', 'delete.wav'),
|
||||
SOUND_DISABLE: 'file://' + path.join(__dirname, 'static', 'sound', 'disable.wav'),
|
||||
SOUND_DONE: 'file://' + path.join(__dirname, 'static', 'sound', 'done.wav'),
|
||||
SOUND_ENABLE: 'file://' + path.join(__dirname, 'static', 'sound', 'enable.wav'),
|
||||
SOUND_ERROR: 'file://' + path.join(__dirname, 'static', 'sound', 'error.wav'),
|
||||
SOUND_PLAY: 'file://' + path.join(__dirname, 'static', 'sound', 'play.wav'),
|
||||
SOUND_STARTUP: 'file://' + path.join(__dirname, 'static', 'sound', 'startup.wav')
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ function createMainWindow () {
|
||||
autoHideMenuBar: true, // Hide top menu bar unless Alt key is pressed (Windows, Linux)
|
||||
backgroundColor: '#282828',
|
||||
darkTheme: true, // Forces dark theme (GTK+3 only)
|
||||
icon: config.APP_ICON,
|
||||
minWidth: 375,
|
||||
minHeight: 38 + (120 * 2), // header height + 2 torrents
|
||||
show: false, // Hide window until DOM finishes loading
|
||||
|
||||
@@ -45,8 +45,8 @@
|
||||
"url": "git://github.com/feross/webtorrent-app.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "electron-packager . $npm_package_productName --overwrite --out=dist --ignore='^/dist$' --prune --asar --all --version=$npm_package_devDependencies_electron_prebuilt",
|
||||
"debug": "DEBUG=* electron .",
|
||||
"package": "node ./bin/package.js",
|
||||
"start": "electron .",
|
||||
"test": "standard",
|
||||
"update-authors": "./bin/update-authors.sh"
|
||||
|
||||
@@ -103,7 +103,7 @@ body {
|
||||
font-weight: 400;
|
||||
src: local('Material Icons'),
|
||||
local('MaterialIcons-Regular'),
|
||||
url(../vendor/MaterialIcons-Regular.woff2) format('woff2');
|
||||
url(../static/MaterialIcons-Regular.woff2) format('woff2');
|
||||
}
|
||||
|
||||
.icon {
|
||||
|
||||
@@ -60,19 +60,19 @@ module.exports = {
|
||||
status: 'paused',
|
||||
infoHash: 'f84b51f0d2c3455ab5dabb6643b4340234cd036e',
|
||||
displayName: 'Big Buck Bunny',
|
||||
posterURL: '../resources/bigBuckBunny.jpg'
|
||||
posterURL: path.join(__dirname, '..', 'static', 'bigBuckBunny.jpg')
|
||||
},
|
||||
{
|
||||
status: 'paused',
|
||||
infoHash: '6a9759bffd5c0af65319979fb7832189f4f3c35d',
|
||||
displayName: 'Sintel',
|
||||
posterURL: '../resources/sintel.jpg'
|
||||
posterURL: path.join(__dirname, '..', 'static', 'sintel.jpg')
|
||||
},
|
||||
{
|
||||
status: 'paused',
|
||||
infoHash: '02767050e0be2fd4db9a2ad6c12416ac806ed6ed',
|
||||
displayName: 'Tears of Steel',
|
||||
posterURL: '../resources/tearsOfSteel.jpg'
|
||||
posterURL: path.join(__dirname, '..', 'static', 'tearsOfSteel.jpg')
|
||||
}
|
||||
],
|
||||
downloadPath: path.join(os.homedir(), 'Downloads')
|
||||
|
||||
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 976 KiB After Width: | Height: | Size: 976 KiB |
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |