mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-01-11 20:10:25 +00:00
fixing exo crash and some UI flaws
This commit is contained in:
parent
3d5a9ebf42
commit
486ea63a8a
1 changed files with 24 additions and 5 deletions
|
|
@ -115,6 +115,13 @@ export const PlayerControls: React.FC<PlayerControlsProps> = ({
|
|||
/* Animations - State & Refs */
|
||||
const [showBackwardSign, setShowBackwardSign] = React.useState(false);
|
||||
const [showForwardSign, setShowForwardSign] = React.useState(false);
|
||||
const [previewTime, setPreviewTime] = React.useState(currentTime);
|
||||
const isSlidingRef = React.useRef(false);
|
||||
React.useEffect(() => {
|
||||
if (!isSlidingRef.current) {
|
||||
setPreviewTime(currentTime);
|
||||
}
|
||||
}, [currentTime]);
|
||||
|
||||
/* Separate Animations for Each Button */
|
||||
const backwardPressAnim = React.useRef(new Animated.Value(0)).current;
|
||||
|
|
@ -280,10 +287,22 @@ export const PlayerControls: React.FC<PlayerControlsProps> = ({
|
|||
}}
|
||||
minimumValue={0}
|
||||
maximumValue={duration || 1}
|
||||
value={currentTime}
|
||||
onValueChange={onSliderValueChange}
|
||||
onSlidingStart={onSlidingStart}
|
||||
onSlidingComplete={onSlidingComplete}
|
||||
|
||||
value={previewTime}
|
||||
|
||||
onValueChange={(v) => setPreviewTime(v)}
|
||||
|
||||
onSlidingStart={() => {
|
||||
isSlidingRef.current = true;
|
||||
onSlidingStart();
|
||||
}}
|
||||
|
||||
onSlidingComplete={(v) => {
|
||||
isSlidingRef.current = false;
|
||||
setPreviewTime(v);
|
||||
onSlidingComplete(v);
|
||||
}}
|
||||
|
||||
minimumTrackTintColor={currentTheme.colors.primary}
|
||||
maximumTrackTintColor={currentTheme.colors.mediumEmphasis}
|
||||
thumbTintColor={Platform.OS === 'android' ? currentTheme.colors.white : undefined}
|
||||
|
|
@ -608,4 +627,4 @@ export const PlayerControls: React.FC<PlayerControlsProps> = ({
|
|||
);
|
||||
};
|
||||
|
||||
export default PlayerControls;
|
||||
export default PlayerControls;
|
||||
|
|
|
|||
Loading…
Reference in a new issue