[Video] Bind missing callbacks

Remove seek from state.
This commit is contained in:
Baris Sencan 2015-11-11 13:34:41 -08:00
parent 63a860e85f
commit 125b99deba

View File

@ -35,8 +35,11 @@ class Video extends Component {
this._root.setNativeProps(nativeProps); this._root.setNativeProps(nativeProps);
} }
seek(time) {
this.setNativeProps({ seek: parseFloat(time) });
}
render() { render() {
const { seekTime } = this.state;
const { const {
style, style,
source, source,
@ -73,9 +76,11 @@ class Video extends Component {
isAsset, isAsset,
type: source.type || 'mp4', type: source.type || 'mp4',
}, },
seek: seekTime, onVideoLoadStart: this._onLoadStart,
onVideoLoad: this._onLoad, onVideoLoad: this._onLoad,
onVideoError: this._onError,
onVideoProgress: this._onProgress, onVideoProgress: this._onProgress,
onVideoSeek: this._onSeek,
onVideoEnd: this._onEnd, onVideoEnd: this._onEnd,
}); });
@ -86,10 +91,6 @@ class Video extends Component {
); );
} }
seek(time) {
this.setState({ seekTime: time });
}
_onLoadStart(event) { _onLoadStart(event) {
this.props.onLoadStart && this.props.onLoadStart(event.nativeEvent); this.props.onLoadStart && this.props.onLoadStart(event.nativeEvent);
} }
@ -133,6 +134,7 @@ Video.propTypes = {
onLoad: PropTypes.func, onLoad: PropTypes.func,
onError: PropTypes.func, onError: PropTypes.func,
onProgress: PropTypes.func, onProgress: PropTypes.func,
onSeek: PropTypes.func,
onEnd: PropTypes.func, onEnd: PropTypes.func,
/* Required by react-native */ /* Required by react-native */