Merge branch 'external-player' of https://github.com/mathiasvr/webtorrent-desktop into mathiasvr-external-player

Fixed conflicts in the Preferences page, and added back passing the video title to VLC
This commit is contained in:
Feross Aboukhadijeh
2016-08-19 22:06:23 -07:00
9 changed files with 126 additions and 88 deletions

View File

@@ -22,12 +22,12 @@ module.exports = class MediaController {
if (state.location.url() === 'player') {
state.playing.result = 'error'
state.playing.location = 'error'
ipcRenderer.send('checkForVLC')
ipcRenderer.once('checkForVLC', function (e, isInstalled) {
ipcRenderer.send('checkForExternalPlayer', state.saved.prefs.externalPlayerPath)
ipcRenderer.once('checkForExternalPlayer', function (e, isInstalled) {
state.modal = {
id: 'unsupported-media-modal',
error: error,
vlcInstalled: isInstalled
externalPlayerInstalled: isInstalled
}
})
}
@@ -42,15 +42,16 @@ module.exports = class MediaController {
this.state.playing.mouseStationarySince = new Date().getTime()
}
vlcPlay () {
ipcRenderer.send('vlcPlay', this.state.server.localURL, this.state.window.title)
this.state.playing.location = 'vlc'
openExternalPlayer () {
var state = this.state
ipcRenderer.send('openExternalPlayer', state.saved.prefs.externalPlayerPath, state.server.localURL, state.window.title)
state.playing.location = 'external'
}
vlcNotFound () {
externalPlayerNotFound () {
var modal = this.state.modal
if (modal && modal.id === 'unsupported-media-modal') {
modal.vlcNotFound = true
modal.externalPlayerNotFound = true
}
}
}

View File

@@ -266,8 +266,8 @@ module.exports = class PlaybackController {
if (isCasting(state)) {
Cast.stop()
}
if (state.playing.location === 'vlc') {
ipcRenderer.send('vlcQuit')
if (state.playing.location === 'external') {
ipcRenderer.send('quitExternalPlayer')
}
// Save volume (this session only, not in state.saved)