Sync loading between file actions and video player

This commit is contained in:
6ea86b96 2017-06-02 14:40:40 +07:00
parent 8505959c22
commit 912933d4e7
No known key found for this signature in database
GPG key ID: B282D183E4931E8F
3 changed files with 5 additions and 4 deletions

View file

@ -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

View file

@ -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,

View file

@ -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} />) :