From 8505959c22e7385b3610749d16b1047ee293027b Mon Sep 17 00:00:00 2001 From: 6ea86b96 <6ea86b96@gmail.com> Date: Wed, 31 May 2017 21:36:38 +0400 Subject: [PATCH] Use render-media to render audio and images --- ui/js/component/fileActions/view.jsx | 2 ++ ui/js/component/video/index.js | 5 +++- ui/js/component/video/view.jsx | 40 ++++++++++++++++++++-------- ui/js/lbry.js | 2 +- ui/js/page/filePage/view.jsx | 3 ++- 5 files changed, 38 insertions(+), 14 deletions(-) diff --git a/ui/js/component/fileActions/view.jsx b/ui/js/component/fileActions/view.jsx index 6653bd236..604261376 100644 --- a/ui/js/component/fileActions/view.jsx +++ b/ui/js/component/fileActions/view.jsx @@ -73,6 +73,8 @@ class FileActions extends React.Component { let content + console.log(fileInfo) + if (downloading) { const diff --git a/ui/js/component/video/index.js b/ui/js/component/video/index.js index 423ff533a..e581f4bc6 100644 --- a/ui/js/component/video/index.js +++ b/ui/js/component/video/index.js @@ -13,7 +13,8 @@ import { doLoadVideo, } from 'actions/content' import { - makeSelectMetadataForUri + makeSelectMetadataForUri, + makeSelectContentTypeForUri, } from 'selectors/claims' import { makeSelectFileInfoForUri, @@ -32,6 +33,7 @@ const makeSelect = () => { const selectIsLoading = makeSelectLoadingForUri() const selectIsDownloading = makeSelectDownloadingForUri() const selectMetadata = makeSelectMetadataForUri() + const selectContentType = makeSelectContentTypeForUri() const select = (state, props) => ({ costInfo: selectCostInfo(state, props), @@ -40,6 +42,7 @@ const makeSelect = () => { modal: selectCurrentModal(state), isLoading: selectIsLoading(state, props), isDownloading: selectIsDownloading(state, props), + contentType: selectContentType(state, props), }) return select diff --git a/ui/js/component/video/view.jsx b/ui/js/component/video/view.jsx index d7a1f274f..723b92c62 100644 --- a/ui/js/component/video/view.jsx +++ b/ui/js/component/video/view.jsx @@ -2,6 +2,10 @@ import React from 'react'; import FilePrice from 'component/filePrice' import Link from 'component/link'; import Modal from 'component/modal'; +import lbry from 'lbry' +import { + Thumbnail, +} from 'component/common' class VideoPlayButton extends React.Component { onPurchaseConfirmed() { @@ -33,6 +37,7 @@ class VideoPlayButton extends React.Component { isLoading, costInfo, fileInfo, + mediaType, } = this.props /* @@ -44,13 +49,14 @@ class VideoPlayButton extends React.Component { */ const disabled = isLoading || fileInfo === undefined || (fileInfo === null && (!costInfo || costInfo.cost === undefined)) + const icon = mediaType == "image" ? "icon-folder-o" : "icon-play" return (