E// import axios from 'axios';
import React from 'react';
import BaseResource from '../resources/base-resource';
import { getVastDurationInMillis } from '../helpers/duration';
class NonLinear extends React.Components {
constructor(props) {
super(props);
this.durationMillis = getVastDurationInMillis(this.props.duration);
}
onStartedTracking() {
}
onCompletedTracking() {
}
componentDidMount() {
this.onStartedTracking();
setTimeout((e) => {
this.onCompletedTracking();
this.props.onEnded(e);
}, this.durationMillis);
}
render() {
return (
<BaseResource
baseResource={this.props.nonLinear}
height={this.props.height}
width={this.props.width}
/>
);
}
}
NonLinear.propTypes = {
tracking: React.PropTypes.object,
onEnded: React.PropTypes.func,
nonLinear: React.PropTypes.object,
height: React.PropTypes.number,
width: React.PropTypes.number,
duration: React.PropTypes.string,
};
export default NonLinear;
|