mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-02 13:44:54 +00:00
imrpoved android videoplayer logic
This commit is contained in:
parent
fa03d4455f
commit
67648ea6db
2 changed files with 7 additions and 5 deletions
|
|
@ -647,7 +647,7 @@ const AndroidVideoPlayer: React.FC = () => {
|
||||||
const handleSliderValueChange = (value: number) => {
|
const handleSliderValueChange = (value: number) => {
|
||||||
if (isDragging && duration > 0) {
|
if (isDragging && duration > 0) {
|
||||||
const seekTime = Math.min(value, duration - END_EPSILON);
|
const seekTime = Math.min(value, duration - END_EPSILON);
|
||||||
setCurrentTime(seekTime);
|
|
||||||
pendingSeekValue.current = seekTime;
|
pendingSeekValue.current = seekTime;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import { LinearGradient } from 'expo-linear-gradient';
|
||||||
import Slider from '@react-native-community/slider';
|
import Slider from '@react-native-community/slider';
|
||||||
import { styles } from '../utils/playerStyles';
|
import { styles } from '../utils/playerStyles';
|
||||||
import { getTrackDisplayName } from '../utils/playerUtils';
|
import { getTrackDisplayName } from '../utils/playerUtils';
|
||||||
|
import { useTheme } from '../../../contexts/ThemeContext';
|
||||||
|
|
||||||
interface PlayerControlsProps {
|
interface PlayerControlsProps {
|
||||||
showControls: boolean;
|
showControls: boolean;
|
||||||
|
|
@ -74,6 +75,7 @@ export const PlayerControls: React.FC<PlayerControlsProps> = ({
|
||||||
buffered,
|
buffered,
|
||||||
formatTime,
|
formatTime,
|
||||||
}) => {
|
}) => {
|
||||||
|
const { currentTheme } = useTheme();
|
||||||
return (
|
return (
|
||||||
<Animated.View
|
<Animated.View
|
||||||
style={[StyleSheet.absoluteFill, { opacity: fadeAnim }]}
|
style={[StyleSheet.absoluteFill, { opacity: fadeAnim }]}
|
||||||
|
|
@ -93,12 +95,12 @@ export const PlayerControls: React.FC<PlayerControlsProps> = ({
|
||||||
onValueChange={onSliderValueChange}
|
onValueChange={onSliderValueChange}
|
||||||
onSlidingStart={onSlidingStart}
|
onSlidingStart={onSlidingStart}
|
||||||
onSlidingComplete={onSlidingComplete}
|
onSlidingComplete={onSlidingComplete}
|
||||||
minimumTrackTintColor="#FFFFFF"
|
minimumTrackTintColor={currentTheme.colors.primary}
|
||||||
maximumTrackTintColor="rgba(255, 255, 255, 0.3)"
|
maximumTrackTintColor={currentTheme.colors.mediumEmphasis}
|
||||||
thumbTintColor={Platform.OS === 'android' ? '#FFFFFF' : undefined}
|
thumbTintColor={Platform.OS === 'android' ? currentTheme.colors.white : undefined}
|
||||||
tapToSeek={Platform.OS === 'ios'}
|
tapToSeek={Platform.OS === 'ios'}
|
||||||
/>
|
/>
|
||||||
<View style={styles.timeDisplay}>
|
<View style={[styles.timeDisplay, { paddingHorizontal: 14 }]}>
|
||||||
<Text style={styles.duration}>{formatTime(currentTime)}</Text>
|
<Text style={styles.duration}>{formatTime(currentTime)}</Text>
|
||||||
<Text style={styles.duration}>{formatTime(duration)}</Text>
|
<Text style={styles.duration}>{formatTime(duration)}</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue