Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/start position #3718

Merged
merged 9 commits into from
Apr 26, 2024
22 changes: 16 additions & 6 deletions examples/basic/src/VideoPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ class VideoPlayer extends Component {
description: 'sintel with subtitles',
uri: 'https://bitmovin-a.akamaihd.net/content/sintel/hls/playlist.m3u8',
},
{
description: 'sintel starts at 20sec',
uri: 'https://bitmovin-a.akamaihd.net/content/sintel/hls/playlist.m3u8',
startPosition: 50000,
},
{
description: 'BigBugBunny sideLoaded subtitles',
// sideloaded subtitles wont work for streaming like HLS on ios
Expand Down Expand Up @@ -360,7 +365,9 @@ class VideoPlayer extends Component {
};

onEnd = () => {
this.channelUp();
if (!this.state.loop) {
this.channelUp();
}
};

onPlaybackRateChange = (data: OnPlaybackRateChangeData) => {
Expand Down Expand Up @@ -593,21 +600,21 @@ 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>
<TouchableOpacity
onPress={() => {
this.toggleControls();
}}>
<Text style={[styles.leftRightControlOption]}>
<Text style={styles.leftRightControlOption}>
{this.state.showRNVControls ? 'Hide controls' : 'Show controls'}
</Text>
</TouchableOpacity>
</View>
</>
</View>
);
}

Expand Down Expand Up @@ -1032,6 +1039,9 @@ const styles = StyleSheet.create({
width: 100,
height: 40,
},
});
topControlsContainer: {
paddingTop: 30,
}
});

export default VideoPlayer;