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
state.devices.castMenu = null
state.playing.castName = devices[index].name
state.playing.location = location + '-pending'
update()
}

View File

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

View File

@@ -280,8 +280,10 @@ function renderCastScreen (state) {
}
var isStarting = state.playing.location.endsWith('-pending')
var castName = state.playing.castName
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 = ''
// Show a nice title image, if possible