mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-03-11 17:45:38 +00:00
Merge 8097784218 into 7d60a0c43f
This commit is contained in:
commit
a960477d88
1 changed files with 46 additions and 22 deletions
|
|
@ -305,35 +305,59 @@ export const PlayerControls: React.FC<PlayerControlsProps> = ({
|
||||||
>
|
>
|
||||||
{/* Progress slider with native iOS slider */}
|
{/* Progress slider with native iOS slider */}
|
||||||
<View style={styles.sliderContainer}>
|
<View style={styles.sliderContainer}>
|
||||||
<Slider
|
<View
|
||||||
style={{
|
style={{
|
||||||
width: '100%',
|
|
||||||
height: 40,
|
height: 40,
|
||||||
marginHorizontal: 0,
|
justifyContent: 'center',
|
||||||
}}
|
}}>
|
||||||
minimumValue={0}
|
{/* Non-interactive slider to only show the buffer track */}
|
||||||
maximumValue={duration || 1}
|
<Slider
|
||||||
|
style={{
|
||||||
|
position: 'absolute',
|
||||||
|
width: '100%',
|
||||||
|
height: 40,
|
||||||
|
}}
|
||||||
|
step={1}
|
||||||
|
minimumValue={0}
|
||||||
|
maximumValue={duration || 1}
|
||||||
|
value={Math.min(buffered, duration || 1)}
|
||||||
|
minimumTrackTintColor={currentTheme.colors.highEmphasis}
|
||||||
|
maximumTrackTintColor={currentTheme.colors.mediumEmphasis}
|
||||||
|
thumbTintColor="transparent"
|
||||||
|
pointerEvents='none'
|
||||||
|
/>
|
||||||
|
{/* Video seek & progress slider */}
|
||||||
|
<Slider
|
||||||
|
style={{
|
||||||
|
width: '100%',
|
||||||
|
height: 40,
|
||||||
|
marginHorizontal: 0,
|
||||||
|
}}
|
||||||
|
step={1}
|
||||||
|
minimumValue={0}
|
||||||
|
maximumValue={duration || 1}
|
||||||
|
|
||||||
value={previewTime}
|
value={previewTime}
|
||||||
|
|
||||||
onValueChange={(v) => setPreviewTime(v)}
|
onValueChange={(v) => setPreviewTime(v)}
|
||||||
|
|
||||||
onSlidingStart={() => {
|
onSlidingStart={() => {
|
||||||
isSlidingRef.current = true;
|
isSlidingRef.current = true;
|
||||||
onSlidingStart();
|
onSlidingStart();
|
||||||
}}
|
}}
|
||||||
|
|
||||||
onSlidingComplete={(v) => {
|
onSlidingComplete={(v) => {
|
||||||
isSlidingRef.current = false;
|
isSlidingRef.current = false;
|
||||||
setPreviewTime(v);
|
setPreviewTime(v);
|
||||||
onSlidingComplete(v);
|
onSlidingComplete(v);
|
||||||
}}
|
}}
|
||||||
|
|
||||||
minimumTrackTintColor={currentTheme.colors.primary}
|
minimumTrackTintColor={currentTheme.colors.primary}
|
||||||
maximumTrackTintColor={currentTheme.colors.mediumEmphasis}
|
maximumTrackTintColor='transparent'
|
||||||
thumbTintColor={Platform.OS === 'android' ? currentTheme.colors.white : undefined}
|
thumbTintColor={Platform.OS === 'android' ? currentTheme.colors.white : undefined}
|
||||||
tapToSeek={Platform.OS === 'ios'}
|
tapToSeek={Platform.OS === 'ios'}
|
||||||
/>
|
/>
|
||||||
|
</View>
|
||||||
<View style={[styles.timeDisplay, { paddingHorizontal: 14 }]}>
|
<View style={[styles.timeDisplay, { paddingHorizontal: 14 }]}>
|
||||||
<View style={styles.timeContainer}>
|
<View style={styles.timeContainer}>
|
||||||
<Text style={styles.duration}>{formatTime(previewTime)}</Text>
|
<Text style={styles.duration}>{formatTime(previewTime)}</Text>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue