I have created a react component to play videos. The component is playing video just fine but the callback is not being fired.
class VideoPlayer extends React.Component {
componentWillMount () {
console.log('Mounting here');
}
changeThis () {
console.log("Ended");
}
render () {
var notice = this.props.notice;
var p = "./data/video/" + notice.path + '?' + Math.random();
return (
<div key={notice.id}>
<video className="image" alt={notice.description} onEnded={this.changeThis.bind(this)} controls autoPlay>
<source src={p} type="video/mp4" />
No suppoty
</video>
</div>
)
}
}
The onEnded function is not being called. What am I doing wrong.