display the video duration in the FileItemMedia component ()

This commit is contained in:
Akinwale Ariwodola 2019-08-20 09:03:55 +01:00 committed by GitHub
commit a2ee73e23e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 107 additions and 10 deletions
src/component/fileListItem

View file

@ -80,6 +80,7 @@ class FileListItem extends React.PureComponent {
const uri = normalizeURI(this.props.uri);
const obscure = obscureNsfw && nsfw;
const isResolving = !fileInfo && isResolvingUri;
const duration = claim && claim.value && claim.value.video ? claim.value.video.duration : null;
let name, channel, height, channelClaimId, fullChannelUri, shortChannelUri, shouldHide, signingChannel;
if (claim) {
@ -110,6 +111,7 @@ class FileListItem extends React.PureComponent {
<FileItemMedia
style={fileListStyle.thumbnail}
blurRadius={obscure ? 15 : 0}
duration={duration}
resizeMode="cover"
title={title || name}
thumbnail={thumbnail}