Fix empty subtitle error in the download button

This commit is contained in:
Grégoire Delattre 2017-06-03 15:57:57 +02:00
parent 72c7814239
commit daae180410

View File

@ -71,11 +71,13 @@ class Player extends React.PureComponent {
super(props);
}
render() {
const subtitles = this.props.subtitles;
const hasSubtitles = (subtitles !== undefined && subtitles !== null);
return (
<div className="embed-responsive embed-responsive-16by9">
<video controls>
<source src={this.props.url} type="video/mp4"/>
{this.props.subtitles !== undefined && this.props.subtitles.toIndexedSeq().map(function(el, index) {
{hasSubtitles && subtitles.toIndexedSeq().map(function(el, index) {
return (
<track
key={index}