Skip to content

Commit

Permalink
Fix video not autoplaying on IOS after a re-render
Browse files Browse the repository at this point in the history
  • Loading branch information
batusai513 committed Feb 20, 2018
1 parent 653a083 commit 0ee351b
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions VideoPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,16 @@ import _ from 'lodash';
export default class VideoPlayer extends Component {

static defaultProps = {
showOnStart: true
showOnStart: true,
resizeMode: 'contain',
playWhenInactive: false,
playInBackground: false,
title: '',
repeat: false,
paused: false,
muted: false,
volume: 1,
rate: 1,
};

constructor( props ) {
Expand All @@ -31,11 +40,11 @@ export default class VideoPlayer extends Component {
*/
this.state = {
// Video
resizeMode: this.props.resizeMode || 'contain',
paused: this.props.paused || false,
muted: this.props.muted || false,
volume: this.props.volume || 1,
rate: this.props.rate || 1,
resizeMode: this.props.resizeMode,
paused: this.props.paused,
muted: this.props.muted,
volume: this.props.volume,
rate: this.props.rate,
// Controls

isFullscreen: this.props.resizeMode === 'cover' || false,
Expand All @@ -60,10 +69,10 @@ export default class VideoPlayer extends Component {
* Any options that can be set at init.
*/
this.opts = {
playWhenInactive: this.props.playWhenInactive || false,
playInBackground: this.props.playInBackground || false,
repeat: this.props.repeat || false,
title: this.props.title || '',
playWhenInactive: this.props.playWhenInactive,
playInBackground: this.props.playInBackground,
repeat: this.props.repeat,
title: this.props.title,
};

/**
Expand Down

0 comments on commit 0ee351b

Please sign in to comment.