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