lbry-desktop/ui/util/web.js
jessop e3c2919373 rename lbrytv to web
language and API consts

improve customization
custom homepages
get config from .env.default
custom title and logo

small changes

add pinned item to sidebar

rebase?
2020-05-25 17:21:02 -04:00

24 lines
845 B
JavaScript

const { URL, LBRY_WEB_STREAMING_API } = require('../../config');
const CONTINENT_COOKIE = 'continent';
function generateStreamUrl(claimName, claimId) {
return `${LBRY_WEB_STREAMING_API}/content/claims/${claimName}/${claimId}/stream`;
}
function generateEmbedUrl(claimName, claimId, includeStartTime, startTime) {
const queryParam = includeStartTime ? `?t=${startTime}` : '';
return `${URL}/$/embed/${claimName}/${claimId}${queryParam}`;
}
function generateDownloadUrl(claimName, claimId) {
return `${URL}/$/download/${claimName}/${claimId}`;
}
function generateDirectUrl(claimName, claimId) {
return `${URL}/$/stream/${claimName}/${claimId}`;
}
// module.exports needed since the web server imports this function
module.exports = { generateStreamUrl, generateEmbedUrl, generateDownloadUrl, generateDirectUrl, CONTINENT_COOKIE };