I want to change video poster and source VideoJS when selectedVideo changed
var VideoPlayer = React.createClass({
render: function() {
var selectedVideo = this.props.selectedVideo;
function filterVideo(video) {
return video.id == selectedVideo;
}
var data = this.props.videos.filter(filterVideo);
return (
<div className="col-md-6 videoplayer">
<h2>{data[0].title}</h2>
<video id="videoplayer" className="video-js vjs-default-skin vjs-big-play-centered" controls preload="none"
width="100%"
height="300"
poster={data[0].poster}
data-setup="{}">
<source src={data[0].video} type='video/mp4' />
</video>
<div className="video-description">
{data[0].description}
</div>
</div>
);
}
});
but i got error:
Uncaught Error: Invariant Violation: ReactMount: Two valid but unequal nodes with the same `data-reactid`: .0.0.1.1
title and description changed but video poster doesn't change