display the video duration in the FileItemMedia component #27
1 changed files with 7 additions and 1 deletions
|
@ -658,6 +658,7 @@ class FilePage extends React.PureComponent {
|
||||||
const canLoadMedia =
|
const canLoadMedia =
|
||||||
this.state.streamingMode ||
|
this.state.streamingMode ||
|
||||||
(fileInfo && (fileInfo.written_bytes >= 2097152 || fileInfo.written_bytes === fileInfo.total_bytes)); // 2MB = 1024*1024*2
|
(fileInfo && (fileInfo.written_bytes >= 2097152 || fileInfo.written_bytes === fileInfo.total_bytes)); // 2MB = 1024*1024*2
|
||||||
|
const duration = claim && claim.value && claim.value.video ? claim.value.video.duration : null;
|
||||||
const isViewable = mediaType === 'image' || mediaType === 'text';
|
const isViewable = mediaType === 'image' || mediaType === 'text';
|
||||||
const isWebViewable = mediaType === 'text';
|
const isWebViewable = mediaType === 'text';
|
||||||
const canOpen = isViewable && completed;
|
const canOpen = isViewable && completed;
|
||||||
|
@ -725,7 +726,12 @@ class FilePage extends React.PureComponent {
|
||||||
>
|
>
|
||||||
<View style={filePageStyle.mediaContainer}>
|
<View style={filePageStyle.mediaContainer}>
|
||||||
{(canOpen || (!fileInfo || (isPlayable && !canLoadMedia)) || (!canOpen && fileInfo)) && (
|
{(canOpen || (!fileInfo || (isPlayable && !canLoadMedia)) || (!canOpen && fileInfo)) && (
|
||||||
<FileItemMedia style={filePageStyle.thumbnail} title={title} thumbnail={thumbnail} />
|
<FileItemMedia
|
||||||
|
duration={duration}
|
||||||
|
style={filePageStyle.thumbnail}
|
||||||
|
title={title}
|
||||||
|
thumbnail={thumbnail}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
{(!this.state.downloadButtonShown || this.state.downloadPressed) && !this.state.mediaLoaded && (
|
{(!this.state.downloadButtonShown || this.state.downloadPressed) && !this.state.mediaLoaded && (
|
||||||
<ActivityIndicator size="large" color={Colors.NextLbryGreen} style={filePageStyle.loading} />
|
<ActivityIndicator size="large" color={Colors.NextLbryGreen} style={filePageStyle.loading} />
|
||||||
|
|
Loading…
Reference in a new issue