Merge pull request #76 from feross/feross/config
Show video name in title bar; misc fixes
This commit is contained in:
6
config.js
Normal file
6
config.js
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
var path = require('path')
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
APP_NAME: 'WebTorrent',
|
||||||
|
INDEX: 'file://' + path.resolve(__dirname, 'renderer', 'index.html')
|
||||||
|
}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
var path = require('path')
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
APP_NAME: 'WebTorrent',
|
|
||||||
INDEX: 'file://' + path.resolve(__dirname, '..', 'renderer', 'index.html')
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
var config = require('../config')
|
||||||
var debug = require('debug')('webtorrent-app:menu')
|
var debug = require('debug')('webtorrent-app:menu')
|
||||||
var electron = require('electron')
|
var electron = require('electron')
|
||||||
var windows = require('./windows')
|
var windows = require('./windows')
|
||||||
@@ -205,7 +206,7 @@ function getMenuTemplate () {
|
|||||||
role: 'help',
|
role: 'help',
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: 'Learn more about WebTorrent',
|
label: 'Learn more about ' + config.APP_NAME,
|
||||||
click: function () { electron.shell.openExternal('https://webtorrent.io') }
|
click: function () { electron.shell.openExternal('https://webtorrent.io') }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
var electron = require('electron')
|
var config = require('../config')
|
||||||
var debug = require('debug')('webtorrent-app:windows')
|
var debug = require('debug')('webtorrent-app:windows')
|
||||||
var config = require('./config')
|
var electron = require('electron')
|
||||||
|
|
||||||
var app = electron.app
|
var app = electron.app
|
||||||
|
|
||||||
|
|||||||
@@ -265,10 +265,6 @@ body.drag::before {
|
|||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lead {
|
|
||||||
font-size: 150%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.torrent {
|
.torrent {
|
||||||
height: 120px;
|
height: 120px;
|
||||||
background: linear-gradient(to bottom right, #4B79A1, #283E51);
|
background: linear-gradient(to bottom right, #4B79A1, #283E51);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ console.time('init')
|
|||||||
var airplay = require('airplay-js')
|
var airplay = require('airplay-js')
|
||||||
var cfg = require('application-config')('WebTorrent')
|
var cfg = require('application-config')('WebTorrent')
|
||||||
var chromecasts = require('chromecasts')()
|
var chromecasts = require('chromecasts')()
|
||||||
|
var config = require('../config')
|
||||||
var createTorrent = require('create-torrent')
|
var createTorrent = require('create-torrent')
|
||||||
var dragDrop = require('drag-drop')
|
var dragDrop = require('drag-drop')
|
||||||
var electron = require('electron')
|
var electron = require('electron')
|
||||||
@@ -167,6 +168,7 @@ function dispatch (action, ...args) {
|
|||||||
closeServer()
|
closeServer()
|
||||||
}
|
}
|
||||||
state.url = '/'
|
state.url = '/'
|
||||||
|
state.title = config.APP_NAME
|
||||||
update()
|
update()
|
||||||
}
|
}
|
||||||
if (action === 'forward') {
|
if (action === 'forward') {
|
||||||
@@ -397,6 +399,7 @@ function closeServer () {
|
|||||||
function openPlayer (torrent) {
|
function openPlayer (torrent) {
|
||||||
startServer(torrent, function () {
|
startServer(torrent, function () {
|
||||||
state.url = '/player'
|
state.url = '/player'
|
||||||
|
state.title = torrent.name
|
||||||
update()
|
update()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -410,7 +413,7 @@ function deleteTorrent (torrent) {
|
|||||||
function openChromecast (torrent) {
|
function openChromecast (torrent) {
|
||||||
startServer(torrent, function () {
|
startServer(torrent, function () {
|
||||||
state.devices.chromecast.play(state.server.networkURL, {
|
state.devices.chromecast.play(state.server.networkURL, {
|
||||||
title: 'WebTorrent — ' + torrent.name
|
title: config.APP_NAME + ' — ' + torrent.name
|
||||||
})
|
})
|
||||||
state.devices.chromecast.on('error', function (err) {
|
state.devices.chromecast.on('error', function (err) {
|
||||||
err.message = 'Chromecast: ' + err.message
|
err.message = 'Chromecast: ' + err.message
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ function torrentPoster (torrent, cb) {
|
|||||||
// filter out file formats that the <video> tag definitely can't play
|
// filter out file formats that the <video> tag definitely can't play
|
||||||
var files = torrent.files.filter(function (file) {
|
var files = torrent.files.filter(function (file) {
|
||||||
var extname = path.extname(file.name)
|
var extname = path.extname(file.name)
|
||||||
return ['.mp4', '.webm', '.mov', '.mkv'].indexOf(extname) !== -1
|
return ['.mp4', '.m4v', '.webm', '.mov', '.mkv'].indexOf(extname) !== -1
|
||||||
})
|
})
|
||||||
|
|
||||||
if (files.length === 0) return cb(new Error('cannot make screenshot for any files in torrent'))
|
if (files.length === 0) return cb(new Error('cannot make screenshot for any files in torrent'))
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
var config = require('../config')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
/* Temporary state disappears once the program exits.
|
/* Temporary state disappears once the program exits.
|
||||||
* It can contain complex objects like open connections, etc.
|
* It can contain complex objects like open connections, etc.
|
||||||
@@ -19,7 +21,7 @@ module.exports = {
|
|||||||
isFocused: true,
|
isFocused: true,
|
||||||
isFullScreen: false,
|
isFullScreen: false,
|
||||||
mainWindowBounds: null, /* x y width height */
|
mainWindowBounds: null, /* x y width height */
|
||||||
title: 'WebTorrent', /* current window title */
|
title: config.APP_NAME, /* current window title */
|
||||||
video: {
|
video: {
|
||||||
isPaused: false,
|
isPaused: false,
|
||||||
currentTime: 0, /* seconds */
|
currentTime: 0, /* seconds */
|
||||||
|
|||||||
Reference in New Issue
Block a user