fix(android): ensure rate is never set to 0 (#3593)
* fix(android): ensure rate is never set to 0 --------- Co-authored-by: Olivier Bouillet <olivier@OrdinateOlivier.lan>
This commit is contained in:
parent
408cfb2c1c
commit
3d7444ab25
@ -1903,6 +1903,11 @@ public class ReactExoplayerView extends FrameLayout implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setRateModifier(float newRate) {
|
public void setRateModifier(float newRate) {
|
||||||
|
if (newRate <= 0) {
|
||||||
|
DebugLog.w(TAG, "cannot set rate <= 0");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
rate = newRate;
|
rate = newRate;
|
||||||
|
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
|
@ -434,8 +434,8 @@ Default: 250.0
|
|||||||
|
|
||||||
Speed at which the media should play.
|
Speed at which the media should play.
|
||||||
|
|
||||||
- **0.0** - Pauses the video
|
- **0.0** - Pauses the video (iOS only)
|
||||||
- **1.0** - Play at normal speed
|
- **1.0** - Play at normal speed (default)
|
||||||
- **Other values** - Slow down or speed up playback
|
- **Other values** - Slow down or speed up playback
|
||||||
|
|
||||||
### `repeat`
|
### `repeat`
|
||||||
|
@ -638,11 +638,13 @@ class VideoPlayer extends Component {
|
|||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.generalControls}>
|
<View style={styles.generalControls}>
|
||||||
|
{/* shall be replaced by slider */}
|
||||||
<MultiValueControl
|
<MultiValueControl
|
||||||
values={[0.25, 0.5, 1.0, 1.5, 2.0]}
|
values={[0, 0.25, 0.5, 1.0, 1.5, 2.0]}
|
||||||
onPress={this.onRateSelected}
|
onPress={this.onRateSelected}
|
||||||
selected={this.state.rate}
|
selected={this.state.rate}
|
||||||
/>
|
/>
|
||||||
|
{/* shall be replaced by slider */}
|
||||||
<MultiValueControl
|
<MultiValueControl
|
||||||
values={[0.5, 1, 1.5]}
|
values={[0.5, 1, 1.5]}
|
||||||
onPress={this.onVolumeSelected}
|
onPress={this.onVolumeSelected}
|
||||||
|
Loading…
Reference in New Issue
Block a user