Skip to content

Commit

Permalink
Fix Youtube rendering issue with React 15
Browse files Browse the repository at this point in the history
After upgrading to React 15, `display: none` was not being applied to the Youtube iframe when a different player was required
  • Loading branch information
cookpete committed Apr 19, 2016
1 parent 048f480 commit 8eb2dc0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/players/YouTube.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,14 @@ export default class YouTube extends Base {
return this.player.getVideoLoadedFraction()
}
render () {
const style = { display: this.props.url ? 'block' : 'none' }
return <div id={this.playerId} style={style} />
const style = {
height: '100%',
display: this.props.url ? 'block' : 'none'
}
return (
<div style={style}>
<div id={this.playerId} />
</div>
)
}
}

0 comments on commit 8eb2dc0

Please sign in to comment.