From e1dd28fff6ba2cfb1ae5d05e34b626c4a2939d23 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 24 Jan 2020 11:25:31 -0500 Subject: [PATCH] use new player api for streaming --- config.js | 1 + lbrytv/src/routes.js | 5 ++--- ui/effects/use-get-thumbnail.js | 4 ++-- ui/util/lbrytv.js | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) 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`; }