Sync loading between file actions and video player
This commit is contained in:
parent
8505959c22
commit
912933d4e7
3 changed files with 5 additions and 4 deletions
|
@ -43,6 +43,7 @@ const makeSelect = () => {
|
||||||
const selectIsAvailableForUri = makeSelectIsAvailableForUri()
|
const selectIsAvailableForUri = makeSelectIsAvailableForUri()
|
||||||
const selectDownloadingForUri = makeSelectDownloadingForUri()
|
const selectDownloadingForUri = makeSelectDownloadingForUri()
|
||||||
const selectCostInfoForUri = makeSelectCostInfoForUri()
|
const selectCostInfoForUri = makeSelectCostInfoForUri()
|
||||||
|
const selectLoadingForUri = makeSelectLoadingForUri()
|
||||||
|
|
||||||
const select = (state, props) => ({
|
const select = (state, props) => ({
|
||||||
fileInfo: selectFileInfoForUri(state, props),
|
fileInfo: selectFileInfoForUri(state, props),
|
||||||
|
@ -51,6 +52,7 @@ const makeSelect = () => {
|
||||||
modal: selectCurrentModal(state),
|
modal: selectCurrentModal(state),
|
||||||
downloading: selectDownloadingForUri(state, props),
|
downloading: selectDownloadingForUri(state, props),
|
||||||
costInfo: selectCostInfoForUri(state, props),
|
costInfo: selectCostInfoForUri(state, props),
|
||||||
|
loading: selectLoadingForUri(state, props),
|
||||||
})
|
})
|
||||||
|
|
||||||
return select
|
return select
|
||||||
|
|
|
@ -63,6 +63,7 @@ class FileActions extends React.Component {
|
||||||
closeModal,
|
closeModal,
|
||||||
startDownload,
|
startDownload,
|
||||||
costInfo,
|
costInfo,
|
||||||
|
loading,
|
||||||
} = this.props
|
} = this.props
|
||||||
|
|
||||||
const deleteChecked = this.state.deleteChecked,
|
const deleteChecked = this.state.deleteChecked,
|
||||||
|
@ -73,9 +74,7 @@ class FileActions extends React.Component {
|
||||||
|
|
||||||
let content
|
let content
|
||||||
|
|
||||||
console.log(fileInfo)
|
if (loading || downloading) {
|
||||||
|
|
||||||
if (downloading) {
|
|
||||||
|
|
||||||
const
|
const
|
||||||
progress = (fileInfo && fileInfo.written_bytes) ? fileInfo.written_bytes / fileInfo.total_bytes * 100 : 0,
|
progress = (fileInfo && fileInfo.written_bytes) ? fileInfo.written_bytes / fileInfo.total_bytes * 100 : 0,
|
||||||
|
|
|
@ -126,7 +126,7 @@ class Video extends React.Component {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={klassName}>{
|
<div className={klassName}>{
|
||||||
isPlaying || isLoading ?
|
isPlaying ?
|
||||||
(!isReadyToPlay ?
|
(!isReadyToPlay ?
|
||||||
<span>this is the world's worst loading screen and we shipped our software with it anyway... <br /><br />{loadStatusMessage}</span> :
|
<span>this is the world's worst loading screen and we shipped our software with it anyway... <br /><br />{loadStatusMessage}</span> :
|
||||||
<VideoPlayer filename={fileInfo.file_name} poster={poster} downloadPath={fileInfo.download_path} mediaType={mediaType} poster={poster} />) :
|
<VideoPlayer filename={fileInfo.file_name} poster={poster} downloadPath={fileInfo.download_path} mediaType={mediaType} poster={poster} />) :
|
||||||
|
|
Loading…
Add table
Reference in a new issue