From 3c5f2b407955c9934f3065b6d1bc0feaa2ff39b8 Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Sat, 4 Jan 2025 13:04:23 +0100 Subject: [PATCH] fix: controls gray overlay --- app/(auth)/player/direct-player.tsx | 1 - app/(auth)/player/transcoding-player.tsx | 1 - app/login.tsx | 242 +++++++++--------- components/video-player/controls/Controls.tsx | 140 +++++----- .../dropdown/DropdownViewTranscoding.tsx | 9 +- 5 files changed, 188 insertions(+), 205 deletions(-) diff --git a/app/(auth)/player/direct-player.tsx b/app/(auth)/player/direct-player.tsx index 5b6d086d..4d924938 100644 --- a/app/(auth)/player/direct-player.tsx +++ b/app/(auth)/player/direct-player.tsx @@ -435,7 +435,6 @@ export default function page() { position: "relative", flexDirection: "column", justifyContent: "center", - opacity: showControls ? (Platform.OS === "android" ? 0.7 : 0.5) : 1, }} > { position: "relative", flexDirection: "column", justifyContent: "center", - opacity: showControls ? 0.5 : 1, }} > {videoSource ? ( diff --git a/app/login.tsx b/app/login.tsx index e3636469..54aa03a8 100644 --- a/app/login.tsx +++ b/app/login.tsx @@ -189,133 +189,129 @@ const Login: React.FC = () => { } }; - if (api?.basePath) { - return ( - - - - - - - Log in - <> - {serverName ? ( - <> - {" to "} - {serverName} - - ) : null} - - - {api.basePath} - - setCredentials({ ...credentials, username: text }) - } - value={credentials.username} - autoFocus - secureTextEntry={false} - keyboardType="default" - returnKeyType="done" - autoCapitalize="none" - textContentType="username" - clearButtonMode="while-editing" - maxLength={500} - /> - - - setCredentials({ ...credentials, password: text }) - } - value={credentials.password} - secureTextEntry - keyboardType="default" - returnKeyType="done" - autoCapitalize="none" - textContentType="password" - clearButtonMode="while-editing" - maxLength={500} - /> - - - {error} - - - - - - - - - - ); - } - return ( - + - - - - Streamyfin - - Enter the URL to your Jellyfin server - - - - Make sure to include http or https - - { - handleConnect(s.address); - }} - /> - - - - - + {api?.basePath ? ( + <> + + + + + Log in + <> + {serverName ? ( + <> + {" to "} + {serverName} + + ) : null} + + + + {api.basePath} + + + setCredentials({ ...credentials, username: text }) + } + value={credentials.username} + autoFocus + secureTextEntry={false} + keyboardType="default" + returnKeyType="done" + autoCapitalize="none" + textContentType="username" + clearButtonMode="while-editing" + maxLength={500} + /> + + + setCredentials({ ...credentials, password: text }) + } + value={credentials.password} + secureTextEntry + keyboardType="default" + returnKeyType="done" + autoCapitalize="none" + textContentType="password" + clearButtonMode="while-editing" + maxLength={500} + /> + + + {error} + + + + + + + + + ) : ( + <> + + + + Streamyfin + + Enter the URL to your Jellyfin server + + + + Make sure to include http or https + + { + handleConnect(s.address); + }} + /> + + + + + + + )} ); diff --git a/components/video-player/controls/Controls.tsx b/components/video-player/controls/Controls.tsx index d7386134..2fd1cba3 100644 --- a/components/video-player/controls/Controls.tsx +++ b/components/video-player/controls/Controls.tsx @@ -497,33 +497,6 @@ export const Controls: React.FC = ({ /> ) : ( <> - - - {!mediaSource?.TranscodingUrl ? ( - - ) : ( - - )} - - - { toggleControls(); @@ -532,6 +505,8 @@ export const Controls: React.FC = ({ position: "absolute", width: Dimensions.get("window").width, height: Dimensions.get("window").height, + backgroundColor: "black", + opacity: showControls ? 0.5 : 0, }} > @@ -541,61 +516,82 @@ export const Controls: React.FC = ({ position: "absolute", top: settings?.safeAreaInControlsEnabled ? insets.top : 0, right: settings?.safeAreaInControlsEnabled ? insets.right : 0, + width: settings?.safeAreaInControlsEnabled + ? Dimensions.get("window").width - insets.left - insets.right + : Dimensions.get("window").width, opacity: showControls ? 1 : 0, }, ]} pointerEvents={showControls ? "auto" : "none"} - className={`flex flex-row items-center space-x-2 z-10 p-4 `} + className={`flex flex-row w-full p-4 `} > - {item?.Type === "Episode" && !offline && ( + + + {!mediaSource?.TranscodingUrl ? ( + + ) : ( + + )} + + + + + {item?.Type === "Episode" && !offline && ( + { + switchOnEpisodeMode(); + }} + className="aspect-square flex flex-col bg-neutral-800/90 rounded-xl items-center justify-center p-2" + > + + + )} + {previousItem && !offline && ( + + + + )} + + {nextItem && !offline && ( + + + + )} + + {mediaSource?.TranscodingUrl && ( + + + + )} { - switchOnEpisodeMode(); + onPress={async () => { + Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); + router.back(); }} className="aspect-square flex flex-col bg-neutral-800/90 rounded-xl items-center justify-center p-2" > - + - )} - {previousItem && !offline && ( - - - - )} - - {nextItem && !offline && ( - - - - )} - - {mediaSource?.TranscodingUrl && ( - - - - )} - { - Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); - router.back(); - }} - className="aspect-square flex flex-col bg-neutral-800/90 rounded-xl items-center justify-center p-2" - > - - + = ({ showControls }) => { ); return ( - +