chore(examples/basic): minor sample fixes (#3717)

* fix(ts): onPlaybackRateChangeData was not correctly typed

* fix: ensure tracks are well displayed in the sample

* fix: fix sample style & avoid changing channel onEnd when looping is enable
This commit is contained in:
Olivier Bouillet 2024-04-26 09:42:21 +02:00 committed by GitHub
parent ce0c113a19
commit 2cd49b53fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -360,7 +360,9 @@ class VideoPlayer extends Component {
};
onEnd = () => {
if (!this.state.loop) {
this.channelUp();
}
};
onPlaybackRateChange = (data: OnPlaybackRateChangeData) => {
@ -593,8 +595,8 @@ class VideoPlayer extends Component {
renderTopControl() {
return (
<>
<Text style={[styles.controlOption]}>
<View style={styles.topControlsContainer}>
<Text style={styles.controlOption}>
{this.srcList[this.state.srcListId]?.description || 'local file'}
</Text>
<View>
@ -602,12 +604,12 @@ class VideoPlayer extends Component {
onPress={() => {
this.toggleControls();
}}>
<Text style={[styles.leftRightControlOption]}>
<Text style={styles.leftRightControlOption}>
{this.state.showRNVControls ? 'Hide controls' : 'Show controls'}
</Text>
</TouchableOpacity>
</View>
</>
</View>
);
}
@ -1032,6 +1034,9 @@ const styles = StyleSheet.create({
width: 100,
height: 40,
},
});
topControlsContainer: {
paddingTop: 30,
}
});
export default VideoPlayer;