Commit 804717e0 authored by Baris Sencan's avatar Baris Sencan
Browse files

[Video] Define style in propTypes

parent af438045
Loading
Loading
Loading
Loading

Video.android.js

deleted100644 → 0
+0 −9
Changes for Video.android.js: 0 added lines, 9 removed lines.
Original line number Diff line number Diff line
'use strict';

var Video = {
  test: function() {
    console.warn("Not yet implemented for Android.");
  }
};

module.exports = Video;
+26 −27
Changes for Video.js: 26 added lines, 27 removed lines.
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ const {
  requireNativeComponent,
  PropTypes,
  NativeModules,
  View,
} = React;

const VideoResizeMode = require('./VideoResizeMode');
@@ -19,9 +20,6 @@ class Video extends Component {

  constructor(props, context) {
    super(props, context);

    this.state = { seekTime: 0 };

    this.seek = this.seek.bind(this);
    this._onLoadStart = this._onLoadStart.bind(this);
    this._onLoad = this._onLoad.bind(this);
@@ -39,6 +37,30 @@ class Video extends Component {
    this.setNativeProps({ seek: parseFloat(time) });
  }

  _onLoadStart(event) {
    this.props.onLoadStart && this.props.onLoadStart(event.nativeEvent);
  }

  _onLoad(event) {
    this.props.onLoad && this.props.onLoad(event.nativeEvent);
  }

  _onError(event) {
    this.props.onError && this.props.onError(event.nativeEvent);
  }

  _onProgress(event) {
    this.props.onProgress && this.props.onProgress(event.nativeEvent);
  }

  _onSeek(event) {
    this.props.onSeek && this.props.onSeek(event.nativeEvent);
  }

  _onEnd(event) {
    this.props.onEnd && this.props.onEnd(event.nativeEvent);
  }

  render() {
    const {
      style,
@@ -90,30 +112,6 @@ class Video extends Component {
        {...nativeProps} />
    );
  }

  _onLoadStart(event) {
    this.props.onLoadStart && this.props.onLoadStart(event.nativeEvent);
  }

  _onLoad(event) {
    this.props.onLoad && this.props.onLoad(event.nativeEvent);
  }

  _onError(event) {
    this.props.onError && this.props.onError(event.nativeEvent);
  }

  _onProgress(event) {
    this.props.onProgress && this.props.onProgress(event.nativeEvent);
  }

  _onSeek(event) {
    this.props.onSeek && this.props.onSeek(event.nativeEvent);
  }

  _onEnd(event) {
    this.props.onEnd && this.props.onEnd(event.nativeEvent);
  }
}

Video.propTypes = {
@@ -122,6 +120,7 @@ Video.propTypes = {
  seek: PropTypes.number,

  /* Wrapper component */
  style: View.propTypes.style,
  ref: PropTypes.string,
  source: PropTypes.object,
  resizeMode: PropTypes.string,