mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-04-22 01:01:56 +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 */
|
/* Animations - State & Refs */
|
||||||
const [showBackwardSign, setShowBackwardSign] = React.useState(false);
|
const [showBackwardSign, setShowBackwardSign] = React.useState(false);
|
||||||
const [showForwardSign, setShowForwardSign] = 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 */
|
/* Separate Animations for Each Button */
|
||||||
const backwardPressAnim = React.useRef(new Animated.Value(0)).current;
|
const backwardPressAnim = React.useRef(new Animated.Value(0)).current;
|
||||||
|
|
@ -280,10 +287,22 @@ export const PlayerControls: React.FC<PlayerControlsProps> = ({
|
||||||
}}
|
}}
|
||||||
minimumValue={0}
|
minimumValue={0}
|
||||||
maximumValue={duration || 1}
|
maximumValue={duration || 1}
|
||||||
value={currentTime}
|
|
||||||
onValueChange={onSliderValueChange}
|
value={previewTime}
|
||||||
onSlidingStart={onSlidingStart}
|
|
||||||
onSlidingComplete={onSlidingComplete}
|
onValueChange={(v) => setPreviewTime(v)}
|
||||||
|
|
||||||
|
onSlidingStart={() => {
|
||||||
|
isSlidingRef.current = true;
|
||||||
|
onSlidingStart();
|
||||||
|
}}
|
||||||
|
|
||||||
|
onSlidingComplete={(v) => {
|
||||||
|
isSlidingRef.current = false;
|
||||||
|
setPreviewTime(v);
|
||||||
|
onSlidingComplete(v);
|
||||||
|
}}
|
||||||
|
|
||||||
minimumTrackTintColor={currentTheme.colors.primary}
|
minimumTrackTintColor={currentTheme.colors.primary}
|
||||||
maximumTrackTintColor={currentTheme.colors.mediumEmphasis}
|
maximumTrackTintColor={currentTheme.colors.mediumEmphasis}
|
||||||
thumbTintColor={Platform.OS === 'android' ? currentTheme.colors.white : undefined}
|
thumbTintColor={Platform.OS === 'android' ? currentTheme.colors.white : undefined}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue