Fix imports and bump sample project to 0.8.0
This commit is contained in:
parent
e832d3860a
commit
db402be640
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@ Examples/VideoPlayer/node_modules/**/*
|
||||
Examples/VideoPlayer/VideoPlayer.xcodeproj/project.xcworkspace/**/*
|
||||
Examples/VideoPlayer/VideoPlayer.xcodeproj/xcuserdata/**/*
|
||||
npm-debug.log
|
||||
.DS_Store
|
||||
|
@ -25,10 +25,10 @@
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
134814201AA4EA6300B7C361 /* libRCTVideo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTVideo.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
BBD49E391AC8DEF000610F8E /* RCTVideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ../../../../RCTVideo.h; sourceTree = "<group>"; };
|
||||
BBD49E3A1AC8DEF000610F8E /* RCTVideo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ../../../../RCTVideo.m; sourceTree = "<group>"; };
|
||||
BBD49E3B1AC8DEF000610F8E /* RCTVideoManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ../../../../RCTVideoManager.h; sourceTree = "<group>"; };
|
||||
BBD49E3C1AC8DEF000610F8E /* RCTVideoManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ../../../../RCTVideoManager.m; sourceTree = "<group>"; };
|
||||
BBD49E391AC8DEF000610F8E /* RCTVideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTVideo.h; sourceTree = "<group>"; };
|
||||
BBD49E3A1AC8DEF000610F8E /* RCTVideo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTVideo.m; sourceTree = "<group>"; };
|
||||
BBD49E3B1AC8DEF000610F8E /* RCTVideoManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTVideoManager.h; sourceTree = "<group>"; };
|
||||
BBD49E3C1AC8DEF000610F8E /* RCTVideoManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTVideoManager.m; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
|
@ -6,7 +6,7 @@
|
||||
"start": "node_modules/react-native/packager/packager.sh"
|
||||
},
|
||||
"dependencies": {
|
||||
"react-native": "^0.4.4",
|
||||
"react-native-video": "^0.4.1"
|
||||
"react-native": "0.8.0",
|
||||
"react-native-video": "0.5.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
var warning = require('warning');
|
||||
|
||||
var Video = {
|
||||
test: function() {
|
||||
warning("Not yet implemented for Android.");
|
||||
console.warn("Not yet implemented for Android.");
|
||||
}
|
||||
};
|
||||
|
||||
|
26
Video.ios.js
26
Video.ios.js
@ -1,16 +1,10 @@
|
||||
var React = require('react-native');
|
||||
var { requireNativeComponent, } = React;
|
||||
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
|
||||
var NativeModules = require('NativeModules');
|
||||
var StyleSheet = require('StyleSheet');
|
||||
var PropTypes = require('ReactPropTypes');
|
||||
var StyleSheetPropType = require('StyleSheetPropType');
|
||||
var { StyleSheet, requireNativeComponent, PropTypes, NativeModules, } = React;
|
||||
|
||||
var VideoResizeMode = require('./VideoResizeMode');
|
||||
var VideoStylePropTypes = require('./VideoStylePropTypes');
|
||||
var NativeMethodsMixin = require('NativeMethodsMixin');
|
||||
var flattenStyle = require('flattenStyle');
|
||||
var merge = require('merge');
|
||||
var deepDiffer = require('deepDiffer');
|
||||
|
||||
var VIDEO_REF = 'video';
|
||||
|
||||
var Video = React.createClass({
|
||||
propTypes: {
|
||||
@ -19,7 +13,6 @@ var Video = React.createClass({
|
||||
seek: PropTypes.number,
|
||||
|
||||
/* Wrapper component */
|
||||
style: StyleSheetPropType(VideoStylePropTypes),
|
||||
source: PropTypes.object,
|
||||
resizeMode: PropTypes.string,
|
||||
repeat: PropTypes.bool,
|
||||
@ -34,11 +27,8 @@ var Video = React.createClass({
|
||||
onEnd: PropTypes.func,
|
||||
},
|
||||
|
||||
mixins: [NativeMethodsMixin],
|
||||
|
||||
viewConfig: {
|
||||
uiViewClassName: 'UIView',
|
||||
validAttributes: ReactNativeViewAttributes.UIView
|
||||
setNativeProps(props) {
|
||||
this.refs[VIDEO_REF].setNativeProps(props);
|
||||
},
|
||||
|
||||
_onLoadStart(event) {
|
||||
@ -70,7 +60,7 @@ var Video = React.createClass({
|
||||
},
|
||||
|
||||
render() {
|
||||
var style = flattenStyle([styles.base, this.props.style]);
|
||||
var style = [styles.base, this.props.style];
|
||||
var source = this.props.source;
|
||||
var uri = source.uri;
|
||||
if (uri && uri.match(/^\//)) {
|
||||
@ -104,7 +94,7 @@ var Video = React.createClass({
|
||||
onVideoEnd: this._onEnd,
|
||||
});
|
||||
|
||||
return <RCTVideo {... nativeProps} />;
|
||||
return <RCTVideo ref={VIDEO_REF} {... nativeProps} />;
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var keyMirror = require('keyMirror');
|
||||
var keyMirror = require('keymirror');
|
||||
|
||||
var VideoResizeMode = keyMirror({
|
||||
contain: null,
|
||||
|
@ -1,11 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var VideoResizeMode = require('./VideoResizeMode');
|
||||
var ViewStylePropTypes = require('ViewStylePropTypes');
|
||||
var ReactPropTypes = require('ReactPropTypes');
|
||||
|
||||
var VideoStylePropTypes = {
|
||||
...ViewStylePropTypes,
|
||||
};
|
||||
|
||||
module.exports = VideoStylePropTypes;
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-video",
|
||||
"version": "0.4.12",
|
||||
"version": "0.5.0",
|
||||
"description": "A <Video /> element for react-native",
|
||||
"main": "Video.ios.js",
|
||||
"author": "Brent Vatne <brentvatne@gmail.com> (https://github.com/brentvatne)",
|
||||
@ -28,5 +28,9 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"jest-cli": "0.2.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"keymirror": "^0.1.1",
|
||||
"merge": "^1.2.0"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user