Youtube VideoPreview with correct video duration formatting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*...*/ | |
import {getVideoDurationString} from '../../services/date/date-format'; | |
export class VideoPreview extends React.Component { | |
render() { | |
/* ... */ | |
const duration = video.contentDetails ? video.contentDetails.duration : null; | |
const videoDuration = getVideoDurationString(duration); | |
const viewAndTimeString = VideoPreview.getFormattedViewAndTime(video); | |
const horizontal = this.props.horizontal ? 'horizontal' : null; | |
return ( | |
{/*...*/} | |
<div className='time-label'> | |
<span>{videoDuration}</span> | |
</div> | |
{/*... */} | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment