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 selectDownloadingForUri = makeSelectDownloadingForUri()
|
||||
const selectCostInfoForUri = makeSelectCostInfoForUri()
|
||||
const selectLoadingForUri = makeSelectLoadingForUri()
|
||||
|
||||
const select = (state, props) => ({
|
||||
fileInfo: selectFileInfoForUri(state, props),
|
||||
|
@ -51,6 +52,7 @@ const makeSelect = () => {
|
|||
modal: selectCurrentModal(state),
|
||||
downloading: selectDownloadingForUri(state, props),
|
||||
costInfo: selectCostInfoForUri(state, props),
|
||||
loading: selectLoadingForUri(state, props),
|
||||
})
|
||||
|
||||
return select
|
||||
|
|
|
@ -63,6 +63,7 @@ class FileActions extends React.Component {
|
|||
closeModal,
|
||||
startDownload,
|
||||
costInfo,
|
||||
loading,
|
||||
} = this.props
|
||||
|
||||
const deleteChecked = this.state.deleteChecked,
|
||||
|
@ -73,9 +74,7 @@ class FileActions extends React.Component {
|
|||
|
||||
let content
|
||||
|
||||
console.log(fileInfo)
|
||||
|
||||
if (downloading) {
|
||||
if (loading || downloading) {
|
||||
|
||||
const
|
||||
progress = (fileInfo && fileInfo.written_bytes) ? fileInfo.written_bytes / fileInfo.total_bytes * 100 : 0,
|
||||
|
|
|
@ -126,7 +126,7 @@ class Video extends React.Component {
|
|||
|
||||
return (
|
||||
<div className={klassName}>{
|
||||
isPlaying || isLoading ?
|
||||
isPlaying ?
|
||||
(!isReadyToPlay ?
|
||||
<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} />) :
|
||||
|
|
Loading…
Add table
Reference in a new issue