Compare commits

..

2 Commits

Author SHA1 Message Date
Gauvain
f99400876b fix(player): keep controls visible while settings popover is open
Re-enabling the auto-hide timeout (previous commit) let it fire while the
player settings popover was open, dismissing it mid-interaction — most
visibly on iOS, where the popover lives inside the controls and closes
when they fade out.

Surface the popover's open state up through DropdownView -> HeaderControls
-> Controls and pass it as useControlsTimeout's `disabled` flag, so the
auto-hide pauses while the menu is open and re-arms once it closes. iOS
reports open/close via the SwiftUI Popover binding; Android's menu is a
separate global bottom-sheet modal and is unaffected by controls hiding.
2026-06-01 23:36:42 +02:00
Gauvain
de5e323db4 fix(player): re-enable controls auto-hide timeout
The useControlsTimeout call hardcoded disabled: true (introduced in
the KSPlayer PR #1266), so player controls never auto-hid after the
inactivity timeout and stayed on screen until manually toggled.
Remove the override to restore the intended auto-hide behavior.
2026-06-01 23:32:43 +02:00
3 changed files with 15 additions and 1 deletions

View File

@@ -110,6 +110,10 @@ export const Controls: FC<Props> = ({
const [episodeView, setEpisodeView] = useState(false);
const [showAudioSlider, setShowAudioSlider] = useState(false);
// Pause the controls auto-hide while the player settings popover is open so
// it can't be dismissed out from under the user (notably the iOS popover,
// which lives inside the controls and closes when they fade out).
const [settingsMenuOpen, setSettingsMenuOpen] = useState(false);
const { height: screenHeight, width: screenWidth } = useWindowDimensions();
const { previousItem, nextItem } = usePlaybackManager({
@@ -467,7 +471,7 @@ export const Controls: FC<Props> = ({
episodeView,
onHideControls: hideControls,
timeout: CONTROLS_CONSTANTS.TIMEOUT,
disabled: true,
disabled: settingsMenuOpen,
});
const switchOnEpisodeMode = useCallback(() => {
@@ -528,6 +532,7 @@ export const Controls: FC<Props> = ({
setPlaybackSpeed={setPlaybackSpeed}
showTechnicalInfo={showTechnicalInfo}
onToggleTechnicalInfo={onToggleTechnicalInfo}
onSettingsMenuOpenChange={setSettingsMenuOpen}
/>
</Animated.View>
<Animated.View

View File

@@ -37,6 +37,9 @@ interface HeaderControlsProps {
// Technical info props
showTechnicalInfo?: boolean;
onToggleTechnicalInfo?: () => void;
// Notifies the parent when the settings popover opens/closes so it can pause
// the controls auto-hide while the menu is up.
onSettingsMenuOpenChange?: (open: boolean) => void;
}
export const HeaderControls: FC<HeaderControlsProps> = ({
@@ -57,6 +60,7 @@ export const HeaderControls: FC<HeaderControlsProps> = ({
setPlaybackSpeed,
showTechnicalInfo = false,
onToggleTechnicalInfo,
onSettingsMenuOpenChange,
}) => {
const { settings } = useSettings();
const router = useRouter();
@@ -117,6 +121,7 @@ export const HeaderControls: FC<HeaderControlsProps> = ({
setPlaybackSpeed={setPlaybackSpeed}
showTechnicalInfo={showTechnicalInfo}
onToggleTechnicalInfo={onToggleTechnicalInfo}
onOpenChange={onSettingsMenuOpenChange}
/>
</View>
)}

View File

@@ -20,6 +20,8 @@ interface DropdownViewProps {
setPlaybackSpeed?: (speed: number, scope: PlaybackSpeedScope) => void;
showTechnicalInfo?: boolean;
onToggleTechnicalInfo?: () => void;
/** Forwarded to the popover so the player can pause auto-hide while it's open. */
onOpenChange?: (open: boolean) => void;
}
const DropdownView = ({
@@ -27,6 +29,7 @@ const DropdownView = ({
setPlaybackSpeed,
showTechnicalInfo = false,
onToggleTechnicalInfo,
onOpenChange,
}: DropdownViewProps) => {
const { subtitleTracks, audioTracks } = useVideoContext();
const { item, mediaSource } = usePlayerContext();
@@ -223,6 +226,7 @@ const DropdownView = ({
groups={optionGroups}
trigger={trigger}
expoUIConfig={{}}
onOpenChange={onOpenChange}
bottomSheetConfig={{
enablePanDownToClose: true,
}}