Skip to content

Commit fe6039b

Browse files
committed
change to v1.3.0
1 parent 793467a commit fe6039b

File tree

8 files changed

+30
-15
lines changed

8 files changed

+30
-15
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-video",
3-
"version": "1.2.0",
3+
"version": "1.3.0",
44
"description": "React component to load video from Vimeo or Youtube across any device",
55
"homepage": "https://github.com/pedronauck/react-video",
66
"authors": [

dist/react-video.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* React Video - React component to load video from Vimeo or Youtube across any device
3-
* @version v1.2.0
3+
* @version v1.3.0
44
* @link https://github.com/pedronauck/react-video
55
* @license MIT
66
* @author Pedro Nauck (https://github.com/pedronauck)

dist/react-video.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* React Video - React component to load video from Vimeo or Youtube across any device
3-
* @version v1.2.0
3+
* @version v1.3.0
44
* @link https://github.com/pedronauck/react-video
55
* @license MIT
66
* @author Pedro Nauck (https://github.com/pedronauck)
@@ -71,7 +71,7 @@ return /******/ (function(modules) { // webpackBootstrap
7171
module.exports = React.createClass({
7272
displayName: 'Video',
7373
propTypes: {
74-
from: React.PropTypes.oneOf(['youtube', 'vimeo']).isRequired,
74+
from: React.PropTypes.oneOf(['youtube', 'vimeo']),
7575
videoId: React.PropTypes.string.isRequired
7676
},
7777
getDefaultProps:function() {
@@ -86,9 +86,15 @@ return /******/ (function(modules) { // webpackBootstrap
8686
showingVideo: false
8787
};
8888
},
89+
isYoutube:function() {
90+
return this.props.from === 'youtube' || isNaN(this.props.id);
91+
},
92+
isVimeo:function() {
93+
return this.props.from === 'vimeo' || !isNaN(this.props.id);
94+
},
8995
componentDidMount:function() {
90-
this.props.from === 'youtube' && this.fetchYoutubeData();
91-
this.props.from === 'vimeo' && this.fetchVimeoData();
96+
this.isYoutube() && this.fetchYoutubeData();
97+
this.isVimeo() && this.fetchVimeoData();
9298
},
9399
render:function() {
94100
return (
@@ -132,10 +138,10 @@ return /******/ (function(modules) { // webpackBootstrap
132138
ev.preventDefault();
133139
},
134140
getIframeUrl:function() {
135-
if (this.props.from === 'youtube') {
141+
if (this.isYoutube()) {
136142
return ("//youtube.com/embed/" + this.props.videoId + "?autoplay=1")
137143
}
138-
else if (this.props.from === 'vimeo') {
144+
else if (this.isVimeo()) {
139145
return ("//player.vimeo.com/video/" + this.props.videoId + "?autoplay=1")
140146
}
141147
},

dist/react-video.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-video.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<h1 class="title">React Video</h1>
2525
<ul class="github-buttons">
2626
<li>
27-
<a href="https://github.com/pedronauck/react-video/archive/v1.2.0.zip">Download v1.2.0</a>
27+
<a href="https://github.com/pedronauck/react-video/archive/v1.3.0.zip">Download v1.3.0</a>
2828
</li>
2929
<li>
3030
<a href="http://github.com/pedronauck/react-video">
@@ -90,6 +90,15 @@ <h2 class="section-title">Usage</h2>
9090
document.querySelector('#your-div')
9191
);
9292
</code></pre>
93+
<p>
94+
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.
95+
</p>
96+
<pre><code class="hljs javascript">
97+
React.renderComponent(
98+
&lt;Video videoId={videoId} /&gt;,
99+
document.querySelector('#your-div')
100+
);
101+
</code></pre>
93102
<p>
94103
If you decide to use just Javascript without any module loader, you can get the global variable <code>window.ReactVideo</code>:
95104
</p>

docs/js/react-video.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-video",
3-
"version": "1.2.0",
3+
"version": "1.3.0",
44
"description": "React component to load video from Vimeo or Youtube across any device",
55
"author": {
66
"name": "Pedro Nauck",

0 commit comments

Comments
 (0)