Show which cast device you're connected to

This commit is contained in:
DC
2016-06-23 06:48:04 -07:00
parent 0af6007632
commit 7526b18507
3 changed files with 7 additions and 2 deletions

View File

@@ -371,6 +371,7 @@ function selectDevice (index) {
// Show the Connecting... screen // Show the Connecting... screen
state.devices.castMenu = null state.devices.castMenu = null
state.playing.castName = devices[index].name
state.playing.location = location + '-pending' state.playing.location = location + '-pending'
update() update()
} }

View File

@@ -1068,9 +1068,11 @@ function openPlayerFromActiveTorrent (torrentSummary, index, timeout, cb) {
} }
function closePlayer (cb) { function closePlayer (cb) {
console.log('closePlayer')
// Quit any external players, like Chromecast/Airplay/etc or VLC // Quit any external players, like Chromecast/Airplay/etc or VLC
if (isCasting()) { if (isCasting()) {
Cast.close() Cast.stop()
} }
if (state.playing.location === 'vlc') { if (state.playing.location === 'vlc') {
ipcRenderer.send('vlcQuit') ipcRenderer.send('vlcQuit')

View File

@@ -280,8 +280,10 @@ function renderCastScreen (state) {
} }
var isStarting = state.playing.location.endsWith('-pending') var isStarting = state.playing.location.endsWith('-pending')
var castName = state.playing.castName
var castStatus var castStatus
if (isCast) castStatus = isStarting ? 'Connecting...' : 'Connected' if (isCast && isStarting) castStatus = 'Connecting to ' + castName + '...'
else if (isCast && !isStarting) castStatus = 'Connected to ' + castName
else castStatus = '' else castStatus = ''
// Show a nice title image, if possible // Show a nice title image, if possible