Skip to content

Commit

Permalink
Merge pull request #166 from thetalonhughes/fix/update-styles-on-prop…
Browse files Browse the repository at this point in the history
…-change

- add fix to update styles on prop change
  • Loading branch information
Kyle Milloy authored Dec 17, 2019
2 parents 01aee98 + 81e0ac6 commit 6a5c763
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion VideoPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default class VideoPlayer extends Component {
muted: false,
title: '',
rate: 1,
isFullscreen: false,
};

constructor( props ) {
Expand All @@ -47,7 +48,7 @@ export default class VideoPlayer extends Component {
rate: this.props.rate,
// Controls

isFullscreen: this.props.resizeMode === 'cover' || false,
isFullscreen: this.props.isFullScreen || this.props.resizeMode === 'cover' || false,
showTimeRemaining: true,
volumeTrackWidth: 0,
lastScreenPress: 0,
Expand Down Expand Up @@ -680,6 +681,14 @@ export default class VideoPlayer extends Component {
paused: nextProps.paused
})
}

if(this.styles.videoStyle !== nextProps.videoStyle){
this.styles.videoStyle = nextProps.videoStyle;
}

if(this.styles.containerStyle !== nextProps.style){
this.styles.containerStyle = nextProps.style;
}
}

/**
Expand Down

0 comments on commit 6a5c763

Please sign in to comment.