[Video] Define style in propTypes

This commit is contained in:
Baris Sencan 2015-11-17 19:15:07 -08:00
parent af438045c9
commit 804717e072
2 changed files with 26 additions and 36 deletions

View File

@ -1,9 +0,0 @@
'use strict';
var Video = {
test: function() {
console.warn("Not yet implemented for Android.");
}
};
module.exports = Video;

View File

@ -5,6 +5,7 @@ const {
requireNativeComponent, requireNativeComponent,
PropTypes, PropTypes,
NativeModules, NativeModules,
View,
} = React; } = React;
const VideoResizeMode = require('./VideoResizeMode'); const VideoResizeMode = require('./VideoResizeMode');
@ -19,9 +20,6 @@ class Video extends Component {
constructor(props, context) { constructor(props, context) {
super(props, context); super(props, context);
this.state = { seekTime: 0 };
this.seek = this.seek.bind(this); this.seek = this.seek.bind(this);
this._onLoadStart = this._onLoadStart.bind(this); this._onLoadStart = this._onLoadStart.bind(this);
this._onLoad = this._onLoad.bind(this); this._onLoad = this._onLoad.bind(this);
@ -39,6 +37,30 @@ class Video extends Component {
this.setNativeProps({ seek: parseFloat(time) }); 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() { render() {
const { const {
style, style,
@ -90,30 +112,6 @@ class Video extends Component {
{...nativeProps} /> {...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 = { Video.propTypes = {
@ -122,6 +120,7 @@ Video.propTypes = {
seek: PropTypes.number, seek: PropTypes.number,
/* Wrapper component */ /* Wrapper component */
style: View.propTypes.style,
ref: PropTypes.string, ref: PropTypes.string,
source: PropTypes.object, source: PropTypes.object,
resizeMode: PropTypes.string, resizeMode: PropTypes.string,