Commit 125b99de authored by Baris Sencan's avatar Baris Sencan
Browse files

[Video] Bind missing callbacks

Remove seek from state.
parent 63a860e8
Loading
Loading
Loading
Loading
+8 −6
Changes for Video.js: 8 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -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 */