[Video] Bind missing callbacks
Remove seek from state.
This commit is contained in:
parent
63a860e85f
commit
125b99deba
14
Video.js
14
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 */
|
||||
|
Loading…
Reference in New Issue
Block a user