From ef1614db1329c6575318cc199849f7826e1c98e8 Mon Sep 17 00:00:00 2001 From: victor miranda Date: Thu, 15 Apr 2021 11:27:12 -0300 Subject: [PATCH 1/2] adding subtitle style parameters --- VideoPlayer.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/VideoPlayer.js b/VideoPlayer.js index 99daac9b..43b25e90 100644 --- a/VideoPlayer.js +++ b/VideoPlayer.js @@ -128,7 +128,9 @@ export default class VideoPlayer extends Component { */ this.styles = { videoStyle: this.props.videoStyle || {}, - containerStyle: this.props.style || {} + containerStyle: this.props.style || {}, + subtitleContainerStyle: this.props.subtitleContainerStyle || {}, + subtitleStyle: this.props.subtitleStyle || {}, }; } @@ -1075,10 +1077,10 @@ export default class VideoPlayer extends Component { - {this.showSubtitle()} + {this.showSubtitle()} ); } From 7dced533e5d522a02129bc50cc5f6265e722c77a Mon Sep 17 00:00:00 2001 From: victor miranda Date: Thu, 15 Apr 2021 13:55:05 -0300 Subject: [PATCH 2/2] adding more conditional rendering --- VideoPlayer.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/VideoPlayer.js b/VideoPlayer.js index 43b25e90..adcb8ddb 100644 --- a/VideoPlayer.js +++ b/VideoPlayer.js @@ -1110,11 +1110,12 @@ export default class VideoPlayer extends Component { style={[styles.player.video, this.styles.videoStyle]} source={this.props.source} /> - {this.renderSubtitle()} - {this.renderError()} - {this.renderTopControls()} - {this.renderLoader()} - {this.renderBottomControls()} + + { this.props.subtitle ? this.renderSubtitle() : null} + { !this.props.disableError ? this.renderError() : null } + { !this.props.disableBack || !this.props.disableVolume || !this.props.disableFullscreen ? this.renderTopControls() : null } + { !this.props.disableLoader ? this.renderLoader() : null } + { !this.props.disablePlayPause || !this.props.disableTimer || !this.props.disableSeekbar ? this.renderBottomControls() : null } );