Blend the colour wash between titles and keep full screen for the miniplayer
- The backdrop's colour wash is one layer whose corner colours are registered custom properties, so a change of title blends them instead of stacking a half-opacity layer and removing the old one (which made the colour jump). Outgoing artwork fades out before it is removed, and quick changes keep the layer that is on screen. - Going to the miniplayer no longer leaves full screen. Esc while browsing leaves full screen first, Windows' caption buttons show Exit full screen in place of maximize, closing the miniplayer keeps the window as it is, and the player's full-screen state follows changes made outside it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
8755d16735
commit
b5dc5d8666
6 changed files with 135 additions and 54 deletions
|
|
@ -702,10 +702,12 @@ export const usePlayer = create<PlayerState>((set, get) => ({
|
|||
playServer = s;
|
||||
playDownload = download;
|
||||
localScrobbled = false;
|
||||
// From the miniplayer the window may have gone full screen (or left it) since.
|
||||
const fullscreenNow = await win.isFullscreen().catch(() => false);
|
||||
if (stale()) return;
|
||||
if (!previous.open) {
|
||||
triedFallback = false;
|
||||
wasFullscreenBeforePlay = await win.isFullscreen().catch(() => false);
|
||||
if (stale()) return;
|
||||
wasFullscreenBeforePlay = fullscreenNow;
|
||||
}
|
||||
set({
|
||||
open: true,
|
||||
|
|
@ -730,7 +732,7 @@ export const usePlayer = create<PlayerState>((set, get) => ({
|
|||
audioKey: opts.tracks?.audioKey ?? '',
|
||||
subKey: opts.tracks?.subKey ?? '__init',
|
||||
video: null,
|
||||
fullscreen: wasFullscreenBeforePlay,
|
||||
fullscreen: fullscreenNow,
|
||||
mini: false,
|
||||
videoGamma: '',
|
||||
enhance: { ...previous.enhance, bypass: false, preparing: false },
|
||||
|
|
@ -856,8 +858,12 @@ export const usePlayer = create<PlayerState>((set, get) => ({
|
|||
await mpv.show(false).catch(() => {});
|
||||
}
|
||||
set({ open: false, mini: false, item: null, delivery: null, error: '', terminated: false, countdown: null, nextUp: null, prevUp: null, firstFrame: false });
|
||||
const fs = await win.isFullscreen().catch(() => false);
|
||||
if (fs && !wasFullscreenBeforePlay) win.setFullscreen(false);
|
||||
// Closing the full player hands back the window it found; closing the
|
||||
// miniplayer leaves browsing as it is, full screen or not.
|
||||
if (!st.mini) {
|
||||
const fs = await win.isFullscreen().catch(() => false);
|
||||
if (fs && !wasFullscreenBeforePlay) win.setFullscreen(false);
|
||||
}
|
||||
if (st.item) invalidateLibrary();
|
||||
},
|
||||
|
||||
|
|
@ -913,12 +919,8 @@ export const usePlayer = create<PlayerState>((set, get) => ({
|
|||
async minimize() {
|
||||
const st = get();
|
||||
if (!st.open || st.mini) return;
|
||||
// Full screen stays for browsing; Esc or the window controls leave it.
|
||||
set({ mini: true });
|
||||
// Full screen was for the video; browsing goes back to the window.
|
||||
if (st.fullscreen && !wasFullscreenBeforePlay) {
|
||||
await win.setFullscreen(false).catch(() => {});
|
||||
set({ fullscreen: false });
|
||||
}
|
||||
if (separateMini) {
|
||||
// Once the page is opaque again (no video in it), the video moves into
|
||||
// the miniplayer's own window (miniWindow.ts).
|
||||
|
|
@ -1025,6 +1027,13 @@ usePlayer.subscribe((st, prev) => {
|
|||
|
||||
bridgeMiniWindow(usePlayer);
|
||||
|
||||
// Full screen can change outside the player (Esc or the window controls while
|
||||
// browsing with the miniplayer, the OS): the player's controls follow it.
|
||||
win.onResized(() => {
|
||||
if (!usePlayer.getState().open) return;
|
||||
win.isFullscreen().then((fs) => usePlayer.getState().fullscreen !== fs && usePlayer.setState({ fullscreen: fs }), () => {});
|
||||
});
|
||||
|
||||
/**
|
||||
* Signing out, or switching server or profile, ends a stream from the old one: its
|
||||
* progress belongs to that account. A download keeps playing, without reporting.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue