From 67648ea6db986f6a7c94b50413c8b3f6307d76d2 Mon Sep 17 00:00:00 2001 From: tapframe Date: Fri, 12 Sep 2025 23:09:38 +0530 Subject: [PATCH] imrpoved android videoplayer logic --- src/components/player/AndroidVideoPlayer.tsx | 2 +- src/components/player/controls/PlayerControls.tsx | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/player/AndroidVideoPlayer.tsx b/src/components/player/AndroidVideoPlayer.tsx index 2176f0f..165cd58 100644 --- a/src/components/player/AndroidVideoPlayer.tsx +++ b/src/components/player/AndroidVideoPlayer.tsx @@ -647,7 +647,7 @@ const AndroidVideoPlayer: React.FC = () => { const handleSliderValueChange = (value: number) => { if (isDragging && duration > 0) { const seekTime = Math.min(value, duration - END_EPSILON); - setCurrentTime(seekTime); + pendingSeekValue.current = seekTime; } }; diff --git a/src/components/player/controls/PlayerControls.tsx b/src/components/player/controls/PlayerControls.tsx index 945f2cb..9c445e8 100644 --- a/src/components/player/controls/PlayerControls.tsx +++ b/src/components/player/controls/PlayerControls.tsx @@ -5,6 +5,7 @@ import { LinearGradient } from 'expo-linear-gradient'; import Slider from '@react-native-community/slider'; import { styles } from '../utils/playerStyles'; import { getTrackDisplayName } from '../utils/playerUtils'; +import { useTheme } from '../../../contexts/ThemeContext'; interface PlayerControlsProps { showControls: boolean; @@ -74,6 +75,7 @@ export const PlayerControls: React.FC = ({ buffered, formatTime, }) => { + const { currentTheme } = useTheme(); return ( = ({ onValueChange={onSliderValueChange} onSlidingStart={onSlidingStart} onSlidingComplete={onSlidingComplete} - minimumTrackTintColor="#FFFFFF" - maximumTrackTintColor="rgba(255, 255, 255, 0.3)" - thumbTintColor={Platform.OS === 'android' ? '#FFFFFF' : undefined} + minimumTrackTintColor={currentTheme.colors.primary} + maximumTrackTintColor={currentTheme.colors.mediumEmphasis} + thumbTintColor={Platform.OS === 'android' ? currentTheme.colors.white : undefined} tapToSeek={Platform.OS === 'ios'} /> - + {formatTime(currentTime)} {formatTime(duration)}