mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-04-15 05:22:44 +01:00
Fix: Improves Chromecast casting experience
Fixes several issues and improves the overall Chromecast casting experience: - Implements an AbortController for fetching item data to prevent race conditions. - Syncs live progress in the mini player more accurately using elapsed real time. - Prevents event propagation in the mini player's play/pause button. - Ensures the disconnect callback in the connection menu is always called. - Retries scrolling in the episode list on failure. - Handles unmute failures gracefully in volume controls. - Clamps seek positions to prevent exceeding duration. - Fixes reporting playback start multiple times - Improves segment calculation in `useChromecastSegments` - Prevents race condition with `isPlaying` state in `Controls` component Also includes minor UI and timing adjustments for a smoother user experience.
This commit is contained in:
@@ -132,9 +132,10 @@ export const ChromecastConnectionMenu: React.FC<
|
||||
if (onDisconnect) {
|
||||
await onDisconnect();
|
||||
}
|
||||
onClose();
|
||||
} catch (error) {
|
||||
console.error("[Connection Menu] Disconnect error:", error);
|
||||
} finally {
|
||||
onClose();
|
||||
}
|
||||
}, [onDisconnect, onClose]);
|
||||
|
||||
@@ -254,13 +255,13 @@ export const ChromecastConnectionMenu: React.FC<
|
||||
onSlidingStart={() => {
|
||||
isSliding.current = true;
|
||||
}}
|
||||
onValueChange={(value) => {
|
||||
onValueChange={async (value) => {
|
||||
volumeValue.value = value;
|
||||
handleVolumeChange(value);
|
||||
if (isMuted) {
|
||||
setIsMuted(false);
|
||||
try {
|
||||
castSession?.setMute(false);
|
||||
await castSession?.setMute(false);
|
||||
} catch (error: unknown) {
|
||||
console.error(
|
||||
"[ChromecastConnectionMenu] Failed to unmute:",
|
||||
|
||||
Reference in New Issue
Block a user