Resolve posterURL and torrentPath at runtime

Fixes bug where posters and torrent files can’t be found in the built
app.
This commit is contained in:
Feross Aboukhadijeh
2016-03-27 02:10:58 -07:00
parent 339f472473
commit eb59c11f85
5 changed files with 28 additions and 11 deletions

View File

@@ -4,6 +4,7 @@ var h = require('virtual-dom/h')
var hyperx = require('hyperx')
var hx = hyperx(h)
var util = require('../util')
// Shows a streaming video player. Standard features + Chromecast + Airplay
function Player (state, dispatch) {
@@ -153,7 +154,8 @@ function renderCastScreen (state, dispatch) {
function cssBackgroundImagePoster (state) {
var torrentSummary = getPlayingTorrentSummary(state)
if (!torrentSummary || !torrentSummary.posterURL) return ''
var cleanURL = torrentSummary.posterURL.replace(/\\/g, '/')
var posterURL = util.getAbsoluteStaticPath(torrentSummary.posterURL)
var cleanURL = posterURL.replace(/\\/g, '/')
return 'radial-gradient(circle at center, ' +
'rgba(0,0,0,0.4) 0%, rgba(0,0,0,1) 100%)' +
`, url(${cleanURL})`