Skip to content

Commit

Permalink
1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tkloht committed Aug 13, 2016
1 parent 1957b9d commit 689b233
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
1 change: 0 additions & 1 deletion dist/VideoCover.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
* IF YOU DO NOT HAVE TO SUPPORT IE, you probably do not need this component
* just have a look at the styles for the non-fallback implementation
*/

var VideoCover = function (_Component) {
_inherits(VideoCover, _Component);

Expand Down
18 changes: 12 additions & 6 deletions dist/VideoCoverFallback.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@ var VideoCoverFallback = function (_Component) {
innerRatio: undefined,
outerRatio: undefined
}, _this.updateContainerRatio = function () {
var ref = arguments.length <= 0 || arguments[0] === undefined ? _this.containerRef : arguments[0];
if (_this.containerRef) {
var _this$containerRef$ge = _this.containerRef.getBoundingClientRect();

if (ref) {
var _ref$getBoundingClien = ref.getBoundingClientRect();

var width = _ref$getBoundingClien.width;
var height = _ref$getBoundingClien.height;
var width = _this$containerRef$ge.width;
var height = _this$containerRef$ge.height;

_this.setState({
outerRatio: width / height
Expand Down Expand Up @@ -93,6 +91,14 @@ var VideoCoverFallback = function (_Component) {
}
}, {
key: 'render',


/**
* We can get the width and height of a video after it has started loading.
* Then we can compare the aspect ratio of the video to that of it's surrounding container.
* That is all we need to determine if the video fills the container vertically or horizontally.
* In the other dimension we just have to maintain the original aspect-ratio.
*/
value: function render() {
var _this2 = this;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-video-cover",
"version": "1.0.0",
"version": "1.0.1",
"description": "displays video with object-fit: cover, with fallback for IE",
"homepage": "http://t-obi.github.io/react-video-cover/",
"bugs": "https://github.com/t-obi/react-video-cover/issues",
Expand Down

0 comments on commit 689b233

Please sign in to comment.