From 2cd49b53fd8ca050223b7a1d6cb67ba75e33c2d7 Mon Sep 17 00:00:00 2001 From: Olivier Bouillet <62574056+freeboub@users.noreply.github.com> Date: Fri, 26 Apr 2024 09:42:21 +0200 Subject: [PATCH] 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 --- examples/basic/src/VideoPlayer.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/examples/basic/src/VideoPlayer.tsx b/examples/basic/src/VideoPlayer.tsx index 1caaf98a..843cb145 100644 --- a/examples/basic/src/VideoPlayer.tsx +++ b/examples/basic/src/VideoPlayer.tsx @@ -360,7 +360,9 @@ class VideoPlayer extends Component { }; onEnd = () => { - this.channelUp(); + if (!this.state.loop) { + this.channelUp(); + } }; onPlaybackRateChange = (data: OnPlaybackRateChangeData) => { @@ -593,8 +595,8 @@ class VideoPlayer extends Component { renderTopControl() { return ( - <> - + + {this.srcList[this.state.srcListId]?.description || 'local file'} @@ -602,12 +604,12 @@ class VideoPlayer extends Component { onPress={() => { this.toggleControls(); }}> - + {this.state.showRNVControls ? 'Hide controls' : 'Show controls'} - + ); } @@ -1032,6 +1034,9 @@ const styles = StyleSheet.create({ width: 100, height: 40, }, -}); + topControlsContainer: { + paddingTop: 30, + } + }); export default VideoPlayer;