From ea183c426bbf0aaff84609d8211f6ee5dc5095d1 Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Tue, 3 Dec 2024 11:59:22 +0100 Subject: [PATCH] fix: play new item when pressing play button --- components/PlayButton.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/components/PlayButton.tsx b/components/PlayButton.tsx index fef2f91e..22b00324 100644 --- a/components/PlayButton.tsx +++ b/components/PlayButton.tsx @@ -31,6 +31,7 @@ import Animated, { } from "react-native-reanimated"; import { Button } from "./Button"; import { SelectedOptions } from "./ItemContent"; +import { chromecastProfile } from "@/utils/profiles/chromecast"; interface Props extends React.ComponentProps { item: BaseItemDto; @@ -111,18 +112,11 @@ export const PlayButton: React.FC = ({ if (state && state !== PlayServicesState.SUCCESS) CastContext.showPlayServicesErrorDialog(state); else { - // If we're opening a currently playing item, don't restart the media. - // Instead just open controls. - if (isOpeningCurrentlyPlayingMedia) { - CastContext.showExpandedControls(); - return; - } - // Get a new URL with the Chromecast device profile: const data = await getStreamUrl({ api, item, - deviceProfile: ios, + deviceProfile: chromecastProfile, startTimeTicks: item?.UserData?.PlaybackPositionTicks!, userId: user?.Id, audioStreamIndex: selectedOptions.audioIndex,