@@ -8,7 +8,6 @@ module.exports = {
|
||||
|
||||
var electron = require('electron')
|
||||
|
||||
var config = require('../config')
|
||||
var log = require('./log')
|
||||
var windows = require('./windows')
|
||||
|
||||
@@ -118,5 +117,5 @@ function setTitle (title) {
|
||||
}
|
||||
|
||||
function resetTitle () {
|
||||
setTitle(config.APP_WINDOW_TITLE)
|
||||
windows.main.dispatch('resetTitle')
|
||||
}
|
||||
|
||||
@@ -115,8 +115,8 @@ function init () {
|
||||
})
|
||||
})
|
||||
|
||||
ipc.on('vlcPlay', function (e, url) {
|
||||
var args = ['--play-and-exit', '--video-on-top', '--no-video-title-show', '--quiet', url]
|
||||
ipc.on('vlcPlay', function (e, url, title) {
|
||||
var args = ['--play-and-exit', '--video-on-top', '--no-video-title-show', '--quiet', `--meta-title=${title}`, url]
|
||||
log('Running vlc ' + args.join(' '))
|
||||
|
||||
vlc.spawn(args, function (err, proc) {
|
||||
|
||||
@@ -43,7 +43,7 @@ module.exports = class MediaController {
|
||||
}
|
||||
|
||||
vlcPlay () {
|
||||
ipcRenderer.send('vlcPlay', this.state.server.localURL)
|
||||
ipcRenderer.send('vlcPlay', this.state.server.localURL, this.state.window.title)
|
||||
this.state.playing.location = 'vlc'
|
||||
}
|
||||
|
||||
|
||||
@@ -242,7 +242,7 @@ module.exports = class PlaybackController {
|
||||
}
|
||||
|
||||
// otherwise, play the video
|
||||
state.window.title = torrentSummary.files[state.playing.fileIndex].name
|
||||
dispatch('setTitle', torrentSummary.files[state.playing.fileIndex].name)
|
||||
this.update()
|
||||
|
||||
ipcRenderer.send('onPlayerOpen')
|
||||
@@ -274,7 +274,7 @@ module.exports = class PlaybackController {
|
||||
else console.error('Unknown state.playing.result', state.playing.result)
|
||||
|
||||
// Reset the window contents back to the home screen
|
||||
state.window.title = this.config.APP_WINDOW_TITLE
|
||||
dispatch('resetTitle')
|
||||
state.playing = State.getDefaultPlayState()
|
||||
state.server = null
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
const {dispatch} = require('../lib/dispatcher')
|
||||
const State = require('../lib/state')
|
||||
|
||||
// Controls the Preferences screen
|
||||
@@ -14,14 +15,14 @@ module.exports = class PrefsController {
|
||||
url: 'preferences',
|
||||
onbeforeload: function (cb) {
|
||||
// initialize preferences
|
||||
state.window.title = 'Preferences'
|
||||
dispatch('setTitle', 'Preferences')
|
||||
state.unsaved = Object.assign(state.unsaved || {}, {prefs: state.saved.prefs || {}})
|
||||
cb()
|
||||
},
|
||||
onbeforeunload: (cb) => {
|
||||
// save state after preferences
|
||||
this.save()
|
||||
state.window.title = this.config.APP_WINDOW_TITLE
|
||||
dispatch('resetTitle')
|
||||
cb()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -219,6 +219,7 @@ const dispatchHandlers = {
|
||||
'setDimensions': setDimensions,
|
||||
'toggleFullScreen': (setTo) => ipcRenderer.send('toggleFullScreen', setTo),
|
||||
'setTitle': (title) => { state.window.title = title },
|
||||
'resetTitle': () => { state.window.title = config.APP_WINDOW_TITLE },
|
||||
|
||||
// Everything else
|
||||
'onOpen': onOpen,
|
||||
|
||||
Reference in New Issue
Block a user