2020-01-24 11:25:31 -05:00
|
|
|
const { URL, LBRY_TV_STREAMING_API } = require('../../config');
|
2019-12-16 12:44:31 -05:00
|
|
|
|
2019-10-29 12:23:56 -04:00
|
|
|
function generateStreamUrl(claimName, claimId, apiUrl) {
|
2020-01-24 11:25:31 -05:00
|
|
|
const prefix = LBRY_TV_STREAMING_API || apiUrl;
|
2019-10-21 10:50:34 -04:00
|
|
|
return `${prefix}/content/claims/${claimName}/${claimId}/stream`;
|
|
|
|
}
|
2019-10-22 10:40:57 -04:00
|
|
|
|
2019-12-16 12:44:31 -05:00
|
|
|
function generateEmbedUrl(claimName, claimId) {
|
2019-12-20 11:26:55 -05:00
|
|
|
return `${URL}/$/embed/${claimName}/${claimId}`;
|
2019-12-16 12:44:31 -05:00
|
|
|
}
|
|
|
|
|
2020-01-07 13:17:43 -05:00
|
|
|
function generateDownloadUrl(claimName, claimId, apiUrl) {
|
|
|
|
const streamUrl = generateStreamUrl(claimName, claimId, apiUrl);
|
|
|
|
return `${streamUrl}?download=1`;
|
|
|
|
}
|
|
|
|
|
2019-11-07 14:39:22 -05:00
|
|
|
// module.exports needed since the web server imports this function
|
2020-01-07 13:17:43 -05:00
|
|
|
module.exports = { generateStreamUrl, generateEmbedUrl, generateDownloadUrl };
|