Skip to content

Commit

Permalink
Use normal wrapper for light mode
Browse files Browse the repository at this point in the history
  • Loading branch information
albanqoku committed Mar 24, 2019
1 parent 5834ff7 commit 48d430e
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/ReactPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,24 +120,16 @@ export default class ReactPlayer extends Component {
}
render () {
const { url, controls, style, width, height, light, wrapper: Wrapper } = this.props
const { showPreview } = this.state
const showPreview = this.state.showPreview && url
const otherProps = omit(this.props, SUPPORTED_PROPS, DEPRECATED_CONFIG_PROPS)
const activePlayer = this.getActivePlayer(url)
const renderedActivePlayer = this.renderActivePlayer(url, activePlayer)
const preloadPlayers = renderPreloadPlayers(url, controls, this.config)
const players = [ renderedActivePlayer, ...preloadPlayers ].sort(this.sortPlayers)
if (showPreview && url) {
return (
<Preview
url={url}
light={light}
onClick={this.onClickPreview}
/>
)
}
const preview = <Preview url={url} light={light} onClick={this.onClickPreview} />
return (
<Wrapper ref={this.wrapperRef} style={{ ...style, width, height }} {...otherProps}>
{players}
{showPreview ? preview : players}
</Wrapper>
)
}
Expand Down

0 comments on commit 48d430e

Please sign in to comment.