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) {
|
||||
if (newRate <= 0) {
|
||||
DebugLog.w(TAG, "cannot set rate <= 0");
|
||||
return;
|
||||
}
|
||||
|
||||
rate = newRate;
|
||||
|
||||
if (player != null) {
|
||||
|
@ -434,8 +434,8 @@ Default: 250.0
|
||||
|
||||
Speed at which the media should play.
|
||||
|
||||
- **0.0** - Pauses the video
|
||||
- **1.0** - Play at normal speed
|
||||
- **0.0** - Pauses the video (iOS only)
|
||||
- **1.0** - Play at normal speed (default)
|
||||
- **Other values** - Slow down or speed up playback
|
||||
|
||||
### `repeat`
|
||||
|
@ -638,11 +638,13 @@ class VideoPlayer extends Component {
|
||||
/>
|
||||
</View>
|
||||
<View style={styles.generalControls}>
|
||||
{/* shall be replaced by slider */}
|
||||
<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}
|
||||
selected={this.state.rate}
|
||||
/>
|
||||
{/* shall be replaced by slider */}
|
||||
<MultiValueControl
|
||||
values={[0.5, 1, 1.5]}
|
||||
onPress={this.onVolumeSelected}
|
||||
|
Loading…
Reference in New Issue
Block a user