Release Kaleido Desktop 0.1.0-beta.15
All checks were successful
Validate Kaleido Desktop / validate (push) Successful in 2m7s
All checks were successful
Validate Kaleido Desktop / validate (push) Successful in 2m7s
This commit is contained in:
parent
59e00cde4b
commit
0361a98fa4
13 changed files with 711 additions and 128 deletions
|
|
@ -14,6 +14,7 @@ import { separateMini } from './miniWindow';
|
|||
import { PREPARING_NOTICE_MS, UPSCALING_ORDER, hasFailed, readDiagnostics, requestEnhancement, tierAvailable, toggleBypass, type Diagnostics } from './enhance';
|
||||
import { toast } from '../ui/overlays';
|
||||
import type { Item } from '../plex/types';
|
||||
import { PostPlay } from './PostPlay';
|
||||
|
||||
const HIDE_AFTER = 3000;
|
||||
|
||||
|
|
@ -527,7 +528,8 @@ function SkipButton() {
|
|||
if (!marker) return;
|
||||
settled.current.add(key);
|
||||
setPending(null);
|
||||
seek(marker.end / 1000);
|
||||
if (marker.type === 'credits' && item?.type === 'episode') usePlayer.getState().showPostPlay();
|
||||
else seek(marker.end / 1000);
|
||||
};
|
||||
const cancel = () => {
|
||||
if (!pending) return;
|
||||
|
|
@ -568,7 +570,6 @@ function SkipButton() {
|
|||
}, [counting]);
|
||||
|
||||
if (!marker || mode === 'off' || countdown !== null) return null;
|
||||
if (marker.type === 'credits' && nextUp) return null;
|
||||
const what = marker.type === 'intro' ? 'intro' : 'credits';
|
||||
const elapsed = counting ? Math.max(0, position - counting.from) : 0;
|
||||
return (
|
||||
|
|
@ -588,41 +589,6 @@ function SkipButton() {
|
|||
);
|
||||
}
|
||||
|
||||
function PostPlay() {
|
||||
const server = useSession((s) => s.server);
|
||||
const nextUp = usePlayer((s) => s.nextUp);
|
||||
const countdown = usePlayer((s) => s.countdown);
|
||||
const playNext = usePlayer((s) => s.playNext);
|
||||
const cancel = usePlayer((s) => s.cancelCountdown);
|
||||
if (!nextUp || countdown === null || !server) return null;
|
||||
return (
|
||||
<div className="post-play" onClick={(e) => e.stopPropagation()} onDoubleClick={(e) => e.stopPropagation()}>
|
||||
<div className="post-play-art">
|
||||
<img src={server.image(nextUp.thumb, 360, 202)} alt="" draggable={false} />
|
||||
{countdown > 0 && (
|
||||
<svg className="post-play-ring" viewBox="0 0 40 40">
|
||||
<circle cx="20" cy="20" r="17" />
|
||||
</svg>
|
||||
)}
|
||||
</div>
|
||||
<div className="post-play-text">
|
||||
<span className="micro">Next episode{countdown > 0 ? ` in ${countdown}` : ''}</span>
|
||||
<b>
|
||||
{episodeLabel(nextUp)} · {nextUp.title}
|
||||
</b>
|
||||
<div className="actions">
|
||||
<Button variant="primary" size="sm" icon="play" onClick={playNext}>
|
||||
Play now
|
||||
</Button>
|
||||
<Button variant="ghost" size="sm" onClick={cancel}>
|
||||
{countdown > 0 ? 'Cancel' : 'Dismiss'}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/** The title opens its show or movie page, with playback moving to the miniplayer. */
|
||||
function openFromPlayer(id: string | undefined) {
|
||||
if (!id) return;
|
||||
|
|
@ -844,6 +810,9 @@ export function PlayerOverlay() {
|
|||
useEffect(() => {
|
||||
if (!st.open || st.mini) return;
|
||||
const onKey = async (e: KeyboardEvent) => {
|
||||
// Up Next owns Tab, Space/Enter and Escape; player shortcuts must not
|
||||
// seek or change volume while a viewer is browsing its episode rows.
|
||||
if (usePlayer.getState().postPlay) return;
|
||||
if ((e.target as HTMLElement)?.tagName === 'INPUT' && (e.target as HTMLInputElement).type !== 'range') return;
|
||||
const p = usePlayer.getState();
|
||||
let handled = true;
|
||||
|
|
@ -951,6 +920,7 @@ export function PlayerOverlay() {
|
|||
if (!st.open || !st.item) return null;
|
||||
// On Windows the miniplayer is a window of its own (miniWindow.ts).
|
||||
if (st.mini) return separateMini ? null : <MiniPlayer />;
|
||||
if (st.postPlay && !st.error) return <PostPlay key={st.item.id} />;
|
||||
const item = st.item;
|
||||
const loading = !st.firstFrame && !st.error;
|
||||
const art = item.type === 'episode' ? item.grandparentArt || item.art : item.art;
|
||||
|
|
@ -1036,7 +1006,6 @@ export function PlayerOverlay() {
|
|||
)}
|
||||
|
||||
<SkipButton />
|
||||
<PostPlay />
|
||||
|
||||
{!st.error && (
|
||||
<div className="player-bottom" onClick={(e) => e.stopPropagation()} onDoubleClick={(e) => e.stopPropagation()}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue