From 052f49e472ac3fc567a6a882967d6444570e8d99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harrison=20Mendon=C3=A7a?= Date: Mon, 20 Apr 2020 20:12:34 -0300 Subject: [PATCH] Update index.ios.js --- examples/basic/index.ios.js | 49 +++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/examples/basic/index.ios.js b/examples/basic/index.ios.js index 1bc0ac47..c4c21c3d 100644 --- a/examples/basic/index.ios.js +++ b/examples/basic/index.ios.js @@ -52,6 +52,7 @@ class VideoPlayer extends Component { paused: true, skin: 'custom', ignoreSilentSwitch: null, + mixWithOthers: null, isBuffering: false, filter: FilterType.NONE, filterEnabled: true @@ -155,6 +156,18 @@ class VideoPlayer extends Component { ) } + renderMixWithOthersControl(mixWithOthers) { + const isSelected = (this.state.mixWithOthers == mixWithOthers); + + return ( + { this.setState({mixWithOthers: mixWithOthers}) }}> + + {mixWithOthers} + + + ) + } + renderCustomSkin() { const flexCompleted = this.getCurrentTimePercentage() * 100; const flexRemaining = (1 - this.getCurrentTimePercentage()) * 100; @@ -170,6 +183,7 @@ class VideoPlayer extends Component { volume={this.state.volume} muted={this.state.muted} ignoreSilentSwitch={this.state.ignoreSilentSwitch} + mixWithOthers={this.state.mixWithOthers} resizeMode={this.state.resizeMode} onLoad={this.onLoad} onBuffer={this.onBuffer} @@ -226,10 +240,16 @@ class VideoPlayer extends Component { { (Platform.OS === 'ios') ? - - {this.renderIgnoreSilentSwitchControl('ignore')} - {this.renderIgnoreSilentSwitchControl('obey')} - : null + <> + + {this.renderIgnoreSilentSwitchControl('ignore')} + {this.renderIgnoreSilentSwitchControl('obey')} + + + {this.renderMixWithOthersControl('mix')} + {this.renderMixWithOthersControl('duck')} + + : null } @@ -257,6 +277,7 @@ class VideoPlayer extends Component { volume={this.state.volume} muted={this.state.muted} ignoreSilentSwitch={this.state.ignoreSilentSwitch} + mixWithOthers={this.state.mixWithOthers} resizeMode={this.state.resizeMode} onLoad={this.onLoad} onBuffer={this.onBuffer} @@ -313,10 +334,16 @@ class VideoPlayer extends Component { { (Platform.OS === 'ios') ? - - {this.renderIgnoreSilentSwitchControl('ignore')} - {this.renderIgnoreSilentSwitchControl('obey')} - : null + <> + + {this.renderIgnoreSilentSwitchControl('ignore')} + {this.renderIgnoreSilentSwitchControl('obey')} + + + {this.renderMixWithOthersControl('mix')} + {this.renderMixWithOthersControl('duck')} + + : null } @@ -399,6 +426,12 @@ const styles = StyleSheet.create({ alignItems: 'center', justifyContent: 'center' }, + mixWithOthersControl: { + flex: 1, + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'center' + }, controlOption: { alignSelf: 'center', fontSize: 11,