add chromecast/airplay support

This commit is contained in:
Feross Aboukhadijeh
2016-03-02 04:14:17 -08:00
parent 39b46e126f
commit c1e2b9ec5c
4 changed files with 121 additions and 24 deletions

View File

@@ -3,10 +3,10 @@ module.exports = App
var h = require('virtual-dom/h')
function App (state, handler) {
if (state.player) {
if (state.player === 'local') {
return h('.player', [
h('video', {
src: state.player.url,
src: state.server.localURL,
autoplay: true,
controls: true
}),
@@ -34,15 +34,39 @@ function App (state, handler) {
})()
])
]),
h('a.play', {
h('a.btn.play', {
className: !torrent.ready ? 'disabled' : '',
onclick: openPlayer
}, '▶')
}, '▶'),
(function () {
if (state.chromecast) {
return h('a.btn.chromecast', {
className: !torrent.ready ? 'disabled' : '',
onclick: openChromecast
}, 'C')
}
})(),
(function () {
if (state.airplay) {
return h('a.btn.airplay', {
className: !torrent.ready ? 'disabled' : '',
onclick: openAirplay
}, 'A')
}
})()
])
function openPlayer () {
handler('openPlayer', torrent)
}
function openChromecast () {
handler('openChromecast', torrent)
}
function openAirplay () {
handler('openAirplay', torrent)
}
})
return h('.app', [
h('.torrent-list', list),