Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
37
rated 0 times [  42] [ 5]  / answers: 1 / hits: 20851  / 9 Years ago, wed, september 2, 2015, 12:00:00

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.


More From » reactjs

 Answers
10

ReactJS (0.14.0-rc1) now supports media events (video and audio):
https://facebook.github.io/react/blog/2015/09/10/react-v0.14-rc1.html



I've tested onEnded and onTimeUpdate - works great!


[#65213] Monday, August 31, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dillionsalvadorg

Total Points: 288
Total Questions: 103
Total Answers: 75

Location: South Korea
Member since Sat, Oct 2, 2021
3 Years ago
;