File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
demo/src/components/index/main Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,14 @@ var Main = React.createClass({
87
87
< span className = "main__react-logo" > </ span > React HTML5 Video
88
88
</ h1 >
89
89
< div className = "main__video" >
90
- < Video controls autoPlay loop muted ref = "video" onProgress = { this . onProgress } >
90
+ < Video
91
+ className = "custom-class"
92
+ controls
93
+ autoPlay
94
+ loop
95
+ muted
96
+ ref = "video"
97
+ onProgress = { this . onProgress } >
91
98
< source src = { videos [ this . state . videoId ] } type = "video/mp4" />
92
99
< Overlay />
93
100
< Controls />
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ var Video = React.createClass({
41
41
// Non-standard props
42
42
copyKeys : React . PropTypes . object ,
43
43
children : React . PropTypes . node ,
44
+ className : React . PropTypes . string ,
44
45
45
46
// HTML5 Video standard attributes
46
47
autoPlay : React . PropTypes . bool ,
@@ -291,6 +292,7 @@ var Video = React.createClass({
291
292
* @return {string } Class string
292
293
*/
293
294
getVideoClassName ( ) {
295
+ var { className} = this . props ;
294
296
var classString = 'video' ;
295
297
296
298
if ( this . state . error ) {
@@ -306,6 +308,9 @@ var Video = React.createClass({
306
308
if ( this . state . focused ) {
307
309
classString += ' video--focused' ;
308
310
}
311
+ if ( className ) {
312
+ classString += ' ' + className ;
313
+ }
309
314
return classString ;
310
315
} ,
311
316
You can’t perform that action at this time.
0 commit comments