diff --git a/README.md b/README.md index 8c66327..e52997a 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Installing this component is very easy and it has just one dependency: [React](h $ bower install --save react-video ``` -- Or if you want to [download the lastest release](https://github.com/pedronauck/react-video/archive/v1.1.3.zip) and put in your website, it will work too! +- Or if you want to [download the lastest release](https://github.com/pedronauck/react-video/archive/v1.1.4.zip) and put in your website, it will work too! **NOTICE:** You need just one thing to make the component work. Put the [base component style](./dist/react-video.css) at the `
` tag. If you don't wanna use the `.css` extension, you can get the `.styl` or `.scss` extension at the folder `./lib`. diff --git a/bower.json b/bower.json index 439d85e..ea20e6c 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "react-video", - "version": "1.1.3", + "version": "1.1.4", "description": "React component to load video from Vimeo or Youtube across any device", "homepage": "https://github.com/pedronauck/react-video", "authors": [ diff --git a/dist/react-video.css b/dist/react-video.css index 11761a5..7c7ab47 100644 --- a/dist/react-video.css +++ b/dist/react-video.css @@ -1,6 +1,6 @@ /* * React Video - React component to load video from Vimeo or Youtube across any device - * @version v1.1.3 + * @version v1.1.4 * @link https://github.com/pedronauck/react-video * @license MIT * @author Pedro Nauck (https://github.com/pedronauck) diff --git a/dist/react-video.js b/dist/react-video.js index 710fda4..497d051 100644 --- a/dist/react-video.js +++ b/dist/react-video.js @@ -1,6 +1,6 @@ /* * React Video - React component to load video from Vimeo or Youtube across any device - * @version v1.1.3 + * @version v1.1.4 * @link https://github.com/pedronauck/react-video * @license MIT * @author Pedro Nauck (https://github.com/pedronauck) @@ -159,7 +159,7 @@ return /******/ (function(modules) { // webpackBootstrap }, fetchVimeoData:function() { var id = this.props.id; - var url = ("http://vimeo.com/api/v2/video/" + id + ".json"); + var url = ("https://vimeo.com/api/v2/video/" + id + ".json"); ajax.get(url, function(err, res) { this.setState({ diff --git a/dist/react-video.min.css b/dist/react-video.min.css index 94c29cd..eb4b0c2 100644 --- a/dist/react-video.min.css +++ b/dist/react-video.min.css @@ -1,6 +1,6 @@ /* * React Video - React component to load video from Vimeo or Youtube across any device - * @version v1.1.3 + * @version v1.1.4 * @link https://github.com/pedronauck/react-video * @license MIT * @author Pedro Nauck (https://github.com/pedronauck) diff --git a/dist/react-video.min.js b/dist/react-video.min.js index 39cf761..14a3f71 100644 --- a/dist/react-video.min.js +++ b/dist/react-video.min.js @@ -1,8 +1,8 @@ /* * React Video - React component to load video from Vimeo or Youtube across any device - * @version v1.1.3 + * @version v1.1.4 * @link https://github.com/pedronauck/react-video * @license MIT * @author Pedro Nauck (https://github.com/pedronauck) */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactVideo=t(require("react")):e.ReactVideo=t(e.React)}(this,function(e){return function(e){function t(i){if(o[i])return o[i].exports;var r=o[i]={exports:{},id:i,loaded:!1};return e[i].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){var i=o(1),r=(o(2),o(3)),n=o(4),s=o(5);e.exports=i.createClass({displayName:"Video",propTypes:{from:i.PropTypes.oneOf(["youtube","vimeo"]).isRequired,id:i.PropTypes.string.isRequired},getDefaultProps:function(){return{className:"video"}},getInitialState:function(){return{thumb:null,imageLoaded:!1,showingVideo:!1}},componentDidMount:function(){"youtube"===this.props.from&&this.fetchYoutubeData(),"vimeo"===this.props.from&&this.fetchVimeoData()},render:function(){return i.DOM.div({className:this.props.className},!this.state.imageLoaded&&s(null),this.renderImage(),this.renderIframe())},renderImage:function(){var e={backgroundImage:"url("+this.state.thumb+")"};return this.state.imageLoaded&&!this.state.showingVideo?i.DOM.div({className:"video-image",style:e},n({onClick:this.playVideo})):void 0},renderIframe:function(){var e={display:this.state.showingVideo?"block":"none",width:"100%",height:"100%"};return this.state.showingVideo?i.DOM.div({className:"video-embed",style:e},i.DOM.iframe({frameborder:"0",src:this.getIframeUrl(),width:this.state.width,height:this.state.height})):void 0},playVideo:function(e){this.setState({showingVideo:!0}),e.preventDefault()},getIframeUrl:function(){return"youtube"===this.props.from?"//youtube.com/embed/"+this.props.id+"?autoplay=1":"vimeo"===this.props.from?"//player.vimeo.com/video/"+this.props.id+"?autoplay=1":void 0},fetchYoutubeData:function(){var e=this.props.id,t="https://gdata.youtube.com/feeds/api/videos/"+e+"?v=2&alt=json";r.get(t,function(e,t){var o=t.entry.media$group.media$thumbnail,i=o.sort(function(e,t){return t.width-e.width})[0].url;this.setState({thumb:i,imageLoaded:!0})}.bind(this))},fetchVimeoData:function(){var e=this.props.id,t="http://vimeo.com/api/v2/video/"+e+".json";r.get(t,function(e,t){this.setState({thumb:t[0].thumbnail_large,imageLoaded:!0})}.bind(this))}})},function(t){t.exports=e},function(e){e.exports=function(e){return"object"!=typeof e?Array.prototype.join.call(arguments," "):Object.keys(e).filter(function(t){return e[t]}).join(" ")}},function(e){var t=function(e,t){var o=new XMLHttpRequest;o.open("GET",e,!0),o.onload=function(){200===o.status&&o.status<400?t(null,JSON.parse(o.responseText)):t({error:"Sorry, an error ocurred on the server"},null)},o.onerror=function(){t({error:"Problem with your internet conection"},null)},o.send()};e.exports={get:t}},function(e,t,o){var i=o(1);e.exports=i.createClass({displayName:"exports",propTypes:{onClick:i.PropTypes.func},render:function(){return i.DOM.button({type:"button",className:"video-play-button",onClick:this.props.onClick},i.DOM.svg({xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 100 100"},i.DOM.path({d:"M79.674,53.719c2.59-2.046,2.59-5.392,0-7.437L22.566,1.053C19.977-0.993,18,0.035,18,3.335v93.331c0,3.3,1.977,4.326,4.566,2.281L79.674,53.719z"})))}})},function(e,t,o){var i=o(1);e.exports=i.createClass({displayName:"exports",render:function(){return i.DOM.div({className:"video-loading"},i.DOM.svg({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:"32",height:"32"},i.DOM.path({opacity:".25",d:"M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"}),i.DOM.path({d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}})}])}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactVideo=t(require("react")):e.ReactVideo=t(e.React)}(this,function(e){return function(e){function t(i){if(o[i])return o[i].exports;var r=o[i]={exports:{},id:i,loaded:!1};return e[i].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){var i=o(1),r=(o(2),o(3)),n=o(4),s=o(5);e.exports=i.createClass({displayName:"Video",propTypes:{from:i.PropTypes.oneOf(["youtube","vimeo"]).isRequired,id:i.PropTypes.string.isRequired},getDefaultProps:function(){return{className:"video"}},getInitialState:function(){return{thumb:null,imageLoaded:!1,showingVideo:!1}},componentDidMount:function(){"youtube"===this.props.from&&this.fetchYoutubeData(),"vimeo"===this.props.from&&this.fetchVimeoData()},render:function(){return i.DOM.div({className:this.props.className},!this.state.imageLoaded&&s(null),this.renderImage(),this.renderIframe())},renderImage:function(){var e={backgroundImage:"url("+this.state.thumb+")"};return this.state.imageLoaded&&!this.state.showingVideo?i.DOM.div({className:"video-image",style:e},n({onClick:this.playVideo})):void 0},renderIframe:function(){var e={display:this.state.showingVideo?"block":"none",width:"100%",height:"100%"};return this.state.showingVideo?i.DOM.div({className:"video-embed",style:e},i.DOM.iframe({frameborder:"0",src:this.getIframeUrl(),width:this.state.width,height:this.state.height})):void 0},playVideo:function(e){this.setState({showingVideo:!0}),e.preventDefault()},getIframeUrl:function(){return"youtube"===this.props.from?"//youtube.com/embed/"+this.props.id+"?autoplay=1":"vimeo"===this.props.from?"//player.vimeo.com/video/"+this.props.id+"?autoplay=1":void 0},fetchYoutubeData:function(){var e=this.props.id,t="https://gdata.youtube.com/feeds/api/videos/"+e+"?v=2&alt=json";r.get(t,function(e,t){var o=t.entry.media$group.media$thumbnail,i=o.sort(function(e,t){return t.width-e.width})[0].url;this.setState({thumb:i,imageLoaded:!0})}.bind(this))},fetchVimeoData:function(){var e=this.props.id,t="https://vimeo.com/api/v2/video/"+e+".json";r.get(t,function(e,t){this.setState({thumb:t[0].thumbnail_large,imageLoaded:!0})}.bind(this))}})},function(t){t.exports=e},function(e){e.exports=function(e){return"object"!=typeof e?Array.prototype.join.call(arguments," "):Object.keys(e).filter(function(t){return e[t]}).join(" ")}},function(e){var t=function(e,t){var o=new XMLHttpRequest;o.open("GET",e,!0),o.onload=function(){200===o.status&&o.status<400?t(null,JSON.parse(o.responseText)):t({error:"Sorry, an error ocurred on the server"},null)},o.onerror=function(){t({error:"Problem with your internet conection"},null)},o.send()};e.exports={get:t}},function(e,t,o){var i=o(1);e.exports=i.createClass({displayName:"exports",propTypes:{onClick:i.PropTypes.func},render:function(){return i.DOM.button({type:"button",className:"video-play-button",onClick:this.props.onClick},i.DOM.svg({xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 100 100"},i.DOM.path({d:"M79.674,53.719c2.59-2.046,2.59-5.392,0-7.437L22.566,1.053C19.977-0.993,18,0.035,18,3.335v93.331c0,3.3,1.977,4.326,4.566,2.281L79.674,53.719z"})))}})},function(e,t,o){var i=o(1);e.exports=i.createClass({displayName:"exports",render:function(){return i.DOM.div({className:"video-loading"},i.DOM.svg({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:"32",height:"32"},i.DOM.path({opacity:".25",d:"M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"}),i.DOM.path({d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}})}])}); \ No newline at end of file diff --git a/docs/css/react-video.min.css b/docs/css/react-video.min.css index 94c29cd..eb4b0c2 100644 --- a/docs/css/react-video.min.css +++ b/docs/css/react-video.min.css @@ -1,6 +1,6 @@ /* * React Video - React component to load video from Vimeo or Youtube across any device - * @version v1.1.3 + * @version v1.1.4 * @link https://github.com/pedronauck/react-video * @license MIT * @author Pedro Nauck (https://github.com/pedronauck) diff --git a/docs/index.html b/docs/index.html index 6325f51..6ce5179 100644 --- a/docs/index.html +++ b/docs/index.html @@ -24,7 +24,7 @@

React Video