Fix chromecast button

Next step: Chromecast and Airplay play/pause, scrub, and state management

When casting, the correct cast button should be lit up and the video should be replaced with a title image and text
This commit is contained in:
DC
2016-03-14 09:52:28 -07:00
parent 8108c407d3
commit dd04b4ab62
3 changed files with 12 additions and 10 deletions

View File

@@ -64,7 +64,6 @@ function Player (state, dispatch) {
function renderPlayerControls (state, dispatch) {
var positionPercent = 100 * state.video.currentTime / state.video.duration
var playbackCursorStyle = { left: 'calc(' + positionPercent + '% - 8px)' }
var torrent = state.client.get(state.playing.infoHash)
var elements = [
hx`
@@ -88,7 +87,7 @@ function renderPlayerControls (state, dispatch) {
if (state.devices.chromecast) {
elements.push(hx`
<i.icon.chromecast
onclick=${() => dispatch('openChromecast', torrent)}>
onclick=${() => dispatch('openChromecast')}>
cast
</i>
`)
@@ -96,7 +95,7 @@ function renderPlayerControls (state, dispatch) {
if (state.devices.airplay) {
elements.push(hx`
<i.icon.airplay
onclick=${() => dispatch('openAirplay', torrent)}>
onclick=${() => dispatch('openAirplay')}>
airplay
</i>
`)

View File

@@ -54,7 +54,7 @@ function TorrentList (state, dispatch) {
// Show name, download status, % complete
function renderTorrentMetadata (torrent, torrentSummary) {
var name = torrentSummary.displayName || torrentSummary.name || 'Loading torrent...'
var name = torrentSummary.name || 'Loading torrent...'
var elements = [hx`
<div class='name ellipsis'>${name}</div>
`]