fix: pause stream during huddle
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "expo start",
|
"start": "expo start -c",
|
||||||
"ios": "expo run:ios --device",
|
"ios": "expo run:ios --device",
|
||||||
"publish:ios": "eas build --platform ios --auto-submit && echo 'Go to App Store Connect and submit the testflight build for app review. Visit for more information: https://docs.expo.dev/submit/introduction/'",
|
"publish:ios": "eas build --platform ios --auto-submit && echo 'Go to App Store Connect and submit the testflight build for app review. Visit for more information: https://docs.expo.dev/submit/introduction/'",
|
||||||
"android": "expo run:android",
|
"android": "expo run:android",
|
||||||
|
|||||||
@@ -118,6 +118,13 @@ function StreamViewInner({ streamParticle, path, onExit }: StreamViewProps) {
|
|||||||
const [holdActive, setHoldActive] = useState(false);
|
const [holdActive, setHoldActive] = useState(false);
|
||||||
useSuspendPlayback(holdActive, "touch-hold");
|
useSuspendPlayback(holdActive, "touch-hold");
|
||||||
|
|
||||||
|
// Suspend playback whenever another screen (Huddle, NewStream, modals
|
||||||
|
// routed as screens) is on top. Native stack keeps StreamView mounted, so
|
||||||
|
// without this the stream would keep advancing — and the exit countdown
|
||||||
|
// would fire — behind the huddle.
|
||||||
|
const isFocused = useIsFocused();
|
||||||
|
useSuspendPlayback(!isFocused, "screen-unfocused");
|
||||||
|
|
||||||
// Reaction sheet — opens via swipe-up on the canvas.
|
// Reaction sheet — opens via swipe-up on the canvas.
|
||||||
const [reactionsOpen, setReactionsOpen] = useState(false);
|
const [reactionsOpen, setReactionsOpen] = useState(false);
|
||||||
|
|
||||||
@@ -386,11 +393,9 @@ function StreamViewInner({ streamParticle, path, onExit }: StreamViewProps) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// --- End-of-stream countdown ---
|
// --- End-of-stream countdown ---
|
||||||
// Pause the countdown when this screen isn't focused (e.g. a Huddle screen
|
// `paused` already reflects unfocused state via the "screen-unfocused"
|
||||||
// is mounted on top). Otherwise the timer keeps ticking under the huddle
|
// suspender registered above, so the countdown freezes under the huddle.
|
||||||
// and goBack() pops the huddle out from under the user.
|
const exitRemainingMs = useExitCountdown(status, paused, exit);
|
||||||
const isFocused = useIsFocused();
|
|
||||||
const exitRemainingMs = useExitCountdown(status, paused || !isFocused, exit);
|
|
||||||
|
|
||||||
// Chrome reservations: top = safe-area + segmented bar (3) + gap (12) +
|
// Chrome reservations: top = safe-area + segmented bar (3) + gap (12) +
|
||||||
// metadata row (~38) + breathing room (12). Bottom = safe-area + compose
|
// metadata row (~38) + breathing room (12). Bottom = safe-area + compose
|
||||||
|
|||||||
Reference in New Issue
Block a user