From db402be64070efbf51c383426e9463a4b4c8abc8 Mon Sep 17 00:00:00 2001 From: Brent Vatne Date: Tue, 28 Jul 2015 15:46:05 -0700 Subject: [PATCH] Fix imports and bump sample project to 0.8.0 --- .gitignore | 1 + .../RCTVideo.xcodeproj/project.pbxproj | 8 +++--- Examples/VideoPlayer/package.json | 4 +-- Video.android.js | 4 +-- Video.ios.js | 26 ++++++------------- VideoResizeMode.js | 2 +- VideoStylePropTypes.js | 11 -------- package.json | 6 ++++- 8 files changed, 22 insertions(+), 40 deletions(-) delete mode 100644 VideoStylePropTypes.js diff --git a/.gitignore b/.gitignore index 57af97b6..eb36a796 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ Examples/VideoPlayer/node_modules/**/* Examples/VideoPlayer/VideoPlayer.xcodeproj/project.xcworkspace/**/* Examples/VideoPlayer/VideoPlayer.xcodeproj/xcuserdata/**/* npm-debug.log +.DS_Store diff --git a/Examples/VideoPlayer/node_modules/react-native-video/RCTVideo.xcodeproj/project.pbxproj b/Examples/VideoPlayer/node_modules/react-native-video/RCTVideo.xcodeproj/project.pbxproj index 88f41f05..e6ddaaf1 100644 --- a/Examples/VideoPlayer/node_modules/react-native-video/RCTVideo.xcodeproj/project.pbxproj +++ b/Examples/VideoPlayer/node_modules/react-native-video/RCTVideo.xcodeproj/project.pbxproj @@ -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 = ""; }; - BBD49E3A1AC8DEF000610F8E /* RCTVideo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ../../../../RCTVideo.m; sourceTree = ""; }; - BBD49E3B1AC8DEF000610F8E /* RCTVideoManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ../../../../RCTVideoManager.h; sourceTree = ""; }; - BBD49E3C1AC8DEF000610F8E /* RCTVideoManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ../../../../RCTVideoManager.m; sourceTree = ""; }; + BBD49E391AC8DEF000610F8E /* RCTVideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTVideo.h; sourceTree = ""; }; + BBD49E3A1AC8DEF000610F8E /* RCTVideo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTVideo.m; sourceTree = ""; }; + BBD49E3B1AC8DEF000610F8E /* RCTVideoManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTVideoManager.h; sourceTree = ""; }; + BBD49E3C1AC8DEF000610F8E /* RCTVideoManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTVideoManager.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ diff --git a/Examples/VideoPlayer/package.json b/Examples/VideoPlayer/package.json index 1f661e22..c8984b1c 100644 --- a/Examples/VideoPlayer/package.json +++ b/Examples/VideoPlayer/package.json @@ -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" } } diff --git a/Video.android.js b/Video.android.js index a8a9b102..50209c90 100644 --- a/Video.android.js +++ b/Video.android.js @@ -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."); } }; diff --git a/Video.ios.js b/Video.ios.js index 69faff53..7801b7e4 100644 --- a/Video.ios.js +++ b/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 ; + return ; }, }); diff --git a/VideoResizeMode.js b/VideoResizeMode.js index 2610b64a..9d563fc5 100644 --- a/VideoResizeMode.js +++ b/VideoResizeMode.js @@ -1,6 +1,6 @@ 'use strict'; -var keyMirror = require('keyMirror'); +var keyMirror = require('keymirror'); var VideoResizeMode = keyMirror({ contain: null, diff --git a/VideoStylePropTypes.js b/VideoStylePropTypes.js deleted file mode 100644 index 5ccb7b52..00000000 --- a/VideoStylePropTypes.js +++ /dev/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; diff --git a/package.json b/package.json index 82e0997b..ed07c7d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-video", - "version": "0.4.12", + "version": "0.5.0", "description": "A