feat: cross-platform titlebar, video transfers and client cleanup
Continuous Integration / build_web (push) Failing after 0s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped
Continuous Integration / build_web (push) Failing after 0s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped
Adds frameless-window controls for Windows/Linux (native traffic lights on macOS), keeps transfers at the current position for video, lets the video player use the same sync/device controls as the media bar, and removes dead code plus assorted UI/perf issues.
This commit is contained in:
1 parent
4bdd0139bf
commit
6675a55957
26 files changed
+561
-316
No files matched your search
@@ -30,7 +30,7 @@ import RemoteControlDialog from "@/components/remoteControl";
|
||||
import RouterLoading from "@/components/routerLoading";
|
||||
import Search from "@/components/search";
|
||||
import Updater from "@/components/updater";
|
||||
import { EasterEgg } from "@/components/utils/easterEgg";
|
||||
import WindowChrome from "@/components/windowControls/windowChrome";
|
||||
|
||||
type ApiContext = {
|
||||
api: Api | undefined;
|
||||
@@ -48,7 +48,6 @@ export const Route = createRootRouteWithContext<ApiContext>()({
|
||||
<ThemeProvider theme={theme}>
|
||||
<SnackbarProvider maxSnack={5}>
|
||||
<CssBaseline />
|
||||
<EasterEgg />
|
||||
{/* <NProgress /> */}
|
||||
|
||||
<RouterLoading />
|
||||
@@ -58,6 +57,7 @@ export const Route = createRootRouteWithContext<ApiContext>()({
|
||||
<Search />
|
||||
<RemoteControlDialog />
|
||||
<AppBar />
|
||||
<WindowChrome />
|
||||
<AudioPlayer />
|
||||
<PlaybackSync />
|
||||
<OverlayScrollbar />
|
||||
|
||||
@@ -6,6 +6,7 @@ import React, { useCallback, useState } from "react";
|
||||
import { NavigationDrawer } from "@/components/appBar/navigationDrawer";
|
||||
import CastButton from "@/components/buttons/castButton";
|
||||
import { UserAvatarMenu } from "@/components/userAvatarMenu";
|
||||
import WindowControls from "@/components/windowControls";
|
||||
import useSearchStore from "@/utils/store/search";
|
||||
|
||||
type HomeHeaderProps = {
|
||||
@@ -95,6 +96,7 @@ const HomeHeader = ({ libraries, onNewAndPopular }: HomeHeaderProps) => {
|
||||
<span className="material-symbols-rounded">favorite</span>
|
||||
</IconButton>
|
||||
<UserAvatarMenu />
|
||||
<WindowControls />
|
||||
</div>
|
||||
</header>
|
||||
<NavigationDrawer
|
||||
|
||||
@@ -176,9 +176,20 @@ export function VideoPlayer() {
|
||||
|
||||
const handleReady = async () => {
|
||||
if (api && !isPlayerReady && player.current) {
|
||||
player.current.currentTime = ticksToSec(
|
||||
userDataLastPlayedPositionTicks ?? 0,
|
||||
);
|
||||
const target = ticksToSec(userDataLastPlayedPositionTicks ?? 0);
|
||||
const seekToStartPosition = () => {
|
||||
if (!player.current) return;
|
||||
if (usePlaybackStore.getState().metadata.item?.Id !== itemId) return;
|
||||
const drift = Math.abs(player.current.currentTime - target);
|
||||
if (target > 1 && drift > 5) {
|
||||
player.current.currentTime = target;
|
||||
}
|
||||
};
|
||||
player.current.currentTime = target;
|
||||
// HLS players can reset their position once the manifest loads;
|
||||
// re-apply the transfer/resume position after startup.
|
||||
window.setTimeout(seekToStartPosition, 700);
|
||||
window.setTimeout(seekToStartPosition, 1800);
|
||||
|
||||
if (navigator.mediaSession && mediaSource) {
|
||||
navigator.mediaSession.metadata = new MediaMetadata({
|
||||
@@ -527,7 +538,7 @@ export function VideoPlayer() {
|
||||
}
|
||||
}, []);
|
||||
|
||||
const idleTimerRef = useRef<NodeJS.Timeout | null>(null);
|
||||
const idleTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
|
||||
// Function to clear the existing idle timer
|
||||
const clearIdleTimer = useCallback(() => {
|
||||
|
||||
Reference in new issue
Block a user