Skip to content

Commit

Permalink
Show preview when switching from non-light to light
Browse files Browse the repository at this point in the history
  • Loading branch information
cookpete committed Jan 25, 2019
1 parent f45a40d commit 4a39dc4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ReactPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ export default class ReactPlayer extends Component {
}
componentWillUpdate (nextProps) {
this.config = getConfig(nextProps, defaultProps)
if (!this.props.light && nextProps.light) {
this.setState({ showPreview: true })
}
}
onClickPreview = () => {
this.setState({ showPreview: false })
Expand Down

0 comments on commit 4a39dc4

Please sign in to comment.