diff --git a/config.js b/config.js index e3f1ef76e..160073043 100644 --- a/config.js +++ b/config.js @@ -6,6 +6,7 @@ const config = { URL: 'https://lbry.tv', SITE_TITLE: 'lbry.tv', LBRY_TV_API: 'https://api.lbry.tv', + LBRY_TV_STREAMING_API: 'https://player.lbry.tv', }; config.URL_LOCAL = `http://localhost:${config.WEB_SERVER_PORT}`; diff --git a/lbrytv/src/routes.js b/lbrytv/src/routes.js index 2727b592a..12b1eda0e 100644 --- a/lbrytv/src/routes.js +++ b/lbrytv/src/routes.js @@ -1,6 +1,5 @@ const { getHtml } = require('./html'); const { generateStreamUrl, generateDownloadUrl } = require('../../ui/util/lbrytv'); -const { LBRY_TV_API } = require('../../config'); const Router = require('@koa/router'); const send = require('koa-send'); @@ -8,13 +7,13 @@ const router = new Router(); router.get(`/$/embed/:claimName/:claimId`, async ctx => { const { claimName, claimId } = ctx.params; - const streamUrl = generateStreamUrl(claimName, claimId, LBRY_TV_API); + const streamUrl = generateStreamUrl(claimName, claimId); ctx.redirect(streamUrl); }); router.get(`/$/download/:claimName/:claimId`, async ctx => { const { claimName, claimId } = ctx.params; - const downloadUrl = generateDownloadUrl(claimName, claimId, LBRY_TV_API); + const downloadUrl = generateDownloadUrl(claimName, claimId); ctx.redirect(downloadUrl); }); diff --git a/ui/effects/use-get-thumbnail.js b/ui/effects/use-get-thumbnail.js index d3f4aabd7..746ccf71b 100644 --- a/ui/effects/use-get-thumbnail.js +++ b/ui/effects/use-get-thumbnail.js @@ -9,7 +9,7 @@ export default function useGetThumbnail( getFile: string => void, shouldHide: boolean ) { - const hasClaim = claim !== undefined; + // const hasClaim = claim !== undefined; // $FlowFixMe const isImage = claim && claim.value && claim.value.stream_type === 'image'; @@ -19,7 +19,7 @@ export default function useGetThumbnail( // @if TARGET='web' if (claim && isImage && isFree) { - thumbnailToUse = generateStreamUrl(claim.name, claim.claim_id, 'https://api.lbry.tv'); + thumbnailToUse = generateStreamUrl(claim.name, claim.claim_id); } // @endif diff --git a/ui/util/lbrytv.js b/ui/util/lbrytv.js index ffa49d0f5..f2e0387a5 100644 --- a/ui/util/lbrytv.js +++ b/ui/util/lbrytv.js @@ -1,7 +1,7 @@ -const { URL } = require('../../config'); +const { URL, LBRY_TV_STREAMING_API } = require('../../config'); function generateStreamUrl(claimName, claimId, apiUrl) { - const prefix = process.env.SDK_API_URL || apiUrl; + const prefix = LBRY_TV_STREAMING_API || apiUrl; return `${prefix}/content/claims/${claimName}/${claimId}/stream`; }