Socket
Socket
Sign inDemoInstall

video-react

Package Overview
Dependencies
23
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.3 to 0.2.4

8

CHANGELOG.md

@@ -0,1 +1,9 @@

<a name="0.2.4"></a>
## [0.2.4](https://github.com/video-react/video-react/compare/0.2.3...v0.2.4) (2016-11-15)
* Filter children by `disabled` property.
* Inherit props from default component
* remove ninon from dependencies
<a name="0.2.1"></a>

@@ -2,0 +10,0 @@ ## [0.2.1](https://github.com/video-react/video-react/compare/0.1.4...v0.2.1) (2016-11-13)

16

lib/components/control-bar/ControlBar.js

@@ -59,2 +59,4 @@ 'use strict';

var _utils = require('../../utils');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -158,17 +160,5 @@

value: function getChildren() {
var _this2 = this;
var children = _react2.default.Children.toArray(this.props.children);
var defaultChildren = this.getDefaultChildren();
children = children.concat(defaultChildren.filter(function (c) {
return !children.find(function (component) {
return component.type === c.type;
});
}));
return children.sort(function (a, b) {
return (a.props.order || 1) - (b.props.order - 1);
}).map(function (element) {
var e = _react2.default.cloneElement(element, _this2.props);
return e;
});
return (0, _utils.mergeAndSortChildren)(defaultChildren, children, this.props);
}

@@ -175,0 +165,0 @@ }, {

@@ -47,2 +47,4 @@ 'use strict';

var _utils = require('../utils');
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

@@ -217,12 +219,12 @@

key: 'poster-image',
order: 10
order: 1.0
}, props)), _react2.default.createElement(_LoadingSpinner2.default, _extends({
key: 'loading-spinner',
order: 11
order: 2.0
}, props)), _react2.default.createElement(_BigPlayButton2.default, _extends({
key: 'big-play-button',
order: 12
order: 3.0
}, props)), _react2.default.createElement(_ControlBar2.default, _extends({
key: 'control-bar',
order: 13
order: 4.0
}, props))];

@@ -236,16 +238,7 @@ }

});
var children = _react2.default.Children.toArray(this.props.children);
var defaultChildren = this.getDefaultChildren(propsWithoutChildren);
return children.filter(function (e) {
var children = _react2.default.Children.toArray(this.props.children).filter(function (e) {
return e.type !== 'source';
}).concat(defaultChildren.filter(function (c) {
return !children.find(function (component) {
return component.type === c.type;
});
})).sort(function (a, b) {
return (a.props.order || 1) - (b.props.order - 1);
}).map(function (element) {
var e = _react2.default.cloneElement(element, propsWithoutChildren, element.props.children);
return e;
});
var defaultChildren = this.getDefaultChildren(propsWithoutChildren);
return (0, _utils.mergeAndSortChildren)(defaultChildren, children, propsWithoutChildren);
}

@@ -252,0 +245,0 @@ }, {

@@ -6,3 +6,14 @@ 'use strict';

});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports.formatTime = formatTime;
exports.mergeAndSortChildren = mergeAndSortChildren;
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**

@@ -49,2 +60,30 @@ * @file format-time.js

return h + m + s;
}
// merge default children
// sort them by `order` property
// filter them by `disabled` property
function mergeAndSortChildren(defaultChildren, _children, _parentProps) {
var defaultOrder = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
var children = _react2.default.Children.toArray(_children);
var parentProps = _extends({}, _parentProps);
return children.filter(function (e) {
return !e.props.disabled;
}).concat(defaultChildren.filter(function (c) {
return !children.find(function (component) {
return component.type === c.type;
});
})).map(function (element) {
var defaultComponent = defaultChildren.find(function (c) {
return c.type === element.type;
});
delete parentProps.order;
var defaultProps = defaultComponent ? defaultComponent.props : {};
var props = _extends({}, parentProps, defaultProps, element.props);
var e = _react2.default.cloneElement(element, props, element.props.children);
return e;
}).sort(function (a, b) {
return (a.props.order || defaultOrder) - (b.props.order || defaultOrder);
});
}
{
"name": "video-react",
"version": "0.2.3",
"version": "0.2.4",
"description": "Video-React is a web video player built from the ground up for an HTML5 world using React library.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -20,15 +20,9 @@

class App extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<Player poster="img/poster.png" width="640" height="480">
</Player>
);
}
}
export default (props) => {
return (
<Player poster="/assets/poster.png">
<source src="https://media.w3.org/2010/05/sintel/trailer_hd.mp4" />
</Player>
);
};
```

@@ -35,0 +29,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc