Skip to content

Commit

Permalink
Fix imports and bump sample project to 0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
brentvatne committed Jul 28, 2015
1 parent e832d38 commit db402be
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 40 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ Examples/VideoPlayer/node_modules/**/*
Examples/VideoPlayer/VideoPlayer.xcodeproj/project.xcworkspace/**/*
Examples/VideoPlayer/VideoPlayer.xcodeproj/xcuserdata/**/*
npm-debug.log
.DS_Store

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Examples/VideoPlayer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 1 addition & 3 deletions Video.android.js
Original file line number Diff line number Diff line change
@@ -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.");
}
};

Expand Down
26 changes: 8 additions & 18 deletions Video.ios.js
Original file line number Diff line number Diff line change
@@ -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: {
Expand All @@ -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,
Expand All @@ -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) {
Expand Down Expand Up @@ -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(/^\//)) {
Expand Down Expand Up @@ -104,7 +94,7 @@ var Video = React.createClass({
onVideoEnd: this._onEnd,
});

return <RCTVideo {... nativeProps} />;
return <RCTVideo ref={VIDEO_REF} {... nativeProps} />;
},
});

Expand Down
2 changes: 1 addition & 1 deletion VideoResizeMode.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var keyMirror = require('keyMirror');
var keyMirror = require('keymirror');

var VideoResizeMode = keyMirror({
contain: null,
Expand Down
11 changes: 0 additions & 11 deletions VideoStylePropTypes.js

This file was deleted.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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)",
Expand Down Expand Up @@ -28,5 +28,9 @@
},
"devDependencies": {
"jest-cli": "0.2.1"
},
"dependencies": {
"keymirror": "^0.1.1",
"merge": "^1.2.0"
}
}

0 comments on commit db402be

Please sign in to comment.