adds audioOnly option that always displays poster image (if provided) on top of player

This commit is contained in:
Shlok Amin
2018-05-29 15:59:21 -04:00
parent 7f011aba33
commit fc6244e440
2 changed files with 3 additions and 2 deletions

View File

@@ -65,7 +65,7 @@ export default class Video extends Component {
};
_onSeek = (event) => {
if (this.state.showPoster) {
if (this.state.showPoster && !this.props.audioOnly) {
this.setState({showPoster: false});
}
@@ -129,7 +129,7 @@ export default class Video extends Component {
};
_onPlaybackRateChange = (event) => {
if (this.state.showPoster && (event.nativeEvent.playbackRate !== 0)) {
if (this.state.showPoster && (event.nativeEvent.playbackRate !== 0) && (!this.props.audioOnly)) {
this.setState({showPoster: false});
}