Skip to content

Commit

Permalink
change to v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed Jan 30, 2015
1 parent 793467a commit fe6039b
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 15 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-video",
"version": "1.2.0",
"version": "1.3.0",
"description": "React component to load video from Vimeo or Youtube across any device",
"homepage": "https://github.com/pedronauck/react-video",
"authors": [
Expand Down
2 changes: 1 addition & 1 deletion dist/react-video.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* React Video - React component to load video from Vimeo or Youtube across any device
* @version v1.2.0
* @version v1.3.0
* @link https://github.com/pedronauck/react-video
* @license MIT
* @author Pedro Nauck (https://github.com/pedronauck)
Expand Down
18 changes: 12 additions & 6 deletions dist/react-video.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* React Video - React component to load video from Vimeo or Youtube across any device
* @version v1.2.0
* @version v1.3.0
* @link https://github.com/pedronauck/react-video
* @license MIT
* @author Pedro Nauck (https://github.com/pedronauck)
Expand Down Expand Up @@ -71,7 +71,7 @@ return /******/ (function(modules) { // webpackBootstrap
module.exports = React.createClass({
displayName: 'Video',
propTypes: {
from: React.PropTypes.oneOf(['youtube', 'vimeo']).isRequired,
from: React.PropTypes.oneOf(['youtube', 'vimeo']),
videoId: React.PropTypes.string.isRequired
},
getDefaultProps:function() {
Expand All @@ -86,9 +86,15 @@ return /******/ (function(modules) { // webpackBootstrap
showingVideo: false
};
},
isYoutube:function() {
return this.props.from === 'youtube' || isNaN(this.props.id);
},
isVimeo:function() {
return this.props.from === 'vimeo' || !isNaN(this.props.id);
},
componentDidMount:function() {
this.props.from === 'youtube' && this.fetchYoutubeData();
this.props.from === 'vimeo' && this.fetchVimeoData();
this.isYoutube() && this.fetchYoutubeData();
this.isVimeo() && this.fetchVimeoData();
},
render:function() {
return (
Expand Down Expand Up @@ -132,10 +138,10 @@ return /******/ (function(modules) { // webpackBootstrap
ev.preventDefault();
},
getIframeUrl:function() {
if (this.props.from === 'youtube') {
if (this.isYoutube()) {
return ("//youtube.com/embed/" + this.props.videoId + "?autoplay=1")
}
else if (this.props.from === 'vimeo') {
else if (this.isVimeo()) {
return ("//player.vimeo.com/video/" + this.props.videoId + "?autoplay=1")
}
},
Expand Down
2 changes: 1 addition & 1 deletion dist/react-video.min.css

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

4 changes: 2 additions & 2 deletions dist/react-video.min.js

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

11 changes: 10 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<h1 class="title">React Video</h1>
<ul class="github-buttons">
<li>
<a href="https://github.com/pedronauck/react-video/archive/v1.2.0.zip">Download v1.2.0</a>
<a href="https://github.com/pedronauck/react-video/archive/v1.3.0.zip">Download v1.3.0</a>
</li>
<li>
<a href="http://github.com/pedronauck/react-video">
Expand Down Expand Up @@ -90,6 +90,15 @@ <h2 class="section-title">Usage</h2>
document.querySelector('#your-div')
);
</code></pre>
<p>
The property <code>videoId</code> is optional, so you can use it or not. If you don't pass the property, the component will select your type of video based on your id.
</p>
<pre><code class="hljs javascript">
React.renderComponent(
&lt;Video videoId={videoId} /&gt;,
document.querySelector('#your-div')
);
</code></pre>
<p>
If you decide to use just Javascript without any module loader, you can get the global variable <code>window.ReactVideo</code>:
</p>
Expand Down
4 changes: 2 additions & 2 deletions docs/js/react-video.min.js

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

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",
"version": "1.2.0",
"version": "1.3.0",
"description": "React component to load video from Vimeo or Youtube across any device",
"author": {
"name": "Pedro Nauck",
Expand Down

0 comments on commit fe6039b

Please sign in to comment.