From 078c00173114da0e6bf4a6aead226cd6549dc923 Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Tue, 19 Mar 2019 02:32:53 -0400 Subject: [PATCH] Fix unavailable content take 2 --- src/ui/component/fileRender/view.jsx | 23 ++++++++++++------- .../component/fileViewer/internal/player.jsx | 11 +-------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/ui/component/fileRender/view.jsx b/src/ui/component/fileRender/view.jsx index 50d41ec88..25fb87385 100644 --- a/src/ui/component/fileRender/view.jsx +++ b/src/ui/component/fileRender/view.jsx @@ -107,14 +107,14 @@ class FileRender extends React.PureComponent { application: !source.url ? null : ( this.processSandboxRef(element)} - title='' - sandbox='allow-scripts allow-forms allow-pointer-lock' + title="" + sandbox="allow-scripts allow-forms allow-pointer-lock" src={source.url} - autosize='on' + autosize="on" style={{ border: 0, width: '100%', height: '100%' }} - useragent='Mozilla/5.0 AppleWebKit/537 Chrome/60 Safari/537' - enableremotemodule='false' - webpreferences='sandbox=true,contextIsolation=true,webviewTag=false,enableRemoteModule=false,devTools=false' + useragent="Mozilla/5.0 AppleWebKit/537 Chrome/60 Safari/537" + enableremotemodule="false" + webpreferences="sandbox=true,contextIsolation=true,webviewTag=false,enableRemoteModule=false,devTools=false" /> ), video: ( @@ -150,7 +150,14 @@ class FileRender extends React.PureComponent { if (!viewer && readableFiles.includes(mediaType)) { viewer = ; } - + // temp workaround + if (claim && claim.value.stream.metadata.fee && claim.value.stream.metadata.fee.amount > 0) { + const paidMessage = __( + 'Currently, only free content is available on lbry.tv. Try viewing it in the desktop app.' + ); + const paid = ; + return paid; + } // Message Error const unsupportedMessage = __("Sorry, looks like we can't preview this file."); const unsupported = ; @@ -160,7 +167,7 @@ class FileRender extends React.PureComponent { } render() { - return
{this.renderViewer()}
; + return
{this.renderViewer()}
; } } diff --git a/src/ui/component/fileViewer/internal/player.jsx b/src/ui/component/fileViewer/internal/player.jsx index 6d836f689..3fd51c2dd 100644 --- a/src/ui/component/fileViewer/internal/player.jsx +++ b/src/ui/component/fileViewer/internal/player.jsx @@ -287,17 +287,8 @@ class MediaPlayer extends React.PureComponent { } showLoadingScreen(isFileType: boolean, isPlayableType: boolean) { - const { claim, mediaType, contentType } = this.props; + const { mediaType, contentType } = this.props; const { unplayable, fileSource, hasMetadata } = this.state; - - if (claim && claim.value.stream.metadata.fee && claim.value.stream.metadata.fee.amount > 0) { - return { - isLoading: false, - loadingStatus: __( - 'Currently, only free content is available on lbry.tv. Try viewing it in the desktop app.' - ), - }; - } if (['audio', 'video'].indexOf(mediaType) === -1) { return {