rename video component to fileViewer

This commit is contained in:
btzr-io 2018-07-09 21:32:59 -06:00 committed by Sean Yesmunt
parent 180cb7b73e
commit 0f09210c5a
5 changed files with 15 additions and 10 deletions

View file

@ -17,7 +17,7 @@ import {
import { makeSelectClientSetting, selectShowNsfw } from 'redux/selectors/settings'; import { makeSelectClientSetting, selectShowNsfw } from 'redux/selectors/settings';
import { selectMediaPaused, makeSelectMediaPositionForUri } from 'redux/selectors/media'; import { selectMediaPaused, makeSelectMediaPositionForUri } from 'redux/selectors/media';
import { selectPlayingUri } from 'redux/selectors/content'; import { selectPlayingUri } from 'redux/selectors/content';
import Video from './view'; import FileViewer from './view';
const select = (state, props) => ({ const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state), claim: makeSelectClaimForUri(props.uri)(state),
@ -45,4 +45,7 @@ const perform = dispatch => ({
savePosition: (claimId, position) => dispatch(savePosition(claimId, position)), savePosition: (claimId, position) => dispatch(savePosition(claimId, position)),
}); });
export default connect(select, perform)(Video); export default connect(
select,
perform
)(FileViewer);

View file

@ -3,8 +3,8 @@ import React from 'react';
import classnames from 'classnames'; import classnames from 'classnames';
import type { Claim } from 'types/claim'; import type { Claim } from 'types/claim';
import LoadingScreen from 'component/common/loading-screen'; import LoadingScreen from 'component/common/loading-screen';
import VideoPlayer from './internal/player'; import Player from './internal/player';
import VideoPlayButton from './internal/play-button'; import PlayButton from './internal/play-button';
const SPACE_BAR_KEYCODE = 32; const SPACE_BAR_KEYCODE = 32;
@ -42,7 +42,7 @@ type Props = {
mediaType: string, mediaType: string,
}; };
class Video extends React.PureComponent<Props> { class FileViewer extends React.PureComponent<Props> {
constructor() { constructor() {
super(); super();
@ -156,7 +156,7 @@ class Video extends React.PureComponent<Props> {
<LoadingScreen status={loadStatusMessage} /> <LoadingScreen status={loadStatusMessage} />
</div> </div>
) : ( ) : (
<VideoPlayer <Player
filename={fileInfo.file_name} filename={fileInfo.file_name}
poster={poster} poster={poster}
downloadPath={fileInfo.download_path} downloadPath={fileInfo.download_path}
@ -183,7 +183,7 @@ class Video extends React.PureComponent<Props> {
className={layoverClass} className={layoverClass}
style={layoverStyle} style={layoverStyle}
> >
<VideoPlayButton <PlayButton
play={e => { play={e => {
e.stopPropagation(); e.stopPropagation();
this.playContent(); this.playContent();
@ -200,4 +200,4 @@ class Video extends React.PureComponent<Props> {
} }
} }
export default Video; export default FileViewer;

View file

@ -1,7 +1,7 @@
// @flow // @flow
import * as React from 'react'; import * as React from 'react';
import { buildURI, normalizeURI, MODALS } from 'lbry-redux'; import { buildURI, normalizeURI, MODALS } from 'lbry-redux';
import Video from 'component/video'; import FileViewer from 'component/fileViewer';
import Thumbnail from 'component/common/thumbnail'; import Thumbnail from 'component/common/thumbnail';
import FilePrice from 'component/filePrice'; import FilePrice from 'component/filePrice';
import FileDetails from 'component/fileDetails'; import FileDetails from 'component/fileDetails';
@ -167,7 +167,9 @@ class FilePage extends React.Component<Props> {
</section> </section>
) : ( ) : (
<section className="card"> <section className="card">
{showFile && <Video className="content__embedded" uri={uri} mediaType={mediaType} />} {showFile && (
<FileViewer className="content__embedded" uri={uri} mediaType={mediaType} />
)}
{!showFile && {!showFile &&
(thumbnail ? ( (thumbnail ? (
<Thumbnail shouldObscure={shouldObscureThumbnail} src={thumbnail} /> <Thumbnail shouldObscure={shouldObscureThumbnail} src={thumbnail} />