From 125b99debadd2ef4b18daa536699ee7b547db4dc Mon Sep 17 00:00:00 2001 From: Baris Sencan Date: Wed, 11 Nov 2015 13:34:41 -0800 Subject: [PATCH] [Video] Bind missing callbacks Remove seek from state. --- Video.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Video.js b/Video.js index fcbc3a66..6caecad4 100644 --- a/Video.js +++ b/Video.js @@ -35,8 +35,11 @@ class Video extends Component { this._root.setNativeProps(nativeProps); } + seek(time) { + this.setNativeProps({ seek: parseFloat(time) }); + } + render() { - const { seekTime } = this.state; const { style, source, @@ -73,9 +76,11 @@ class Video extends Component { isAsset, type: source.type || 'mp4', }, - seek: seekTime, + onVideoLoadStart: this._onLoadStart, onVideoLoad: this._onLoad, + onVideoError: this._onError, onVideoProgress: this._onProgress, + onVideoSeek: this._onSeek, onVideoEnd: this._onEnd, }); @@ -86,10 +91,6 @@ class Video extends Component { ); } - seek(time) { - this.setState({ seekTime: time }); - } - _onLoadStart(event) { this.props.onLoadStart && this.props.onLoadStart(event.nativeEvent); } @@ -133,6 +134,7 @@ Video.propTypes = { onLoad: PropTypes.func, onError: PropTypes.func, onProgress: PropTypes.func, + onSeek: PropTypes.func, onEnd: PropTypes.func, /* Required by react-native */