fix(player): a Restart of the paused film plays the new session; a key on faded bands only shows them
The same-film restart read the paused state, restarted the session without play, and resumed the outgoing stream beside it. Space or Enter on a control the bands had faded from pressed it unseen; now it only brings them back, and Space plays or pauses.
This commit is contained in:
@@ -90,6 +90,8 @@ export function useControlsVisibility(opts: {
|
||||
videoRef: RefObject<HTMLVideoElement | null>;
|
||||
}): {
|
||||
uiVisible: boolean;
|
||||
/** Whether the bands are up right now — for a key handler that runs before the next render. */
|
||||
controlsShown: () => boolean;
|
||||
wake: () => void;
|
||||
holdOnHover: (over: boolean) => void;
|
||||
holdOnFocus: (on: boolean) => void;
|
||||
@@ -132,6 +134,7 @@ export function useControlsVisibility(opts: {
|
||||
[wake, menuOpenRef, setVisible],
|
||||
);
|
||||
const toggle = useCallback(() => show(!visibleRef.current), [show]);
|
||||
const controlsShown = useCallback(() => visibleRef.current, []);
|
||||
const holdOnHover = useCallback(
|
||||
(over: boolean) => {
|
||||
hovered.current = over;
|
||||
@@ -162,7 +165,7 @@ export function useControlsVisibility(opts: {
|
||||
},
|
||||
[],
|
||||
);
|
||||
return { uiVisible, wake, holdOnHover, holdOnFocus, toggle, show };
|
||||
return { uiVisible, controlsShown, wake, holdOnHover, holdOnFocus, toggle, show };
|
||||
}
|
||||
|
||||
// Periodic + on-unmount progress checkpoint. Reads live position/duration through refs (owned by the
|
||||
|
||||
Reference in New Issue
Block a user