var PLAYER_ID = 'player';
var Player = React.createClass({
componentDidMount: function() {
document.getElementById(PLAYER_ID).addEventListener( 'ended', this.props.onEnded )
},
componentWillUnmount: function() {
document.getElementById(PLAYER_ID).removeEventListener( 'ended', this.props.onEnded )
},
render: function () {
return (
<video
id={PLAYER_ID}
src={this.props.src}
</video>
)
}
});
var PlayerContainer = React.createClass({
onEnded: function () {
alert("onEnded")
},
render: function() {
return <Player
src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"
onEnded={this.onEnded}/>
}
});
React.render(
<PlayerContainer />,
document.body
);
for (var i = 0; i < TOTAL_PAINTING; i++) {
if (m2.length == 0){
m2.push(m[i][0]);
m2.push(m[i][1]);
m2.push(m[i][2]);
}
else {
var status = true;
var price = 0;
for (var j = 0; j < m2.length; j++) {
if (m2[j] == m[i][0]) {
for (var g = m2.length; g >= 0; g--) {
if (m2[g] == m[i][0]){
m2[j+1] = m2[j+1] + m[i][1]
m2[j+2] = m2[j+2] + m[i][2]
}
}
status = false;
}
}
if (status == true){
m2.push(m[i][0]);
m2.push(m[i][1]);
m2.push(m[i][2]);
}
}
}