Compare commits
No commits in common. "main" and "v0.1.0-beta.15" have entirely different histories.
main
...
v0.1.0-bet
24 changed files with 740 additions and 1094 deletions
56
CHANGELOG.md
56
CHANGELOG.md
|
|
@ -1,61 +1,5 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## 1.0.1
|
|
||||||
|
|
||||||
A quicker start, a Stop button, and recovery when the server drops out mid-video.
|
|
||||||
|
|
||||||
- Kaleido starts faster: the opening animation is shorter, so you reach your library in about a second.
|
|
||||||
- The player has a Stop button, next to the forward controls, which closes the player completely instead of moving it to the miniplayer.
|
|
||||||
- If your Plex server goes down while you're watching, the player waits for it once the buffered video runs out, then carries on from the same spot when the server is back. Before, it treated the video as finished and Play started it again from the beginning. Pressing Play while it waits tries to reconnect straight away.
|
|
||||||
|
|
||||||
## 1.0.0
|
|
||||||
|
|
||||||
Kaleido is out of beta. This release reworks the show and season pages and smooths out watching a series.
|
|
||||||
|
|
||||||
- Season pages show their episodes as a grid of cards, each with its still, description and watched state, in place of the long episode list.
|
|
||||||
- Click the season's name under the show's logo to switch to another season.
|
|
||||||
- Show pages list seasons once, as a row of posters. A show with only one season shows its episodes directly.
|
|
||||||
- Episodes you've watched stay marked as watched when you rewatch them and stop partway through. The leftover position only shows on the episode you're up to.
|
|
||||||
- When the next episode plays, whether automatically or with Next, it starts from the beginning instead of near the end of an earlier viewing.
|
|
||||||
- Click a show's name under a Continue Watching card to go to the show.
|
|
||||||
- Continue Watching starts at the first title when something new is added, instead of scrolling it off the left edge.
|
|
||||||
- Season posters outside their show's page, such as New Seasons, are labelled with the show's name.
|
|
||||||
- Season pages show the year the season aired, and their Play button agrees with the show page about which episode is next.
|
|
||||||
- Movie and episode pages show the runtime in their details, with the time left on the Resume button.
|
|
||||||
|
|
||||||
## 0.1.0-beta.19
|
|
||||||
|
|
||||||
Up Next fixes.
|
|
||||||
|
|
||||||
- Up Next now opens every time the credits start: going back to the credits and seeking into the episode brings it back when they come round again, and it always opens when an episode reaches the end.
|
|
||||||
- The back arrow and a full-screen button are back at the top of Up Next, so you can return to browsing (playback continues in the miniplayer) or leave full screen.
|
|
||||||
- Click the show's logo to go to its page, with playback moving to the miniplayer.
|
|
||||||
- The Play next episode countdown fills smoothly.
|
|
||||||
- The episode rows are sized to fill the screen instead of leaving a gap at the bottom.
|
|
||||||
- The backdrop now shows the next episode, and its description is easier to read over bright artwork.
|
|
||||||
|
|
||||||
## 0.1.0-beta.18
|
|
||||||
|
|
||||||
A rebuilt Up Next screen that looks and works like the rest of Kaleido.
|
|
||||||
|
|
||||||
- Up Next now uses the same artwork backdrop, colour wash, buttons and cards as the title pages. The credits keep playing in the top-left corner beside the next episode, and the Play next episode button fills as the countdown runs.
|
|
||||||
- The Season and Related shows rows scroll with the side arrows, like every other row, instead of scrollbars. The season row starts at the episode you just watched.
|
|
||||||
- Click the video or press Esc to go back to the credits; at the end of an episode this no longer restarts it from the beginning.
|
|
||||||
- Up Next fits smaller windows, and the window buttons stay visible on Mac while it's open.
|
|
||||||
- Playback settings are a simple list again: Skip intros, Skip movie credits, Automatic skip delay and Autoplay next episode.
|
|
||||||
|
|
||||||
## 0.1.0-beta.17
|
|
||||||
|
|
||||||
- Fix the Up Next countdown stalling when the native video has keyboard focus instead of the webview. Count elapsed time accurately through delayed timer callbacks, and keep the countdown independent of the video's pause state, as on Android TV.
|
|
||||||
- Open Up Next at the first episode credit marker, including after seeking into credits, independently of movie-credit skip preferences. Open the screen immediately while episode context loads, and start autoplay once the next episode is known. Without markers, use the end of the episode as a fallback.
|
|
||||||
- Cancel autoplay on mouse movement, clicks, scrolling or keypresses. A stationary pointer does not cancel it; cancelled autoplay stays cancelled when delayed metadata arrives.
|
|
||||||
- Match the Android TV screen more closely: remove the extra toolbar actions, Cancel autoplay button and autoplay-status text; show only a white video outline on hover or keyboard focus. Use compact episode metadata, full runtime, landscape related shows and captions beneath the artwork.
|
|
||||||
|
|
||||||
## 0.1.0-beta.16
|
|
||||||
|
|
||||||
- Simplify playback settings: group intro, credits and skip-delay choices together, show the delay only when automatic skipping is enabled, and combine the next-episode switch and countdown into one Off / After … seconds selection. Existing preferences are preserved.
|
|
||||||
- Make Up Next readable over bright artwork with a dark backdrop across the page, brighter secondary text and larger synopsis and autoplay hints. The playing video stays at its original brightness.
|
|
||||||
|
|
||||||
## 0.1.0-beta.15
|
## 0.1.0-beta.15
|
||||||
|
|
||||||
A new Up Next screen, adapted from Kaleido for Android TV for mouse and keyboard.
|
A new Up Next screen, adapted from Kaleido for Android TV for mouse and keyboard.
|
||||||
|
|
|
||||||
|
|
@ -47,11 +47,13 @@ Playback tests change real Plex progress; resume an in-progress title near its s
|
||||||
position, or restore it afterwards. Selecting audio or subtitle tracks is saved to Plex
|
position, or restore it afterwards. Selecting audio or subtitle tracks is saved to Plex
|
||||||
for that file.
|
for that file.
|
||||||
|
|
||||||
Up Next (`player/PostPlay.tsx`) opens at an episode's first credits marker, or at the end
|
Up Next: automatic episode credits open the screen immediately; button-only credits
|
||||||
without markers. The video is drawn into its top-left frame (`player_rect`) behind a
|
open it on click, and EOF opens it regardless of the credits preference. There is one
|
||||||
matching hole in the page; check that the two line up after resizing, changing display
|
autoplay timer. Clicks, keypresses (including Tab), and scrolling cancel it; pointer
|
||||||
scale and returning to the video. In the browser, open it from the console by setting
|
movement leaves it running. Esc returns to the video; F/F11 toggles full screen.
|
||||||
`postPlay: true` (with `item`, `nextUp`, `episodeContextReady`) on `__kaleido.usePlayer`.
|
The video rectangle must follow window resizes and DPI changes and return to the full
|
||||||
|
window on dismissal, episode changes, errors, and closing. Verify those native video
|
||||||
|
transitions on a GPU-equipped machine; browser layout checks cannot prove rendering.
|
||||||
|
|
||||||
## Diagnostics
|
## Diagnostics
|
||||||
|
|
||||||
|
|
|
||||||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "kaleido-desktop",
|
"name": "kaleido-desktop",
|
||||||
"version": "1.0.1",
|
"version": "0.1.0-beta.15",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "kaleido-desktop",
|
"name": "kaleido-desktop",
|
||||||
"version": "1.0.1",
|
"version": "0.1.0-beta.15",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource-variable/inter": "^5.3.0",
|
"@fontsource-variable/inter": "^5.3.0",
|
||||||
"@tanstack/react-query": "^5.105.0",
|
"@tanstack/react-query": "^5.105.0",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "kaleido-desktop",
|
"name": "kaleido-desktop",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.0.1",
|
"version": "0.1.0-beta.15",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|
|
||||||
2
src-tauri/Cargo.lock
generated
2
src-tauri/Cargo.lock
generated
|
|
@ -2173,7 +2173,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "kaleido"
|
name = "kaleido"
|
||||||
version = "1.0.1"
|
version = "0.1.0-beta.15"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"fs2",
|
"fs2",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "kaleido"
|
name = "kaleido"
|
||||||
version = "1.0.1"
|
version = "0.1.0-beta.15"
|
||||||
description = "Kaleido — a Plex client for Windows"
|
description = "Kaleido — a Plex client for Windows"
|
||||||
authors = ["Elijah"]
|
authors = ["Elijah"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "Kaleido",
|
"productName": "Kaleido",
|
||||||
"version": "1.0.1",
|
"version": "0.1.0-beta.15",
|
||||||
"identifier": "tv.kaleido.desktop",
|
"identifier": "tv.kaleido.desktop",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "npm run dev",
|
"beforeDevCommand": "npm run dev",
|
||||||
|
|
|
||||||
|
|
@ -36,19 +36,10 @@ export function progress(item: Item): number {
|
||||||
return Math.min(1, Math.max(0, item.viewOffset / item.duration));
|
return Math.min(1, Math.max(0, item.viewOffset / item.duration));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Watched once Plex has counted a full play. A rewatch left partway through keeps the
|
|
||||||
* title watched; its position only matters for resuming (`resumable`).
|
|
||||||
*/
|
|
||||||
export function isWatched(item: Item, percent = 90): boolean {
|
export function isWatched(item: Item, percent = 90): boolean {
|
||||||
if (item.type === 'show' || item.type === 'season') return item.leafCount > 0 && item.viewedLeafCount >= item.leafCount;
|
if (item.type === 'show' || item.type === 'season') return item.leafCount > 0 && item.viewedLeafCount >= item.leafCount;
|
||||||
if (item.viewCount > 0) return true;
|
if (item.viewOffset > 0 && item.duration > 0) return item.viewCount > 0 && item.viewOffset / item.duration >= percent / 100;
|
||||||
return item.viewOffset > 0 && item.duration > 0 && item.viewOffset / item.duration >= percent / 100;
|
return item.viewCount > 0;
|
||||||
}
|
|
||||||
|
|
||||||
/** Has a saved position worth resuming from (not one at the very end). */
|
|
||||||
export function resumable(item: Item): boolean {
|
|
||||||
return item.viewOffset > 0 && item.duration > 0 && item.viewOffset < item.duration * 0.97;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function remainingEpisodes(item: Item): number {
|
export function remainingEpisodes(item: Item): number {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
/**
|
/**
|
||||||
* Arrow-key movement between titles, for keyboard users. Focus moves to the
|
* Arrow-key movement between titles, for keyboard users. Focus moves to the
|
||||||
* nearest card in the pressed direction (by on-screen geometry), so it works
|
* nearest card in the pressed direction (by on-screen geometry), so it works
|
||||||
* the same across shelves, grids and people rows.
|
* the same across shelves, grids, episode lists and people rows.
|
||||||
*/
|
*/
|
||||||
const TARGETS = '.card, .person-card:not(:disabled), .shelf-title-link';
|
const TARGETS = '.card, .person-card:not(:disabled), .episode-row, .shelf-title-link';
|
||||||
|
|
||||||
function center(r: DOMRect) {
|
function center(r: DOMRect) {
|
||||||
return { x: r.left + r.width / 2, y: r.top + r.height / 2 };
|
return { x: r.left + r.width / 2, y: r.top + r.height / 2 };
|
||||||
|
|
|
||||||
|
|
@ -506,8 +506,8 @@ function SkipButton() {
|
||||||
const item = usePlayer((s) => s.item);
|
const item = usePlayer((s) => s.item);
|
||||||
const position = usePlayer((s) => s.position);
|
const position = usePlayer((s) => s.position);
|
||||||
const seek = usePlayer((s) => s.seek);
|
const seek = usePlayer((s) => s.seek);
|
||||||
|
const nextUp = usePlayer((s) => s.nextUp);
|
||||||
const countdown = usePlayer((s) => s.countdown);
|
const countdown = usePlayer((s) => s.countdown);
|
||||||
const postPlayDismissed = usePlayer((s) => s.postPlayDismissed);
|
|
||||||
const paused = usePlayer((s) => s.paused);
|
const paused = usePlayer((s) => s.paused);
|
||||||
const ready = usePlayer((s) => s.firstFrame);
|
const ready = usePlayer((s) => s.firstFrame);
|
||||||
const lastSeek = usePlayer((s) => s.lastSeek);
|
const lastSeek = usePlayer((s) => s.lastSeek);
|
||||||
|
|
@ -520,9 +520,8 @@ function SkipButton() {
|
||||||
const ms = position * 1000;
|
const ms = position * 1000;
|
||||||
const marker = item?.markers.find((m) => (m.type === 'intro' || m.type === 'credits') && ms >= m.start && ms < m.end - 1000);
|
const marker = item?.markers.find((m) => (m.type === 'intro' || m.type === 'credits') && ms >= m.start && ms < m.end - 1000);
|
||||||
const key = item && marker ? `${item.id}:${marker.type}:${marker.start}` : '';
|
const key = item && marker ? `${item.id}:${marker.type}:${marker.start}` : '';
|
||||||
const episodeCredits = marker?.type === 'credits' && item?.type === 'episode';
|
const mode = marker?.type === 'intro' ? skipIntro : skipCredits;
|
||||||
const mode = marker?.type === 'intro' ? skipIntro : episodeCredits ? 'button' : skipCredits;
|
const auto = !!marker && mode === 'auto' && !(marker.type === 'credits' && nextUp);
|
||||||
const auto = !!marker && !episodeCredits && mode === 'auto';
|
|
||||||
const counting = pending && pending.key === key ? pending : null;
|
const counting = pending && pending.key === key ? pending : null;
|
||||||
|
|
||||||
const skip = () => {
|
const skip = () => {
|
||||||
|
|
@ -570,7 +569,7 @@ function SkipButton() {
|
||||||
return () => window.removeEventListener('keydown', onKey, true);
|
return () => window.removeEventListener('keydown', onKey, true);
|
||||||
}, [counting]);
|
}, [counting]);
|
||||||
|
|
||||||
if (!marker || (episodeCredits && !postPlayDismissed) || mode === 'off' || countdown !== null) return null;
|
if (!marker || mode === 'off' || countdown !== null) return null;
|
||||||
const what = marker.type === 'intro' ? 'intro' : 'credits';
|
const what = marker.type === 'intro' ? 'intro' : 'credits';
|
||||||
const elapsed = counting ? Math.max(0, position - counting.from) : 0;
|
const elapsed = counting ? Math.max(0, position - counting.from) : 0;
|
||||||
return (
|
return (
|
||||||
|
|
@ -758,7 +757,7 @@ function MiniPlayer() {
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="mini-center">
|
<div className="mini-center">
|
||||||
{(loading || st.buffering || st.reconnecting) && !st.error ? (
|
{(loading || st.buffering) && !st.error ? (
|
||||||
<Spinner size={30} />
|
<Spinner size={30} />
|
||||||
) : st.error ? (
|
) : st.error ? (
|
||||||
<span className="mini-error">Playback stopped</span>
|
<span className="mini-error">Playback stopped</span>
|
||||||
|
|
@ -911,7 +910,7 @@ export function PlayerOverlay() {
|
||||||
}, [st.open, st.mini, seekStep, poke]);
|
}, [st.open, st.mini, seekStep, poke]);
|
||||||
|
|
||||||
// The macOS traffic lights fade with the rest of the player's chrome.
|
// The macOS traffic lights fade with the rest of the player's chrome.
|
||||||
const chromeHidden = st.open && !st.mini && !st.postPlay && !visible && st.firstFrame && !st.error;
|
const chromeHidden = st.open && !st.mini && !visible && st.firstFrame && !st.error;
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!chromeHidden) return;
|
if (!chromeHidden) return;
|
||||||
win.setButtonsVisible(false);
|
win.setButtonsVisible(false);
|
||||||
|
|
@ -965,12 +964,10 @@ export function PlayerOverlay() {
|
||||||
{!st.fullscreen && <WindowControls />}
|
{!st.fullscreen && <WindowControls />}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{(loading || st.buffering || st.seeking || preparing || st.reconnecting) && !st.error && (
|
{(loading || st.buffering || st.seeking || preparing) && !st.error && (
|
||||||
<div className="player-center">
|
<div className="player-center">
|
||||||
<Spinner size={44} />
|
<Spinner size={44} />
|
||||||
{st.reconnecting ? (
|
{preparing && (
|
||||||
<p className="player-preparing">Lost connection to {server?.name ?? 'the server'}</p>
|
|
||||||
) : preparing && (
|
|
||||||
<p className="player-preparing">
|
<p className="player-preparing">
|
||||||
Preparing {UPSCALING[st.enhance.active].label} upscaling
|
Preparing {UPSCALING[st.enhance.active].label} upscaling
|
||||||
<small>First time on this computer only</small>
|
<small>First time on this computer only</small>
|
||||||
|
|
@ -1025,8 +1022,6 @@ export function PlayerOverlay() {
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="player-controls-center">
|
<div className="player-controls-center">
|
||||||
{/* Balances Stop on the other side, so play/pause stays centred. */}
|
|
||||||
<span className="player-icon-spacer" aria-hidden="true" />
|
|
||||||
{/* Both episode buttons stay for episodes (dimmed at either end) so play/pause holds its place. */}
|
{/* Both episode buttons stay for episodes (dimmed at either end) so play/pause holds its place. */}
|
||||||
{item.type === 'episode' && (
|
{item.type === 'episode' && (
|
||||||
<button
|
<button
|
||||||
|
|
@ -1059,9 +1054,6 @@ export function PlayerOverlay() {
|
||||||
<Icon name="skipNext" size={22} />
|
<Icon name="skipNext" size={22} />
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
<button className="player-icon" aria-label="Stop playback" title="Stop" onClick={() => st.close()}>
|
|
||||||
<Icon name="stop" size={19} />
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="player-controls-right">
|
<div className="player-controls-right">
|
||||||
<button className={`player-icon${panel === 'tracks' ? ' on' : ''}${st.subKey ? ' lit' : ''}`} aria-label="Audio and subtitles" onClick={() => setPanel(panel === 'tracks' ? '' : 'tracks')}>
|
<button className={`player-icon${panel === 'tracks' ? ' on' : ''}${st.subKey ? ' lit' : ''}`} aria-label="Audio and subtitles" onClick={() => setPanel(panel === 'tracks' ? '' : 'tracks')}>
|
||||||
|
|
|
||||||
|
|
@ -1,334 +1,179 @@
|
||||||
import { useEffect, useLayoutEffect, useMemo, useRef } from 'react';
|
import { useEffect, useRef, useState, type CSSProperties } from 'react';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import { usePlayer } from './store';
|
import { usePlayer } from './store';
|
||||||
import { mpv } from './engine';
|
import { mpv } from './engine';
|
||||||
import { isNative } from '../platform/native';
|
import { isNative } from '../platform/native';
|
||||||
import { useSession } from '../app/session';
|
import { useSession } from '../app/session';
|
||||||
import { navigate } from '../app/router';
|
import { navigate } from '../app/router';
|
||||||
import { art, clock, duration, episodeLabel } from '../app/format';
|
import { clock, episodeLabel } from '../app/format';
|
||||||
import * as api from '../plex/api';
|
import * as api from '../plex/api';
|
||||||
import type { Item } from '../plex/types';
|
import type { Item } from '../plex/types';
|
||||||
import { Backdrop } from '../ui/Backdrop';
|
import { Backdrop } from '../ui/Backdrop';
|
||||||
import { Facts, Shelf, TitleArt } from '../ui/media';
|
import { Facts, TitleArt } from '../ui/media';
|
||||||
import { Artwork } from '../ui/primitives';
|
|
||||||
import { Icon } from '../ui/Icon';
|
import { Icon } from '../ui/Icon';
|
||||||
import { WindowControls } from '../app/TopBar';
|
import { WindowControls } from '../app/TopBar';
|
||||||
|
|
||||||
/**
|
/** One Up Next screen, with a transparent opening over the native video. */
|
||||||
* Up Next, adapted from Kaleido for Android TV: the credits keep playing in the
|
|
||||||
* top-left corner (the native video is drawn into that rectangle, with a matching
|
|
||||||
* hole in the page) beside the next episode, with the season and related shows
|
|
||||||
* below. Play next episode carries the one countdown; moving the mouse, clicking,
|
|
||||||
* scrolling or pressing a key stops it. Clicking the video, or Esc, returns to it.
|
|
||||||
*/
|
|
||||||
export function PostPlay() {
|
export function PostPlay() {
|
||||||
const item = usePlayer((s) => s.item)!;
|
const st = usePlayer();
|
||||||
const nextUp = usePlayer((s) => s.nextUp);
|
|
||||||
const contextReady = usePlayer((s) => s.episodeContextReady);
|
|
||||||
const fullscreen = usePlayer((s) => s.fullscreen);
|
|
||||||
const server = useSession((s) => s.server);
|
const server = useSession((s) => s.server);
|
||||||
const root = useRef<HTMLDivElement>(null);
|
const root = useRef<HTMLDivElement>(null);
|
||||||
const video = useRef<HTMLButtonElement>(null);
|
const video = useRef<HTMLButtonElement>(null);
|
||||||
const play = useRef<HTMLButtonElement>(null);
|
const play = useRef<HTMLButtonElement>(null);
|
||||||
|
const currentEpisode = useRef<HTMLButtonElement>(null);
|
||||||
// The listed episode lacks the rating and full synopsis.
|
const [season, setSeason] = useState<Item[]>([]);
|
||||||
const details = useQuery({
|
const [related, setRelated] = useState<Item[]>([]);
|
||||||
queryKey: [server?.machineId, 'item', nextUp?.id],
|
const [details, setDetails] = useState<Item | null>(null);
|
||||||
queryFn: () => api.metadata(server!, nextUp!.id),
|
const item = st.item!;
|
||||||
enabled: !!server && !!nextUp,
|
const upcoming = details?.id === st.nextUp?.id ? details : st.nextUp;
|
||||||
staleTime: 30_000,
|
const counting = st.countdown !== null;
|
||||||
});
|
|
||||||
const upcoming = nextUp && details.data?.id === nextUp.id ? details.data : nextUp;
|
|
||||||
|
|
||||||
useVideoRect(root, video);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
currentEpisode.current?.scrollIntoView({ block: 'nearest', inline: 'center' });
|
||||||
|
}, [season]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!server) return;
|
||||||
|
let alive = true;
|
||||||
|
if (item.parentId) api.children(server, item.parentId).then((items) => alive && setSeason(items), () => {});
|
||||||
|
if (item.grandparentId) api.related(server, item.grandparentId).then((hubs) => {
|
||||||
|
const seen = new Set<string>([item.grandparentId]);
|
||||||
|
const shows = hubs.flatMap((h) => h.items).filter((i) => i.type === 'show' && !seen.has(i.id) && !!seen.add(i.id));
|
||||||
|
if (alive) setRelated(shows);
|
||||||
|
}, () => {});
|
||||||
|
return () => { alive = false; };
|
||||||
|
}, [server, item.id]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!server || !st.nextUp) return;
|
||||||
|
let alive = true;
|
||||||
|
api.metadata(server, st.nextUp.id).then((next) => alive && setDetails(next), () => {});
|
||||||
|
return () => { alive = false; };
|
||||||
|
}, [server, st.nextUp?.id]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const previous = document.activeElement as HTMLElement | null;
|
||||||
(play.current ?? video.current)?.focus({ preventScroll: true });
|
(play.current ?? video.current)?.focus({ preventScroll: true });
|
||||||
const stop = () => {
|
const cancel = () => usePlayer.getState().cancelCountdown();
|
||||||
if (usePlayer.getState().countdown !== null) usePlayer.getState().cancelCountdown();
|
|
||||||
};
|
|
||||||
// Layout changes can send a mousemove without the mouse moving.
|
|
||||||
const move = (e: MouseEvent) => (e.movementX || e.movementY) && stop();
|
|
||||||
const key = (e: KeyboardEvent) => {
|
const key = (e: KeyboardEvent) => {
|
||||||
stop();
|
cancel();
|
||||||
if (e.key === 'Escape' || e.key === 'Backspace') {
|
if (e.key === 'Escape' || e.key === 'Backspace') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
e.stopImmediatePropagation();
|
||||||
usePlayer.getState().dismissPostPlay();
|
usePlayer.getState().dismissPostPlay();
|
||||||
} else if (e.key === 'F11' || ((e.key === 'f' || e.key === 'F') && !e.ctrlKey && !e.metaKey && !e.altKey)) {
|
} else if (e.key === 'F11' || (e.key.toLowerCase() === 'f' && !e.ctrlKey && !e.metaKey && !e.altKey)) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
usePlayer.getState().toggleFullscreen();
|
usePlayer.getState().toggleFullscreen();
|
||||||
|
} else if (e.key === 'Tab') {
|
||||||
|
// Keep keyboard focus in the player, including after Shift+Tab.
|
||||||
|
const buttons = [...root.current!.querySelectorAll<HTMLButtonElement>('button:not(:disabled)')];
|
||||||
|
const first = buttons[0], last = buttons[buttons.length - 1];
|
||||||
|
if (e.shiftKey && document.activeElement === first) { e.preventDefault(); last?.focus(); }
|
||||||
|
else if (!e.shiftKey && document.activeElement === last) { e.preventDefault(); first?.focus(); }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const opts = { capture: true, passive: true };
|
|
||||||
window.addEventListener('keydown', key, true);
|
window.addEventListener('keydown', key, true);
|
||||||
window.addEventListener('pointerdown', stop, opts);
|
window.addEventListener('pointerdown', cancel, true);
|
||||||
window.addEventListener('mousemove', move, opts);
|
window.addEventListener('wheel', cancel, { capture: true, passive: true });
|
||||||
window.addEventListener('wheel', stop, opts);
|
|
||||||
return () => {
|
return () => {
|
||||||
window.removeEventListener('keydown', key, true);
|
window.removeEventListener('keydown', key, true);
|
||||||
window.removeEventListener('pointerdown', stop, opts);
|
window.removeEventListener('pointerdown', cancel, true);
|
||||||
window.removeEventListener('mousemove', move, opts);
|
window.removeEventListener('wheel', cancel, true);
|
||||||
window.removeEventListener('wheel', stop, opts);
|
if (previous?.isConnected) previous.focus({ preventScroll: true });
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const backToVideo = () => usePlayer.getState().dismissPostPlay();
|
useEffect(() => {
|
||||||
// As in the player: the show page opens with playback moving to the miniplayer.
|
const el = video.current;
|
||||||
const openShow = () => {
|
if (!el) return;
|
||||||
usePlayer.getState().minimize();
|
let frame = 0;
|
||||||
navigate({ name: 'item', id: item.grandparentId });
|
|
||||||
};
|
|
||||||
// The next episode's own still, as on Android TV: darker than most show art, so the copy reads.
|
|
||||||
const scene = upcoming ?? item;
|
|
||||||
const sceneArt = useMemo(() => ({ ...scene, grandparentArt: scene.thumb || scene.grandparentArt }), [scene]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="player up-next" ref={root} role="dialog" aria-modal="true" aria-labelledby="up-next-label">
|
|
||||||
<div className="up-next-scene">{server && <Backdrop item={sceneArt} className="up-next-backdrop" />}</div>
|
|
||||||
<div className="player-top up-next-top" data-tauri-drag-region={isNative ? true : undefined}>
|
|
||||||
<button className="player-back" onClick={() => usePlayer.getState().minimize()} aria-label="Back to browsing" title="Keep playing in the corner">
|
|
||||||
<Icon name="arrowLeft" size={22} />
|
|
||||||
</button>
|
|
||||||
<button className="player-icon up-next-fullscreen" aria-label={fullscreen ? 'Exit full screen' : 'Full screen'} title={fullscreen ? 'Exit full screen' : 'Full screen'} onClick={() => usePlayer.getState().toggleFullscreen()}>
|
|
||||||
<Icon name={fullscreen ? 'collapse' : 'expand'} size={21} />
|
|
||||||
</button>
|
|
||||||
{!fullscreen && <WindowControls />}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="up-next-head">
|
|
||||||
<div className="up-next-now">
|
|
||||||
<button ref={video} className="up-next-video" onClick={backToVideo} aria-label={`Return to ${item.title}`} />
|
|
||||||
<NowPlaying item={item} />
|
|
||||||
</div>
|
|
||||||
<div className="up-next-info">
|
|
||||||
<span className="micro" id="up-next-label">
|
|
||||||
{upcoming || !contextReady ? 'Up next' : 'More to watch'}
|
|
||||||
</span>
|
|
||||||
{item.grandparentId ? (
|
|
||||||
<button className="player-title-link up-next-logo" title={`Go to ${item.grandparentTitle}`} onClick={openShow}>
|
|
||||||
<TitleArt item={item} maxWidth={300} maxHeight={64} as="h2" />
|
|
||||||
</button>
|
|
||||||
) : (
|
|
||||||
<TitleArt item={item} maxWidth={300} maxHeight={64} as="h2" className="up-next-logo" />
|
|
||||||
)}
|
|
||||||
{upcoming ? (
|
|
||||||
<>
|
|
||||||
<h1>{upcoming.title}</h1>
|
|
||||||
<Facts item={{ ...upcoming, viewOffset: 0, originallyAvailableAt: '' }} withFormats={false} />
|
|
||||||
{upcoming.summary && <p className="up-next-summary">{upcoming.summary}</p>}
|
|
||||||
<PlayNext ref={play} />
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
contextReady && <p className="up-next-summary">You’ve reached the end of this series.</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{server && <UpNextRows item={item} nextUp={nextUp} />}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Draws the native video into the frame's rectangle and cuts the same hole in
|
|
||||||
* the page, following window resizes and display scale changes.
|
|
||||||
*/
|
|
||||||
function useVideoRect(root: React.RefObject<HTMLDivElement | null>, frame: React.RefObject<HTMLElement | null>) {
|
|
||||||
useLayoutEffect(() => {
|
|
||||||
const el = frame.current;
|
|
||||||
const page = root.current;
|
|
||||||
if (!el || !page) return;
|
|
||||||
let raf = 0;
|
|
||||||
const place = () => {
|
const place = () => {
|
||||||
cancelAnimationFrame(raf);
|
cancelAnimationFrame(frame);
|
||||||
raf = requestAnimationFrame(() => {
|
frame = requestAnimationFrame(() => {
|
||||||
const r = el.getBoundingClientRect();
|
const r = el.getBoundingClientRect();
|
||||||
page.style.setProperty('--up-x', `${r.x}px`);
|
const style = root.current!.style;
|
||||||
page.style.setProperty('--up-y', `${r.y}px`);
|
for (const [key, value] of Object.entries({ x: r.x, y: r.y, w: r.width, h: r.height })) style.setProperty(`--up-video-${key}`, `${value}px`);
|
||||||
page.style.setProperty('--up-w', `${r.width}px`);
|
|
||||||
page.style.setProperty('--up-h', `${r.height}px`);
|
|
||||||
page.classList.add('placed');
|
|
||||||
const dpr = window.devicePixelRatio || 1;
|
const dpr = window.devicePixelRatio || 1;
|
||||||
// A pixel of overdraw on each side keeps the hole covered at any scale.
|
|
||||||
if (isNative) mpv.rect({ x: r.x * dpr - 1, y: r.y * dpr - 1, width: r.width * dpr + 2, height: r.height * dpr + 2 }).catch(() => {});
|
if (isNative) mpv.rect({ x: r.x * dpr - 1, y: r.y * dpr - 1, width: r.width * dpr + 2, height: r.height * dpr + 2 }).catch(() => {});
|
||||||
|
root.current!.classList.add('placed');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const ro = new ResizeObserver(place);
|
const observer = new ResizeObserver(place);
|
||||||
ro.observe(el);
|
observer.observe(el);
|
||||||
window.addEventListener('resize', place);
|
window.addEventListener('resize', place);
|
||||||
place();
|
place();
|
||||||
return () => {
|
return () => {
|
||||||
cancelAnimationFrame(raf);
|
cancelAnimationFrame(frame);
|
||||||
ro.disconnect();
|
observer.disconnect();
|
||||||
window.removeEventListener('resize', place);
|
window.removeEventListener('resize', place);
|
||||||
if (isNative) mpv.rect(null).catch(() => {});
|
if (isNative) mpv.rect(null).catch(() => {});
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
}
|
|
||||||
|
|
||||||
/** Where the playing episode is, under the video. Its own subscription: position ticks re-render only this. */
|
|
||||||
function NowPlaying({ item }: { item: Item }) {
|
|
||||||
const position = usePlayer((s) => s.position);
|
|
||||||
const total = usePlayer((s) => s.duration);
|
|
||||||
return (
|
|
||||||
<div className="up-next-progress">
|
|
||||||
<div className="up-next-progress-text">
|
|
||||||
<span>
|
|
||||||
{episodeLabel(item)} · {item.title}
|
|
||||||
</span>
|
|
||||||
<small>−{clock(Math.max(0, total - position))}</small>
|
|
||||||
</div>
|
|
||||||
<div className="up-next-progress-bar">
|
|
||||||
<i style={{ width: `${total ? Math.min(100, (position / total) * 100) : 0}%` }} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Play next episode. While autoplay counts down, a lighter fill sweeps across it.
|
|
||||||
* The store counts in 50 ms steps; the fill is drawn every frame between them.
|
|
||||||
*/
|
|
||||||
function PlayNext({ ref }: { ref: React.Ref<HTMLButtonElement> }) {
|
|
||||||
const counting = usePlayer((s) => s.countdown !== null && s.countdownTotal > 0);
|
|
||||||
const fill = useRef<HTMLSpanElement>(null);
|
|
||||||
useEffect(() => {
|
|
||||||
if (!counting) return;
|
|
||||||
let last = { value: usePlayer.getState().countdown ?? 0, at: performance.now() };
|
|
||||||
const unsubscribe = usePlayer.subscribe((s, prev) => {
|
|
||||||
if (s.countdown !== prev.countdown && s.countdown !== null) last = { value: s.countdown, at: performance.now() };
|
|
||||||
});
|
|
||||||
let raf = 0;
|
|
||||||
const draw = () => {
|
|
||||||
const { countdownTotal: total } = usePlayer.getState();
|
|
||||||
// Run on from the last step, but never more than a couple of steps ahead (a held countdown stays held).
|
|
||||||
const remaining = Math.max(0, last.value - Math.min(performance.now() - last.at, 120) / 1000);
|
|
||||||
if (fill.current && total) fill.current.style.transform = `scaleX(${1 - remaining / total})`;
|
|
||||||
raf = requestAnimationFrame(draw);
|
|
||||||
};
|
|
||||||
draw();
|
|
||||||
return () => {
|
|
||||||
unsubscribe();
|
|
||||||
cancelAnimationFrame(raf);
|
|
||||||
};
|
|
||||||
}, [counting]);
|
|
||||||
return (
|
|
||||||
<button ref={ref} className={`btn primary lg up-next-play${counting ? ' counting' : ''}`} onClick={() => usePlayer.getState().playNext()}>
|
|
||||||
{counting && <span className="up-next-play-fill" ref={fill} aria-hidden="true" />}
|
|
||||||
<Icon name="play" size={17} />
|
|
||||||
<span>Play next episode</span>
|
|
||||||
</button>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function UpNextRows({ item, nextUp }: { item: Item; nextUp: Item | null }) {
|
|
||||||
const server = useSession((s) => s.server)!;
|
|
||||||
const season = useQuery({
|
|
||||||
queryKey: [server.machineId, 'children', item.parentId],
|
|
||||||
queryFn: () => api.children(server, item.parentId),
|
|
||||||
enabled: !!item.parentId,
|
|
||||||
staleTime: 30_000,
|
|
||||||
});
|
|
||||||
const related = useQuery({
|
|
||||||
queryKey: [server.machineId, 'related', item.grandparentId],
|
|
||||||
queryFn: () => api.related(server, item.grandparentId),
|
|
||||||
enabled: !!item.grandparentId,
|
|
||||||
staleTime: 10 * 60_000,
|
|
||||||
});
|
|
||||||
const episodes = (season.data ?? []).filter((e) => e.type === 'episode');
|
|
||||||
const seen = new Set([item.grandparentId]);
|
|
||||||
const shows = (related.data ?? []).flatMap((h) => h.items).filter((i) => i.type === 'show' && !seen.has(i.id) && !!seen.add(i.id));
|
|
||||||
|
|
||||||
// The season row starts just before the playing episode.
|
|
||||||
const seasonRow = useRef<HTMLDivElement>(null);
|
|
||||||
useLayoutEffect(() => {
|
|
||||||
const row = seasonRow.current?.querySelector<HTMLElement>('.shelf');
|
|
||||||
const current = row?.querySelector<HTMLElement>('[aria-current]');
|
|
||||||
if (!row || !current) return;
|
|
||||||
const start = (current.previousElementSibling as HTMLElement | null) ?? current;
|
|
||||||
const target = row.scrollLeft + start.getBoundingClientRect().left - row.getBoundingClientRect().left - parseFloat(getComputedStyle(row).paddingLeft);
|
|
||||||
row.scrollTo({ left: target, behavior: 'instant' });
|
|
||||||
}, [episodes.length]);
|
|
||||||
|
|
||||||
|
const watch = () => {
|
||||||
|
if (st.ended) st.togglePause();
|
||||||
|
st.dismissPostPlay();
|
||||||
|
};
|
||||||
const choose = (episode: Item) => {
|
const choose = (episode: Item) => {
|
||||||
const st = usePlayer.getState();
|
if (episode.id === item.id) watch();
|
||||||
if (episode.id === item.id) st.dismissPostPlay();
|
|
||||||
else st.play(episode, { resume: true, quality: st.quality });
|
else st.play(episode, { resume: true, quality: st.quality });
|
||||||
};
|
};
|
||||||
const browse = async (show: Item) => {
|
const browse = async (show: Item) => {
|
||||||
await usePlayer.getState().close();
|
await st.close();
|
||||||
navigate({ name: 'item', id: show.id, title: show.title });
|
navigate({ name: 'item', id: show.id, title: show.title });
|
||||||
};
|
};
|
||||||
if (!episodes.length && !shows.length) return null;
|
const rail = (label: string, items: Item[], episodes: boolean) => items.length > 0 && (
|
||||||
|
<section className="up-next-rail" aria-label={label}>
|
||||||
|
<h2>{label}</h2>
|
||||||
|
<div className="up-next-cards">
|
||||||
|
{items.map((entry) => (
|
||||||
|
<button key={entry.id} ref={entry.id === item.id ? currentEpisode : undefined} className={`up-next-card${episodes ? '' : ' poster'}`} onClick={() => episodes ? choose(entry) : void browse(entry)} aria-current={entry.id === item.id ? 'true' : undefined}>
|
||||||
|
<div className="up-next-card-art">
|
||||||
|
{server && entry.thumb && <img src={server.image(entry.thumb, episodes ? 360 : 220, episodes ? 202 : 330)} alt="" loading="lazy" draggable={false} />}
|
||||||
|
{(entry.id === item.id || entry.id === st.nextUp?.id) && <span>{entry.id === item.id ? 'Now playing' : 'Up next'}</span>}
|
||||||
|
</div>
|
||||||
|
<b>{episodes ? `${episodeLabel(entry)} · ${entry.title}` : entry.title}</b>
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="up-next-rows">
|
<div className="player up-next" ref={root} role="dialog" aria-modal="true" aria-labelledby="up-next-heading">
|
||||||
{episodes.length > 0 && (
|
<div className="up-next-scene">{server && <Backdrop item={upcoming ?? item} />}</div>
|
||||||
<div ref={seasonRow}>
|
<header className="up-next-toolbar" data-tauri-drag-region={isNative ? true : undefined}>
|
||||||
<Shelf title={item.parentIndex ? `Season ${item.parentIndex}` : 'Episodes'} kind="landscape" className="up-next-shelf">
|
<button className="up-next-back" onClick={watch} title="Return to video (Esc)"><Icon name="arrowLeft" size={18} /> Return to video</button>
|
||||||
{episodes.map((ep) => (
|
<button className="up-next-back" onClick={() => st.close()}>Done watching</button>
|
||||||
<UpNextCard
|
{st.fullscreen && <button className="up-next-back" onClick={() => st.toggleFullscreen()} aria-label="Exit full screen" title="Exit full screen (F11)"><Icon name="collapse" size={18} /></button>}
|
||||||
key={ep.id}
|
{!st.fullscreen && <WindowControls />}
|
||||||
item={ep}
|
</header>
|
||||||
current={ep.id === item.id}
|
<div className="up-next-header">
|
||||||
caption={ep.id === item.id ? 'Now playing' : ep.id === nextUp?.id ? 'Up next' : duration(ep.duration)}
|
<div className="up-next-now">
|
||||||
onChoose={() => choose(ep)}
|
<button ref={video} className="up-next-video" onClick={watch} aria-label={`Return to ${item.title}`}><span><Icon name="expand" size={20} /> Return to video</span></button>
|
||||||
/>
|
<div className="up-next-caption"><span>{episodeLabel(item)} · {item.title}</span><small>{st.ended ? 'Finished' : `−${clock(Math.max(0, st.duration - st.position))}`}</small></div>
|
||||||
))}
|
<div className="up-next-progress"><i style={{ width: `${st.duration ? Math.min(100, st.position / st.duration * 100) : 0}%` }} /></div>
|
||||||
</Shelf>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
<div className="up-next-details">
|
||||||
{shows.length > 0 && (
|
<span className="micro" id="up-next-heading">{upcoming ? 'Up next' : 'More to watch'}</span>
|
||||||
<Shelf title="Related shows" kind="landscape" className="up-next-shelf">
|
<TitleArt item={item} maxWidth={280} maxHeight={52} as="h2" />
|
||||||
{shows.map((show) => (
|
{upcoming ? <>
|
||||||
<UpNextCard key={show.id} item={show} caption={show.year ? String(show.year) : ''} onChoose={() => void browse(show)} />
|
<h1>{upcoming.title}</h1>
|
||||||
))}
|
<Facts item={upcoming} withFormats={false} />
|
||||||
</Shelf>
|
{upcoming.summary && <p className="up-next-summary">{upcoming.summary}</p>}
|
||||||
)}
|
<div className="actions">
|
||||||
|
<button ref={play} className={`up-next-play${counting ? ' counting' : ''}`} style={{ '--p': `${counting && st.countdownTotal ? (1 - st.countdown! / st.countdownTotal) * 100 : 0}%` } as CSSProperties} onClick={() => st.playNext()}>
|
||||||
|
<span><Icon name="play" size={18} /> Play next episode</span>
|
||||||
|
</button>
|
||||||
|
{counting && <button className="up-next-cancel" onClick={() => st.cancelCountdown()}>Cancel autoplay</button>}
|
||||||
|
</div>
|
||||||
|
<p className="up-next-hint" role="status">{counting ? 'Autoplay is on · Click, scroll or press any key to cancel' : 'Autoplay is off for this episode'}</p>
|
||||||
|
</> : <p className="up-next-summary">You’ve reached the end of this series.</p>}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="up-next-rows">
|
||||||
|
{rail(item.parentIndex ? `Season ${item.parentIndex}` : 'Episodes', season, true)}
|
||||||
|
{rail('Related shows', related, false)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function UpNextCard({ item, caption, current, onChoose }: { item: Item; caption: string; current?: boolean; onChoose: () => void }) {
|
|
||||||
const server = useSession((s) => s.server)!;
|
|
||||||
const episode = item.type === 'episode';
|
|
||||||
const title = episode ? `${item.index}. ${item.title}` : item.title;
|
|
||||||
const progress = episode && !current && item.viewOffset && item.duration ? item.viewOffset / item.duration : 0;
|
|
||||||
return (
|
|
||||||
<article
|
|
||||||
className="card landscape"
|
|
||||||
role="button"
|
|
||||||
tabIndex={0}
|
|
||||||
aria-label={title}
|
|
||||||
aria-current={current || undefined}
|
|
||||||
onClick={onChoose}
|
|
||||||
onKeyDown={(e) => {
|
|
||||||
if (e.key !== 'Enter' && e.key !== ' ') return;
|
|
||||||
e.preventDefault();
|
|
||||||
onChoose();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div className="card-cover">
|
|
||||||
<Artwork src={server.image(art.landscape(item), 400, 225)} alt="" fallback={<span className="cover-fallback">{title}</span>} />
|
|
||||||
<div className="card-hover" />
|
|
||||||
{episode && !current && (
|
|
||||||
<div className="card-actions">
|
|
||||||
<span className="card-play" aria-hidden="true">
|
|
||||||
<Icon name="play" size={18} />
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{progress > 0 && (
|
|
||||||
<span className="progress-line">
|
|
||||||
<i style={{ width: `${Math.max(3, progress * 100)}%` }} />
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<div className="card-caption">
|
|
||||||
<div className="card-title" title={title}>
|
|
||||||
{title}
|
|
||||||
</div>
|
|
||||||
{caption && <div className="card-meta">{caption}</div>}
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ interface PlayerView {
|
||||||
duration: number;
|
duration: number;
|
||||||
firstFrame: boolean;
|
firstFrame: boolean;
|
||||||
buffering: boolean;
|
buffering: boolean;
|
||||||
reconnecting: boolean;
|
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -51,8 +50,7 @@ function view(st: PlayerView): MiniState {
|
||||||
position: st.position,
|
position: st.position,
|
||||||
duration: st.duration,
|
duration: st.duration,
|
||||||
loading: !st.firstFrame && !st.error,
|
loading: !st.firstFrame && !st.error,
|
||||||
// Waiting for the server to come back shows as buffering.
|
buffering: st.buffering,
|
||||||
buffering: st.buffering || st.reconnecting,
|
|
||||||
error: !!st.error,
|
error: !!st.error,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ import type { MpvEvent } from './engine';
|
||||||
const harness = vi.hoisted(() => {
|
const harness = vi.hoisted(() => {
|
||||||
const memory = new Map<string, string>();
|
const memory = new Map<string, string>();
|
||||||
vi.stubGlobal('localStorage', { getItem: (k: string) => memory.get(k) ?? null, setItem: (k: string, v: string) => memory.set(k, v), removeItem: (k: string) => memory.delete(k) });
|
vi.stubGlobal('localStorage', { getItem: (k: string) => memory.get(k) ?? null, setItem: (k: string, v: string) => memory.set(k, v), removeItem: (k: string) => memory.delete(k) });
|
||||||
vi.stubGlobal('document', Object.assign(new EventTarget(), { hidden: false, hasFocus: () => true, documentElement: { classList: { toggle: vi.fn() } } }));
|
vi.stubGlobal('document', { hidden: false, hasFocus: () => true, documentElement: { classList: { toggle: vi.fn() } } });
|
||||||
return { event: (_e: MpvEvent) => {}, next: [] as unknown[], focused: true, identity: vi.fn() };
|
return { event: (_e: MpvEvent) => {}, next: [] as unknown[], focused: true };
|
||||||
});
|
});
|
||||||
|
|
||||||
vi.mock('../platform/native', () => ({
|
vi.mock('../platform/native', () => ({
|
||||||
|
|
@ -20,7 +20,7 @@ vi.mock('./engine', () => ({ mpv: {
|
||||||
} }));
|
} }));
|
||||||
vi.mock('../app/session', async () => {
|
vi.mock('../app/session', async () => {
|
||||||
const { create } = await import('zustand');
|
const { create } = await import('zustand');
|
||||||
return { useSession: create(() => ({ server: { machineId: 'test', token: 'test-only', name: 'Test', get: harness.identity }, connection: { local: true } })) };
|
return { useSession: create(() => ({ server: { machineId: 'test', token: 'test-only' }, connection: { local: true } })) };
|
||||||
});
|
});
|
||||||
vi.mock('../downloads/store', () => ({ useDownloads: { getState: () => ({ items: [] }) } }));
|
vi.mock('../downloads/store', () => ({ useDownloads: { getState: () => ({ items: [] }) } }));
|
||||||
vi.mock('../app/queries', () => ({ invalidateLibrary: vi.fn() }));
|
vi.mock('../app/queries', () => ({ invalidateLibrary: vi.fn() }));
|
||||||
|
|
@ -42,11 +42,7 @@ const episode = (id = '1') => parseItem({ ratingKey: id, type: 'episode', title:
|
||||||
Media: [{ Part: [{ key: '/video', Stream: [{ id: 'audio', streamType: 2 }] }] }],
|
Media: [{ Part: [{ key: '/video', Stream: [{ id: 'audio', streamType: 2 }] }] }],
|
||||||
});
|
});
|
||||||
const time = (position: number) => harness.event({ type: 'property', name: 'time-pos', value: position });
|
const time = (position: number) => harness.event({ type: 'property', name: 'time-pos', value: position });
|
||||||
/** The stream ending at `position` (by default the real end of the 100 s episode). */
|
const eof = () => harness.event({ type: 'end-file', reason: 'eof' });
|
||||||
const eof = (position = 99.6) => {
|
|
||||||
usePlayer.setState({ position });
|
|
||||||
harness.event({ type: 'end-file', reason: 'eof' });
|
|
||||||
};
|
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
vi.useFakeTimers();
|
vi.useFakeTimers();
|
||||||
|
|
@ -71,25 +67,15 @@ describe('Up Next playback lifecycle', () => {
|
||||||
time(81);
|
time(81);
|
||||||
expect(usePlayer.getState()).toMatchObject({ postPlay: true, countdown: 5, countdownTotal: 5 });
|
expect(usePlayer.getState()).toMatchObject({ postPlay: true, countdown: 5, countdownTotal: 5 });
|
||||||
});
|
});
|
||||||
it.each(['button', 'off', 'auto'] as const)('opens at the first credits frame with movie credit skipping set to %s', (skipCredits) => {
|
it('leaves button-only credits to the viewer, and opens on a deliberate skip', () => {
|
||||||
useSettings.setState({ skipCredits });
|
useSettings.setState({ skipCredits: 'button' });
|
||||||
time(79.9);
|
time(81);
|
||||||
|
vi.advanceTimersByTime(2000);
|
||||||
|
time(83);
|
||||||
expect(usePlayer.getState().postPlay).toBe(false);
|
expect(usePlayer.getState().postPlay).toBe(false);
|
||||||
time(80);
|
usePlayer.getState().showPostPlay();
|
||||||
expect(usePlayer.getState().postPlay).toBe(true);
|
expect(usePlayer.getState().postPlay).toBe(true);
|
||||||
});
|
});
|
||||||
it('counts while the native video owns focus instead of the webview', () => {
|
|
||||||
harness.focused = false;
|
|
||||||
time(81);
|
|
||||||
vi.advanceTimersByTime(1000);
|
|
||||||
expect(usePlayer.getState().countdown).toBeCloseTo(4);
|
|
||||||
});
|
|
||||||
it('counts elapsed time even when the webview delivers timer callbacks late', () => {
|
|
||||||
time(81);
|
|
||||||
vi.setSystemTime(Date.now() + 2000);
|
|
||||||
vi.advanceTimersByTime(50);
|
|
||||||
expect(usePlayer.getState().countdown).toBeCloseTo(2.95);
|
|
||||||
});
|
|
||||||
it('opens at EOF even when automatic credit skipping is off', () => {
|
it('opens at EOF even when automatic credit skipping is off', () => {
|
||||||
useSettings.setState({ skipCredits: 'off' });
|
useSettings.setState({ skipCredits: 'off' });
|
||||||
eof();
|
eof();
|
||||||
|
|
@ -106,14 +92,6 @@ describe('Up Next playback lifecycle', () => {
|
||||||
expect(next).toHaveBeenCalledOnce();
|
expect(next).toHaveBeenCalledOnce();
|
||||||
usePlayer.setState({ playNext: original });
|
usePlayer.setState({ playNext: original });
|
||||||
});
|
});
|
||||||
it('starts the next episode from the beginning, ignoring an earlier partial viewing', async () => {
|
|
||||||
const original = usePlayer.getState().play;
|
|
||||||
const spy = vi.fn().mockResolvedValue(undefined);
|
|
||||||
usePlayer.setState({ play: spy, nextUp: { ...episode('2'), viewOffset: 88000 } });
|
|
||||||
await usePlayer.getState().playNext();
|
|
||||||
expect(spy).toHaveBeenCalledWith(expect.objectContaining({ id: '2' }), expect.objectContaining({ resume: false }));
|
|
||||||
usePlayer.setState({ play: original });
|
|
||||||
});
|
|
||||||
it('cancels autoplay while keeping the screen open, including across EOF', () => {
|
it('cancels autoplay while keeping the screen open, including across EOF', () => {
|
||||||
time(81);
|
time(81);
|
||||||
usePlayer.getState().cancelCountdown();
|
usePlayer.getState().cancelCountdown();
|
||||||
|
|
@ -121,30 +99,18 @@ describe('Up Next playback lifecycle', () => {
|
||||||
vi.advanceTimersByTime(10000);
|
vi.advanceTimersByTime(10000);
|
||||||
expect(usePlayer.getState()).toMatchObject({ postPlay: true, countdown: null, postPlayDismissed: true });
|
expect(usePlayer.getState()).toMatchObject({ postPlay: true, countdown: null, postPlayDismissed: true });
|
||||||
});
|
});
|
||||||
it('returns to credits without reopening while they play', () => {
|
it('returns to credits without reopening on the next time event or EOF', () => {
|
||||||
time(81);
|
time(81);
|
||||||
usePlayer.getState().dismissPostPlay();
|
usePlayer.getState().dismissPostPlay();
|
||||||
time(82);
|
time(82);
|
||||||
|
eof();
|
||||||
expect(usePlayer.getState()).toMatchObject({ postPlay: false, countdown: null });
|
expect(usePlayer.getState()).toMatchObject({ postPlay: false, countdown: null });
|
||||||
});
|
});
|
||||||
it('reopens at the end after returning to the credits', () => {
|
it.each(['hidden', 'unfocused', 'paused', 'mini'] as const)('holds the countdown while %s', (reason) => {
|
||||||
time(81);
|
|
||||||
usePlayer.getState().dismissPostPlay();
|
|
||||||
eof();
|
|
||||||
expect(usePlayer.getState()).toMatchObject({ postPlay: true, countdown: 5 });
|
|
||||||
});
|
|
||||||
it('reopens when the credits start again after seeking back into the episode', () => {
|
|
||||||
time(81);
|
|
||||||
usePlayer.getState().dismissPostPlay();
|
|
||||||
usePlayer.getState().seek(40);
|
|
||||||
time(40);
|
|
||||||
expect(usePlayer.getState().postPlay).toBe(false);
|
|
||||||
time(80);
|
|
||||||
expect(usePlayer.getState()).toMatchObject({ postPlay: true, countdown: 5 });
|
|
||||||
});
|
|
||||||
it.each(['hidden', 'mini'] as const)('holds the countdown while %s', (reason) => {
|
|
||||||
time(81);
|
time(81);
|
||||||
if (reason === 'hidden') Object.assign(document, { hidden: true });
|
if (reason === 'hidden') Object.assign(document, { hidden: true });
|
||||||
|
if (reason === 'unfocused') harness.focused = false;
|
||||||
|
if (reason === 'paused') usePlayer.setState({ paused: true });
|
||||||
if (reason === 'mini') usePlayer.setState({ mini: true });
|
if (reason === 'mini') usePlayer.setState({ mini: true });
|
||||||
vi.advanceTimersByTime(20000);
|
vi.advanceTimersByTime(20000);
|
||||||
expect(usePlayer.getState().countdown).toBe(5);
|
expect(usePlayer.getState().countdown).toBe(5);
|
||||||
|
|
@ -160,22 +126,6 @@ describe('Up Next playback lifecycle', () => {
|
||||||
vi.advanceTimersByTime(1000);
|
vi.advanceTimersByTime(1000);
|
||||||
expect(usePlayer.getState().countdown).toBeCloseTo(4);
|
expect(usePlayer.getState().countdown).toBeCloseTo(4);
|
||||||
});
|
});
|
||||||
it('keeps counting while credits are paused, like Android Up Next', () => {
|
|
||||||
time(81);
|
|
||||||
usePlayer.setState({ paused: true });
|
|
||||||
vi.advanceTimersByTime(1000);
|
|
||||||
expect(usePlayer.getState().countdown).toBeCloseTo(4);
|
|
||||||
});
|
|
||||||
it('does not spend hidden time when the app returns before another timer tick', () => {
|
|
||||||
time(80);
|
|
||||||
Object.assign(document, { hidden: true });
|
|
||||||
document.dispatchEvent(new Event('visibilitychange'));
|
|
||||||
vi.setSystemTime(Date.now() + 60000);
|
|
||||||
Object.assign(document, { hidden: false });
|
|
||||||
document.dispatchEvent(new Event('visibilitychange'));
|
|
||||||
vi.advanceTimersByTime(50);
|
|
||||||
expect(usePlayer.getState().countdown).toBeCloseTo(4.95);
|
|
||||||
});
|
|
||||||
it('shows a finale without an autoplay target', () => {
|
it('shows a finale without an autoplay target', () => {
|
||||||
usePlayer.setState({ nextUp: null });
|
usePlayer.setState({ nextUp: null });
|
||||||
eof();
|
eof();
|
||||||
|
|
@ -186,43 +136,30 @@ describe('Up Next playback lifecycle', () => {
|
||||||
time(81);
|
time(81);
|
||||||
expect(usePlayer.getState()).toMatchObject({ postPlay: true, countdown: null });
|
expect(usePlayer.getState()).toMatchObject({ postPlay: true, countdown: null });
|
||||||
});
|
});
|
||||||
it('opens when seeking into credits instead of suppressing Up Next', () => {
|
it('treats a seek into credits as a choice to watch them', () => {
|
||||||
usePlayer.getState().seek(81);
|
usePlayer.getState().seek(81);
|
||||||
time(81);
|
time(81);
|
||||||
vi.advanceTimersByTime(2000);
|
vi.advanceTimersByTime(2000);
|
||||||
time(83);
|
time(83);
|
||||||
expect(usePlayer.getState().postPlay).toBe(true);
|
expect(usePlayer.getState().postPlay).toBe(false);
|
||||||
expect(mpv.command).toHaveBeenCalledWith('seek', '81.000', 'absolute+exact');
|
expect(mpv.command).toHaveBeenCalledWith('seek', '81.000', 'absolute+exact');
|
||||||
});
|
});
|
||||||
it.each(['ended', 'credits'] as const)('shows Up Next immediately and loads slow episode context after %s', async (reason) => {
|
it.each(['ended', 'button'] as const)('waits for slow episode context after %s', async (reason) => {
|
||||||
let resolve!: (items: ReturnType<typeof episode>[]) => void;
|
let resolve!: (items: ReturnType<typeof episode>[]) => void;
|
||||||
vi.mocked(api.allLeaves).mockImplementationOnce(() => new Promise((done) => { resolve = done; }));
|
vi.mocked(api.allLeaves).mockImplementationOnce(() => new Promise((done) => { resolve = done; }));
|
||||||
await usePlayer.getState().play(episode(), { resume: false });
|
await usePlayer.getState().play(episode(), { resume: false });
|
||||||
usePlayer.setState({ firstFrame: true });
|
usePlayer.setState({ firstFrame: true });
|
||||||
useSettings.setState({ skipCredits: 'button' });
|
useSettings.setState({ skipCredits: 'button' });
|
||||||
if (reason === 'ended') eof();
|
if (reason === 'ended') eof();
|
||||||
else time(80);
|
else usePlayer.getState().showPostPlay();
|
||||||
expect(usePlayer.getState().postPlay).toBe(true);
|
expect(usePlayer.getState().postPlay).toBe(false);
|
||||||
expect(usePlayer.getState().countdown).toBeNull();
|
|
||||||
resolve([episode(), episode('2')]);
|
resolve([episode(), episode('2')]);
|
||||||
await vi.waitFor(() => expect(usePlayer.getState().episodeContextReady).toBe(true));
|
await vi.waitFor(() => expect(usePlayer.getState().postPlay).toBe(true));
|
||||||
expect(usePlayer.getState().nextUp?.id).toBe('2');
|
expect(usePlayer.getState().nextUp?.id).toBe('2');
|
||||||
expect(usePlayer.getState().countdownTotal).toBe(5);
|
expect(usePlayer.getState().countdownTotal).toBe(5);
|
||||||
expect(usePlayer.getState().countdown).toBeGreaterThan(4.9);
|
expect(usePlayer.getState().countdown).toBeGreaterThan(4.9);
|
||||||
expect(usePlayer.getState().countdown).toBeLessThanOrEqual(5);
|
expect(usePlayer.getState().countdown).toBeLessThanOrEqual(5);
|
||||||
});
|
});
|
||||||
it('keeps autoplay cancelled when episode context arrives after interaction', async () => {
|
|
||||||
let resolve!: (items: ReturnType<typeof episode>[]) => void;
|
|
||||||
vi.mocked(api.allLeaves).mockImplementationOnce(() => new Promise((done) => { resolve = done; }));
|
|
||||||
await usePlayer.getState().play(episode(), { resume: false });
|
|
||||||
usePlayer.setState({ firstFrame: true });
|
|
||||||
time(80);
|
|
||||||
usePlayer.getState().cancelCountdown();
|
|
||||||
resolve([episode(), episode('2')]);
|
|
||||||
await vi.waitFor(() => expect(usePlayer.getState().episodeContextReady).toBe(true));
|
|
||||||
vi.advanceTimersByTime(10000);
|
|
||||||
expect(usePlayer.getState()).toMatchObject({ postPlay: true, countdown: null, postPlayDismissed: true });
|
|
||||||
});
|
|
||||||
it('clears Up Next and its timer when playback closes', async () => {
|
it('clears Up Next and its timer when playback closes', async () => {
|
||||||
time(81);
|
time(81);
|
||||||
await usePlayer.getState().close();
|
await usePlayer.getState().close();
|
||||||
|
|
@ -230,51 +167,3 @@ describe('Up Next playback lifecycle', () => {
|
||||||
expect(usePlayer.getState()).toMatchObject({ open: false, postPlay: false, countdown: null });
|
expect(usePlayer.getState()).toMatchObject({ open: false, postPlay: false, countdown: null });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Losing the server mid-stream', () => {
|
|
||||||
it('waits for the server instead of ending when the stream is cut off early', () => {
|
|
||||||
eof(42);
|
|
||||||
expect(usePlayer.getState()).toMatchObject({ reconnecting: true, ended: false, postPlay: false });
|
|
||||||
});
|
|
||||||
it('resumes from where it stopped once the server answers again', async () => {
|
|
||||||
const original = usePlayer.getState().play;
|
|
||||||
const play = vi.fn().mockResolvedValue(undefined);
|
|
||||||
usePlayer.setState({ play });
|
|
||||||
harness.identity.mockRejectedValueOnce(new Error('unreachable'));
|
|
||||||
eof(42);
|
|
||||||
await vi.advanceTimersByTimeAsync(2000);
|
|
||||||
expect(play).not.toHaveBeenCalled();
|
|
||||||
expect(usePlayer.getState().reconnecting).toBe(true);
|
|
||||||
harness.identity.mockResolvedValueOnce({});
|
|
||||||
await vi.advanceTimersByTimeAsync(3000);
|
|
||||||
expect(play).toHaveBeenCalledWith(expect.objectContaining({ id: '1' }), expect.objectContaining({ offsetMs: 42000, keepMini: true }));
|
|
||||||
expect(usePlayer.getState().reconnecting).toBe(false);
|
|
||||||
usePlayer.setState({ play: original });
|
|
||||||
});
|
|
||||||
it('tries straight away on Play instead of starting over', async () => {
|
|
||||||
const original = usePlayer.getState().play;
|
|
||||||
const play = vi.fn().mockResolvedValue(undefined);
|
|
||||||
usePlayer.setState({ play });
|
|
||||||
harness.identity.mockResolvedValueOnce({});
|
|
||||||
eof(42);
|
|
||||||
usePlayer.getState().togglePause();
|
|
||||||
await vi.waitFor(() => expect(play).toHaveBeenCalledWith(expect.anything(), expect.objectContaining({ offsetMs: 42000 })));
|
|
||||||
expect(mpv.command).not.toHaveBeenCalledWith('seek', '0.000', 'absolute+exact');
|
|
||||||
usePlayer.setState({ play: original });
|
|
||||||
});
|
|
||||||
it('treats a second cut-off at the same place as the real end of the file', async () => {
|
|
||||||
harness.identity.mockResolvedValueOnce({});
|
|
||||||
eof(42);
|
|
||||||
await vi.advanceTimersByTimeAsync(2000);
|
|
||||||
usePlayer.setState({ firstFrame: true });
|
|
||||||
eof(42.5);
|
|
||||||
expect(usePlayer.getState()).toMatchObject({ reconnecting: false, ended: true });
|
|
||||||
});
|
|
||||||
it('stops waiting when the player is closed', async () => {
|
|
||||||
eof(42);
|
|
||||||
await usePlayer.getState().close();
|
|
||||||
harness.identity.mockClear();
|
|
||||||
await vi.advanceTimersByTimeAsync(10000);
|
|
||||||
expect(harness.identity).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,6 @@ export interface PlayOptions {
|
||||||
quality?: Quality;
|
quality?: Quality;
|
||||||
/** Keep these track choices (UI keys) instead of applying the preferences again. */
|
/** Keep these track choices (UI keys) instead of applying the preferences again. */
|
||||||
tracks?: { audioKey: string; subKey: string };
|
tracks?: { audioKey: string; subKey: string };
|
||||||
/** Reloading the same title in place (after an outage): stay in the miniplayer if it's there. */
|
|
||||||
keepMini?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface PlayerState {
|
interface PlayerState {
|
||||||
|
|
@ -50,8 +48,6 @@ interface PlayerState {
|
||||||
error: string;
|
error: string;
|
||||||
/** The server owner stopped this stream (error holds their message). */
|
/** The server owner stopped this stream (error holds their message). */
|
||||||
terminated: boolean;
|
terminated: boolean;
|
||||||
/** The stream was cut off before the end (the server went away); waiting for it to come back. */
|
|
||||||
reconnecting: boolean;
|
|
||||||
position: number;
|
position: number;
|
||||||
duration: number;
|
duration: number;
|
||||||
cacheTime: number;
|
cacheTime: number;
|
||||||
|
|
@ -74,7 +70,6 @@ interface PlayerState {
|
||||||
nextUp: Item | null;
|
nextUp: Item | null;
|
||||||
/** The episode before this one, for the previous-episode button. */
|
/** The episode before this one, for the previous-episode button. */
|
||||||
prevUp: Item | null;
|
prevUp: Item | null;
|
||||||
episodeContextReady: boolean;
|
|
||||||
countdown: number | null;
|
countdown: number | null;
|
||||||
countdownTotal: number;
|
countdownTotal: number;
|
||||||
postPlay: boolean;
|
postPlay: boolean;
|
||||||
|
|
@ -120,12 +115,13 @@ let lastReport = 0;
|
||||||
let sessionAnswered = false;
|
let sessionAnswered = false;
|
||||||
let reportTimer: ReturnType<typeof setInterval> | null = null;
|
let reportTimer: ReturnType<typeof setInterval> | null = null;
|
||||||
let countdownTimer: ReturnType<typeof setInterval> | null = null;
|
let countdownTimer: ReturnType<typeof setInterval> | null = null;
|
||||||
let unwatchCountdown: (() => void) | null = null;
|
|
||||||
let scrobbled = false;
|
let scrobbled = false;
|
||||||
let unlisten: (() => void) | null = null;
|
let unlisten: (() => void) | null = null;
|
||||||
let loadToken = 0;
|
let loadToken = 0;
|
||||||
let wasFullscreenBeforePlay = false;
|
let wasFullscreenBeforePlay = false;
|
||||||
let pendingExternal: Track | null = null;
|
let pendingExternal: Track | null = null;
|
||||||
|
let neighboursReady = false;
|
||||||
|
let postPlayRequested = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The server this playback belongs to, fixed when it starts. Progress, watched state
|
* The server this playback belongs to, fixed when it starts. Progress, watched state
|
||||||
|
|
@ -342,33 +338,27 @@ async function findNeighbours(item: Item): Promise<{ prevUp: Item | null; nextUp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function openPostPlay() {
|
|
||||||
const st = usePlayer.getState();
|
|
||||||
if (!st.open || st.error || st.item?.type !== 'episode' || st.postPlay || st.postPlayDismissed) return;
|
|
||||||
usePlayer.setState({ postPlay: true });
|
|
||||||
startCountdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
function startCountdown() {
|
function startCountdown() {
|
||||||
const st = usePlayer.getState();
|
const st = usePlayer.getState();
|
||||||
if (!st.open || !st.postPlay || st.error || !st.nextUp || st.postPlayDismissed || st.countdown !== null) return;
|
if (!st.open || st.error || st.item?.type !== 'episode' || st.postPlay || st.postPlayDismissed) return;
|
||||||
const settings = useSettings.getState();
|
const settings = useSettings.getState();
|
||||||
const total = settings.autoplayNext ? settings.countdownSeconds : 0;
|
// Don't mistake a slow context request for the end of the series.
|
||||||
|
if (!neighboursReady) return;
|
||||||
|
postPlayRequested = false;
|
||||||
|
const total = st.nextUp && settings.autoplayNext ? settings.countdownSeconds : 0;
|
||||||
|
usePlayer.setState({ postPlay: true, countdown: total > 0 ? total : null, countdownTotal: total });
|
||||||
if (total <= 0) return;
|
if (total <= 0) return;
|
||||||
stopCountdown();
|
|
||||||
usePlayer.setState({ countdown: total, countdownTotal: total });
|
|
||||||
let lastTick = performance.now();
|
let lastTick = performance.now();
|
||||||
const visibilityChanged = () => { lastTick = performance.now(); };
|
countdownTimer && clearInterval(countdownTimer);
|
||||||
document.addEventListener('visibilitychange', visibilityChanged);
|
|
||||||
unwatchCountdown = () => document.removeEventListener('visibilitychange', visibilityChanged);
|
|
||||||
countdownTimer = setInterval(() => {
|
countdownTimer = setInterval(() => {
|
||||||
const now = performance.now();
|
const now = performance.now();
|
||||||
const elapsed = Math.max(0, (now - lastTick) / 1000);
|
// Never spend time hidden, in the separate miniplayer, or behind another app.
|
||||||
|
// Cap a delayed tick so sleep / a suspended web view cannot skip an episode.
|
||||||
|
const elapsed = Math.min((now - lastTick) / 1000, 0.1);
|
||||||
lastTick = now;
|
lastTick = now;
|
||||||
const current = usePlayer.getState();
|
const current = usePlayer.getState();
|
||||||
if (!current.open || !current.postPlay || current.error || current.countdown === null) return stopCountdown();
|
if (!current.open || !current.postPlay || current.error || current.countdown === null) return stopCountdown();
|
||||||
// Native video can own keyboard focus while the webview is still on screen.
|
if (document.hidden || !document.hasFocus() || current.mini || (current.paused && !current.ended)) return;
|
||||||
if (document.hidden || current.mini) return;
|
|
||||||
const remaining = Math.max(0, current.countdown - elapsed);
|
const remaining = Math.max(0, current.countdown - elapsed);
|
||||||
usePlayer.setState({ countdown: remaining });
|
usePlayer.setState({ countdown: remaining });
|
||||||
if (remaining === 0) {
|
if (remaining === 0) {
|
||||||
|
|
@ -381,8 +371,6 @@ function startCountdown() {
|
||||||
function stopCountdown() {
|
function stopCountdown() {
|
||||||
if (countdownTimer) clearInterval(countdownTimer);
|
if (countdownTimer) clearInterval(countdownTimer);
|
||||||
countdownTimer = null;
|
countdownTimer = null;
|
||||||
unwatchCountdown?.();
|
|
||||||
unwatchCountdown = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -601,7 +589,7 @@ function onEvent(e: MpvEvent) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'eof-reached':
|
case 'eof-reached':
|
||||||
if (v === true) onStreamEnd();
|
if (v === true) onEnded();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -622,14 +610,11 @@ function onEvent(e: MpvEvent) {
|
||||||
// (Briefly: an unreachable server shouldn't hold up the error.)
|
// (Briefly: an unreachable server shouldn't hold up the error.)
|
||||||
const failed = session;
|
const failed = session;
|
||||||
Promise.race([report('buffering'), new Promise<boolean>((r) => setTimeout(() => r(false), 3000))]).then((terminated) => {
|
Promise.race([report('buffering'), new Promise<boolean>((r) => setTimeout(() => r(false), 3000))]).then((terminated) => {
|
||||||
const now = usePlayer.getState();
|
if (terminated || !usePlayer.getState().open || session !== failed) return;
|
||||||
if (terminated || !now.open || session !== failed) return;
|
|
||||||
// Partway through a stream that was playing, it's the connection that failed.
|
|
||||||
if (cutShort(now)) return onStreamEnd();
|
|
||||||
usePlayer.setState({ error: e.error ? `Playback failed: ${e.error}` : 'This video could not be played.' });
|
usePlayer.setState({ error: e.error ? `Playback failed: ${e.error}` : 'This video could not be played.' });
|
||||||
fallbackAfterError();
|
fallbackAfterError();
|
||||||
});
|
});
|
||||||
} else if (e.reason === 'eof') onStreamEnd();
|
} else if (e.reason === 'eof') onEnded();
|
||||||
break;
|
break;
|
||||||
case 'log':
|
case 'log':
|
||||||
noteMpvLog(e.level, e.prefix, e.text);
|
noteMpvLog(e.level, e.prefix, e.text);
|
||||||
|
|
@ -654,69 +639,9 @@ function fallbackAfterError() {
|
||||||
|
|
||||||
function maybeCredits(pos: number) {
|
function maybeCredits(pos: number) {
|
||||||
const st = usePlayer.getState();
|
const st = usePlayer.getState();
|
||||||
if (st.item?.type !== 'episode' || !st.firstFrame) return;
|
if (st.item?.type !== 'episode' || !st.firstFrame || st.paused || st.postPlayDismissed || Date.now() - st.lastSeek < 1500) return;
|
||||||
const inCredits = st.item.markers.some((m) => m.type === 'credits' && pos * 1000 >= m.start && pos * 1000 < m.end);
|
const credits = st.item.markers.find((m) => m.type === 'credits');
|
||||||
// Leaving the credits (seeking back into the episode) re-arms Up Next for the next time they start.
|
if (credits && pos * 1000 >= credits.start && pos * 1000 < credits.end && useSettings.getState().skipCredits === 'auto') startCountdown();
|
||||||
if (!inCredits) {
|
|
||||||
if (st.postPlayDismissed && !st.postPlay && !st.ended) usePlayer.setState({ postPlayDismissed: false });
|
|
||||||
} else if (!st.postPlayDismissed) openPostPlay();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A streamed title stopping well short of its end means the connection went
|
|
||||||
* (mpv plays out its buffer, then sees the cut-off stream as the end of the file).
|
|
||||||
*/
|
|
||||||
const CUT_SHORT_MARGIN = 15;
|
|
||||||
let reconnectTimer: ReturnType<typeof setTimeout> | null = null;
|
|
||||||
/** Where the last cut-off happened, so a file that really does end early isn't retried forever. */
|
|
||||||
let lastCutAt: number | null = null;
|
|
||||||
|
|
||||||
function cutShort(st: PlayerState) {
|
|
||||||
return st.delivery?.mode !== 'local' && st.firstFrame && st.duration > 0 && st.position < st.duration - CUT_SHORT_MARGIN;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** The stream ran out: a real ending, or a lost connection to wait out. */
|
|
||||||
function onStreamEnd() {
|
|
||||||
const st = usePlayer.getState();
|
|
||||||
if (!cutShort(st)) return onEnded();
|
|
||||||
if (st.reconnecting || st.ended) return;
|
|
||||||
// Cut off at the same place again once the server answered: the file itself ends there.
|
|
||||||
if (lastCutAt !== null && Math.abs(st.position - lastCutAt) < 5) return onEnded();
|
|
||||||
lastCutAt = st.position;
|
|
||||||
usePlayer.setState({ reconnecting: true, buffering: false });
|
|
||||||
keepAwake(false);
|
|
||||||
scheduleReconnect(2000);
|
|
||||||
}
|
|
||||||
|
|
||||||
function stopReconnecting() {
|
|
||||||
if (reconnectTimer) clearTimeout(reconnectTimer);
|
|
||||||
reconnectTimer = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function scheduleReconnect(delay: number) {
|
|
||||||
stopReconnecting();
|
|
||||||
reconnectTimer = setTimeout(() => void tryReconnect(), delay);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Resumes where the stream was cut off if the server answers; otherwise checks again shortly. */
|
|
||||||
async function tryReconnect(): Promise<boolean> {
|
|
||||||
stopReconnecting();
|
|
||||||
const st = usePlayer.getState();
|
|
||||||
const s = server();
|
|
||||||
if (!st.open || !st.reconnecting || !st.item || !s) return false;
|
|
||||||
const reachable = await s.get('/identity', undefined, { timeout: 4000 }).then(
|
|
||||||
() => true,
|
|
||||||
() => false,
|
|
||||||
);
|
|
||||||
const now = usePlayer.getState();
|
|
||||||
if (!now.open || !now.reconnecting || now.item?.id !== st.item.id) return false;
|
|
||||||
if (!reachable) {
|
|
||||||
scheduleReconnect(3000);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
usePlayer.setState({ reconnecting: false });
|
|
||||||
await now.play(now.item, { offsetMs: now.position * 1000, mediaIndex: now.mediaIndex, quality: now.quality, tracks: currentTracks(now), keepMini: true });
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onEnded() {
|
function onEnded() {
|
||||||
|
|
@ -725,11 +650,7 @@ function onEnded() {
|
||||||
usePlayer.setState({ ended: true });
|
usePlayer.setState({ ended: true });
|
||||||
report('stopped');
|
report('stopped');
|
||||||
checkScrobble();
|
checkScrobble();
|
||||||
// Reaching the end always offers Up Next, as on Android, even after watching the credits.
|
if (st.item?.type === 'episode') startCountdown();
|
||||||
if (st.item?.type === 'episode' && !st.postPlay) {
|
|
||||||
usePlayer.setState({ postPlayDismissed: false });
|
|
||||||
openPostPlay();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const usePlayer = create<PlayerState>((set, get) => ({
|
export const usePlayer = create<PlayerState>((set, get) => ({
|
||||||
|
|
@ -741,7 +662,6 @@ export const usePlayer = create<PlayerState>((set, get) => ({
|
||||||
firstFrame: false,
|
firstFrame: false,
|
||||||
error: '',
|
error: '',
|
||||||
terminated: false,
|
terminated: false,
|
||||||
reconnecting: false,
|
|
||||||
position: 0,
|
position: 0,
|
||||||
duration: 0,
|
duration: 0,
|
||||||
cacheTime: 0,
|
cacheTime: 0,
|
||||||
|
|
@ -762,7 +682,6 @@ export const usePlayer = create<PlayerState>((set, get) => ({
|
||||||
ended: false,
|
ended: false,
|
||||||
nextUp: null,
|
nextUp: null,
|
||||||
prevUp: null,
|
prevUp: null,
|
||||||
episodeContextReady: false,
|
|
||||||
countdown: null,
|
countdown: null,
|
||||||
countdownTotal: 0,
|
countdownTotal: 0,
|
||||||
postPlay: false,
|
postPlay: false,
|
||||||
|
|
@ -778,6 +697,8 @@ export const usePlayer = create<PlayerState>((set, get) => ({
|
||||||
// Closing or starting something else while this one is still setting up wins.
|
// Closing or starting something else while this one is still setting up wins.
|
||||||
const stale = () => token !== loadToken;
|
const stale = () => token !== loadToken;
|
||||||
const prefs = useSettings.getState();
|
const prefs = useSettings.getState();
|
||||||
|
neighboursReady = false;
|
||||||
|
postPlayRequested = false;
|
||||||
stopThemeMusic();
|
stopThemeMusic();
|
||||||
stopCountdown();
|
stopCountdown();
|
||||||
if (!isNative) {
|
if (!isNative) {
|
||||||
|
|
@ -785,8 +706,6 @@ export const usePlayer = create<PlayerState>((set, get) => ({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const previous = get();
|
const previous = get();
|
||||||
stopReconnecting();
|
|
||||||
if (previous.item?.id !== input.id) lastCutAt = null;
|
|
||||||
// The previous title's reporting ends here, against its own server.
|
// The previous title's reporting ends here, against its own server.
|
||||||
if (reportTimer) clearInterval(reportTimer);
|
if (reportTimer) clearInterval(reportTimer);
|
||||||
reportTimer = null;
|
reportTimer = null;
|
||||||
|
|
@ -815,7 +734,6 @@ export const usePlayer = create<PlayerState>((set, get) => ({
|
||||||
firstFrame: false,
|
firstFrame: false,
|
||||||
error: '',
|
error: '',
|
||||||
terminated: false,
|
terminated: false,
|
||||||
reconnecting: false,
|
|
||||||
position: (opts.offsetMs ?? 0) / 1000,
|
position: (opts.offsetMs ?? 0) / 1000,
|
||||||
lastSeek: 0,
|
lastSeek: 0,
|
||||||
duration: input.duration / 1000,
|
duration: input.duration / 1000,
|
||||||
|
|
@ -825,7 +743,6 @@ export const usePlayer = create<PlayerState>((set, get) => ({
|
||||||
ended: false,
|
ended: false,
|
||||||
nextUp: null,
|
nextUp: null,
|
||||||
prevUp: null,
|
prevUp: null,
|
||||||
episodeContextReady: false,
|
|
||||||
countdown: null,
|
countdown: null,
|
||||||
countdownTotal: 0,
|
countdownTotal: 0,
|
||||||
postPlay: false,
|
postPlay: false,
|
||||||
|
|
@ -837,7 +754,7 @@ export const usePlayer = create<PlayerState>((set, get) => ({
|
||||||
subKey: opts.tracks?.subKey ?? '__init',
|
subKey: opts.tracks?.subKey ?? '__init',
|
||||||
video: null,
|
video: null,
|
||||||
fullscreen: fullscreenNow,
|
fullscreen: fullscreenNow,
|
||||||
mini: opts.keepMini ? previous.open && previous.mini : false,
|
mini: false,
|
||||||
videoGamma: '',
|
videoGamma: '',
|
||||||
enhance: { ...previous.enhance, bypass: false, preparing: false },
|
enhance: { ...previous.enhance, bypass: false, preparing: false },
|
||||||
});
|
});
|
||||||
|
|
@ -901,15 +818,6 @@ export const usePlayer = create<PlayerState>((set, get) => ({
|
||||||
...(tracks ?? {}),
|
...(tracks ?? {}),
|
||||||
});
|
});
|
||||||
|
|
||||||
findNeighbours(item).then((n) => {
|
|
||||||
if (token !== loadToken) return;
|
|
||||||
set({ ...n, episodeContextReady: true });
|
|
||||||
const current = get();
|
|
||||||
if (current.postPlay) startCountdown();
|
|
||||||
else if (current.ended) openPostPlay();
|
|
||||||
else maybeCredits(current.position);
|
|
||||||
});
|
|
||||||
|
|
||||||
await mpv.init({ hwdec: prefs.hwdec, hdr: prefs.hdrPassthrough });
|
await mpv.init({ hwdec: prefs.hwdec, hdr: prefs.hdrPassthrough });
|
||||||
if (!unlisten) unlisten = await mpv.on(onEvent);
|
if (!unlisten) unlisten = await mpv.on(onEvent);
|
||||||
if (stale()) return;
|
if (stale()) return;
|
||||||
|
|
@ -934,9 +842,6 @@ export const usePlayer = create<PlayerState>((set, get) => ({
|
||||||
offsetMs > 0 && delivery.mode !== 'transcode' ? `start=${(offsetMs / 1000).toFixed(2)}` : 'start=none',
|
offsetMs > 0 && delivery.mode !== 'transcode' ? `start=${(offsetMs / 1000).toFixed(2)}` : 'start=none',
|
||||||
].join(',');
|
].join(',');
|
||||||
await mpv.command('loadfile', delivery.url, 'replace', -1, fileOpts);
|
await mpv.command('loadfile', delivery.url, 'replace', -1, fileOpts);
|
||||||
// A file left paused at its end (keep-open) re-pauses as soon as it's unpaused
|
|
||||||
// above, so a reload in place (after an outage) would open paused: unpause again.
|
|
||||||
await mpv.set('pause', false);
|
|
||||||
if (stale()) return;
|
if (stale()) return;
|
||||||
keepAwake(true);
|
keepAwake(true);
|
||||||
report('buffering');
|
report('buffering');
|
||||||
|
|
@ -945,6 +850,18 @@ export const usePlayer = create<PlayerState>((set, get) => ({
|
||||||
const st = get();
|
const st = get();
|
||||||
if (st.open && !st.ended) report(st.paused ? 'paused' : st.buffering ? 'buffering' : 'playing');
|
if (st.open && !st.ended) report(st.paused ? 'paused' : st.buffering ? 'buffering' : 'playing');
|
||||||
}, 10000);
|
}, 10000);
|
||||||
|
findNeighbours(item).then((n) => {
|
||||||
|
if (token !== loadToken) return;
|
||||||
|
neighboursReady = true;
|
||||||
|
set(n);
|
||||||
|
const current = get();
|
||||||
|
// Metadata may arrive after EOF / the credits. Open only once it is known
|
||||||
|
// whether there is a next episode, without restarting a cancelled timer.
|
||||||
|
if (!current.postPlay) {
|
||||||
|
if (postPlayRequested || current.ended) startCountdown();
|
||||||
|
else maybeCredits(current.position);
|
||||||
|
}
|
||||||
|
});
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
if (token !== loadToken) return;
|
if (token !== loadToken) return;
|
||||||
set({ error: e?.message ?? String(e), buffering: false });
|
set({ error: e?.message ?? String(e), buffering: false });
|
||||||
|
|
@ -955,8 +872,6 @@ export const usePlayer = create<PlayerState>((set, get) => ({
|
||||||
loadToken++;
|
loadToken++;
|
||||||
const st = get();
|
const st = get();
|
||||||
stopCountdown();
|
stopCountdown();
|
||||||
stopReconnecting();
|
|
||||||
lastCutAt = null;
|
|
||||||
if (reportTimer) clearInterval(reportTimer);
|
if (reportTimer) clearInterval(reportTimer);
|
||||||
reportTimer = null;
|
reportTimer = null;
|
||||||
if (st.item && !st.error) report('stopped');
|
if (st.item && !st.error) report('stopped');
|
||||||
|
|
@ -974,7 +889,7 @@ export const usePlayer = create<PlayerState>((set, get) => ({
|
||||||
await mpv.command('stop').catch(() => {});
|
await mpv.command('stop').catch(() => {});
|
||||||
await mpv.show(false).catch(() => {});
|
await mpv.show(false).catch(() => {});
|
||||||
}
|
}
|
||||||
set({ open: false, mini: false, postPlay: false, item: null, delivery: null, error: '', terminated: false, reconnecting: false, countdown: null, nextUp: null, prevUp: null, firstFrame: false });
|
set({ open: false, mini: false, postPlay: false, item: null, delivery: null, error: '', terminated: false, countdown: null, nextUp: null, prevUp: null, firstFrame: false });
|
||||||
// Closing the full player hands back the window it found; closing the
|
// Closing the full player hands back the window it found; closing the
|
||||||
// miniplayer leaves browsing as it is, full screen or not.
|
// miniplayer leaves browsing as it is, full screen or not.
|
||||||
if (!st.mini) {
|
if (!st.mini) {
|
||||||
|
|
@ -986,13 +901,6 @@ export const usePlayer = create<PlayerState>((set, get) => ({
|
||||||
|
|
||||||
togglePause() {
|
togglePause() {
|
||||||
const st = get();
|
const st = get();
|
||||||
// Play while the server is away: try it now rather than at the next check.
|
|
||||||
if (st.reconnecting) {
|
|
||||||
tryReconnect().then((resumed) => {
|
|
||||||
if (!resumed && get().reconnecting) toast(`Still can’t reach ${server()?.name ?? 'the server'}.`);
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (st.ended) {
|
if (st.ended) {
|
||||||
st.seek(0);
|
st.seek(0);
|
||||||
set({ ended: false });
|
set({ ended: false });
|
||||||
|
|
@ -1003,7 +911,8 @@ export const usePlayer = create<PlayerState>((set, get) => ({
|
||||||
seek(seconds) {
|
seek(seconds) {
|
||||||
const st = get();
|
const st = get();
|
||||||
const target = Math.max(0, Math.min(seconds, (st.duration || seconds) - 0.5));
|
const target = Math.max(0, Math.min(seconds, (st.duration || seconds) - 0.5));
|
||||||
set({ position: target, ended: false, lastSeek: Date.now() });
|
const choseCredits = st.item?.type === 'episode' && st.item.markers.some((m) => m.type === 'credits' && target * 1000 >= m.start && target * 1000 < m.end);
|
||||||
|
set({ position: target, ended: false, lastSeek: Date.now(), ...(choseCredits ? { postPlayDismissed: true } : {}) });
|
||||||
if (st.postPlay) st.dismissPostPlay();
|
if (st.postPlay) st.dismissPostPlay();
|
||||||
mpv.command('seek', target.toFixed(3), 'absolute+exact').catch(() => {});
|
mpv.command('seek', target.toFixed(3), 'absolute+exact').catch(() => {});
|
||||||
},
|
},
|
||||||
|
|
@ -1099,15 +1008,13 @@ export const usePlayer = create<PlayerState>((set, get) => ({
|
||||||
const st = get();
|
const st = get();
|
||||||
stopCountdown();
|
stopCountdown();
|
||||||
if (!st.nextUp) return;
|
if (!st.nextUp) return;
|
||||||
// Watching on through a season starts each episode from the top, never at a
|
await st.play(st.nextUp, { resume: true, quality: st.quality });
|
||||||
// stale position left by an earlier, unfinished viewing.
|
|
||||||
await st.play(st.nextUp, { resume: false, quality: st.quality });
|
|
||||||
},
|
},
|
||||||
|
|
||||||
async playPrevious() {
|
async playPrevious() {
|
||||||
const st = get();
|
const st = get();
|
||||||
if (!st.prevUp) return;
|
if (!st.prevUp) return;
|
||||||
await st.play(st.prevUp, { resume: false, quality: st.quality });
|
await st.play(st.prevUp, { resume: true, quality: st.quality });
|
||||||
},
|
},
|
||||||
|
|
||||||
cancelCountdown() {
|
cancelCountdown() {
|
||||||
|
|
@ -1117,8 +1024,9 @@ export const usePlayer = create<PlayerState>((set, get) => ({
|
||||||
|
|
||||||
showPostPlay() {
|
showPostPlay() {
|
||||||
// A deliberate Skip credits can reopen a screen previously dismissed.
|
// A deliberate Skip credits can reopen a screen previously dismissed.
|
||||||
|
postPlayRequested = true;
|
||||||
set({ postPlayDismissed: false });
|
set({ postPlayDismissed: false });
|
||||||
openPostPlay();
|
startCountdown();
|
||||||
},
|
},
|
||||||
|
|
||||||
dismissPostPlay() {
|
dismissPostPlay() {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { parseItem, parseScores } from './parse';
|
||||||
import { isLocalAddress } from './account';
|
import { isLocalAddress } from './account';
|
||||||
import { partAt } from './playback';
|
import { partAt } from './playback';
|
||||||
import { headerSafe } from './client';
|
import { headerSafe } from './client';
|
||||||
import { duration, formatBadges, isWatched, remaining, resumable, washGradient } from '../app/format';
|
import { duration, formatBadges, isWatched, remaining, washGradient } from '../app/format';
|
||||||
import { buildFeatures } from '../screens/discover';
|
import { buildFeatures } from '../screens/discover';
|
||||||
import type { Hub } from './types';
|
import type { Hub } from './types';
|
||||||
|
|
||||||
|
|
@ -65,16 +65,10 @@ describe('parsing', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('watched rules', () => {
|
describe('watched rules', () => {
|
||||||
it('keeps a title watched while it is being rewatched', () => {
|
it('treats a resumed title as watched only past the threshold', () => {
|
||||||
expect(isWatched(movie({ viewCount: 1, viewOffset: 3000000 }), 90)).toBe(true);
|
expect(isWatched(movie({ viewCount: 1, viewOffset: 3000000 }), 90)).toBe(false);
|
||||||
|
expect(isWatched(movie({ viewCount: 1, viewOffset: 5700000 }), 90)).toBe(true);
|
||||||
expect(isWatched(movie({ viewCount: 1 }), 90)).toBe(true);
|
expect(isWatched(movie({ viewCount: 1 }), 90)).toBe(true);
|
||||||
expect(resumable(movie({ viewCount: 1, viewOffset: 3000000 }))).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('counts an unplayed title as watched only past the threshold', () => {
|
|
||||||
expect(isWatched(movie({ viewOffset: 3000000 }), 90)).toBe(false);
|
|
||||||
expect(isWatched(movie({ viewOffset: 5700000 }), 90)).toBe(true);
|
|
||||||
expect(isWatched(movie({}), 90)).toBe(false);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('uses episode counts for shows', () => {
|
it('uses episode counts for shows', () => {
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,12 @@ import type { Item } from '../plex/types';
|
||||||
import { PROGRESS, useChildren, useItem, useRelated, useServerQuery } from '../app/queries';
|
import { PROGRESS, useChildren, useItem, useRelated, useServerQuery } from '../app/queries';
|
||||||
import { useServer } from '../app/session';
|
import { useServer } from '../app/session';
|
||||||
import { useSettings } from '../app/settings';
|
import { useSettings } from '../app/settings';
|
||||||
import { goBack, navigate } from '../app/router';
|
import { goBack, navigate, useRouter } from '../app/router';
|
||||||
import { canManage, itemMenu, openDialog, playItem, playWithVersion, setWatched, shuffleItem } from '../app/actions';
|
import { canManage, itemMenu, openDialog, openItem, playItem, playWithVersion, setWatched, shuffleItem } from '../app/actions';
|
||||||
import { bitrate, channelLabel, date, duration, episodeLabel, extraLabel, fileSize, isWatched, remaining, remainingEpisodes, resolutionLabel, resumable, technicalLine } from '../app/format';
|
import { bitrate, channelLabel, date, duration, episodeLabel, extraLabel, fileSize, isWatched, remaining, resolutionLabel, technicalLine } from '../app/format';
|
||||||
import { Backdrop } from '../ui/Backdrop';
|
import { Backdrop } from '../ui/Backdrop';
|
||||||
import { EpisodeCard, Facts, HubShelf, LandscapeCard, PersonCard, PosterCard, Shelf, TitleArt } from '../ui/media';
|
import { Facts, HubShelf, LandscapeCard, PersonCard, PosterCard, Shelf, TitleArt } from '../ui/media';
|
||||||
import { Artwork, Button, EmptyState, ErrorState, IconButton, PageLoader } from '../ui/primitives';
|
import { Artwork, Button, EmptyState, ErrorState, IconButton, PageLoader, Select } from '../ui/primitives';
|
||||||
import { Icon } from '../ui/Icon';
|
import { Icon } from '../ui/Icon';
|
||||||
import { openMenu } from '../ui/overlays';
|
import { openMenu } from '../ui/overlays';
|
||||||
import { useDownloads } from '../downloads/store';
|
import { useDownloads } from '../downloads/store';
|
||||||
|
|
@ -255,12 +255,11 @@ function AboutPanel({ item }: { item: Item }) {
|
||||||
// —— Movie ——————————————————————————————————————————————————————————
|
// —— Movie ——————————————————————————————————————————————————————————
|
||||||
|
|
||||||
function MovieDetail({ item }: { item: Item }) {
|
function MovieDetail({ item }: { item: Item }) {
|
||||||
const resume = resumable(item);
|
const resume = item.viewOffset > 0 && !isWatched(item);
|
||||||
return (
|
return (
|
||||||
<div className="detail movie">
|
<div className="detail movie">
|
||||||
<DetailHero item={item}>
|
<DetailHero item={item}>
|
||||||
{/* The Resume button carries the time left; the facts give the runtime. */}
|
<Facts item={item} />
|
||||||
<Facts item={{ ...item, viewOffset: 0 }} />
|
|
||||||
<Synopsis item={item} text={item.summary} />
|
<Synopsis item={item} text={item.summary} />
|
||||||
<div className="actions detail-actions">
|
<div className="actions detail-actions">
|
||||||
<Button variant="primary" icon="play" onClick={() => playWithVersion(item)}>
|
<Button variant="primary" icon="play" onClick={() => playWithVersion(item)}>
|
||||||
|
|
@ -299,75 +298,115 @@ function MovieDetail({ item }: { item: Item }) {
|
||||||
|
|
||||||
// —— Shows and seasons ————————————————————————————————————————————
|
// —— Shows and seasons ————————————————————————————————————————————
|
||||||
|
|
||||||
function EpisodeGrid({ episodes, upNextId }: { episodes: Item[] | undefined; upNextId?: string }) {
|
function EpisodeRow({ ep }: { ep: Item }) {
|
||||||
if (!episodes) return <PageLoader />;
|
const server = useServer();
|
||||||
if (!episodes.length) return <EmptyState icon="tv" title="No episodes" />;
|
const percent = useSettings((s) => s.watchedPercent);
|
||||||
|
const watched = isWatched(ep, percent);
|
||||||
|
const p = ep.viewOffset && ep.duration ? ep.viewOffset / ep.duration : 0;
|
||||||
return (
|
return (
|
||||||
<div className="episode-grid">
|
<div
|
||||||
{episodes.map((ep) => (
|
className="episode-row"
|
||||||
<EpisodeCard key={ep.id} item={ep} upNext={ep.id === upNextId} />
|
role="button"
|
||||||
))}
|
tabIndex={0}
|
||||||
|
onClick={() => openItem(ep)}
|
||||||
|
onKeyDown={(e) => e.key === 'Enter' && openItem(ep)}
|
||||||
|
onContextMenu={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
openMenu(itemMenu(ep), { x: e.clientX, y: e.clientY });
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div className="episode-index">{ep.index || '–'}</div>
|
||||||
|
<div className="episode-pic">
|
||||||
|
<Artwork src={server.image(ep.thumb, 320, 180)} />
|
||||||
|
<button
|
||||||
|
className="episode-play"
|
||||||
|
aria-label={`Play ${ep.title}`}
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
playWithVersion(ep);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Icon name="play" size={18} />
|
||||||
|
</button>
|
||||||
|
{p > 0 && !watched && (
|
||||||
|
<span className="progress-line">
|
||||||
|
<i style={{ width: `${p * 100}%` }} />
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="episode-text">
|
||||||
|
<h3>
|
||||||
|
{ep.title}
|
||||||
|
{watched && <Icon name="check" size={15} className="episode-watched" />}
|
||||||
|
</h3>
|
||||||
|
<div className="episode-meta">
|
||||||
|
{[duration(ep.duration), ep.originallyAvailableAt ? date(ep.originallyAvailableAt) : '', ep.viewOffset && !watched ? remaining(ep) : ''].filter(Boolean).join(' · ')}
|
||||||
|
</div>
|
||||||
|
{ep.summary && <p>{ep.summary}</p>}
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
className="icon-btn episode-more"
|
||||||
|
aria-label="More"
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
openMenu(itemMenu(ep), e.currentTarget);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Icon name="dots" size={18} />
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function EpisodesSection({ episodes, subtitle, upNextId }: { episodes: Item[] | undefined; subtitle?: string; upNextId?: string }) {
|
function Episodes({ seasons, initialSeason, showPicker = true }: { seasons: Item[]; initialSeason?: string; showPicker?: boolean }) {
|
||||||
|
const saved = useRouter((s) => s.current.state.season as string | undefined);
|
||||||
|
const [seasonId, setSeasonId] = useState(saved ?? initialSeason ?? seasons[0]?.id);
|
||||||
|
useEffect(() => {
|
||||||
|
if (!seasonId && seasons[0]) setSeasonId(initialSeason ?? seasons[0].id);
|
||||||
|
}, [seasons, initialSeason]);
|
||||||
|
const episodes = useChildren(seasonId);
|
||||||
|
const season = seasons.find((s) => s.id === seasonId);
|
||||||
|
if (!seasons.length) return null;
|
||||||
return (
|
return (
|
||||||
<section className="episodes">
|
<section className="episodes">
|
||||||
<div className="shelf-head">
|
<div className="episodes-head">
|
||||||
<h2>
|
<h2>Episodes</h2>
|
||||||
Episodes
|
{showPicker && seasons.length > 1 && (
|
||||||
{subtitle && <small>{subtitle}</small>}
|
<Select
|
||||||
</h2>
|
value={seasonId!}
|
||||||
|
label="Season"
|
||||||
|
options={seasons.map((s) => ({ value: s.id, label: s.title, hint: s.leafCount ? `${s.leafCount} ep` : undefined }))}
|
||||||
|
onChange={(v) => {
|
||||||
|
setSeasonId(v);
|
||||||
|
useRouter.getState().setState({ season: v });
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{season && (
|
||||||
|
<span className="episodes-sub">
|
||||||
|
{season.leafCount} episodes{season.year ? ` · ${season.year}` : ''}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{season?.summary && <p className="season-summary">{season.summary}</p>}
|
||||||
|
<div className="episode-list">
|
||||||
|
{episodes.isLoading && <PageLoader />}
|
||||||
|
{episodes.data?.map((ep) => <EpisodeRow key={ep.id} ep={ep} />)}
|
||||||
|
{episodes.data && !episodes.data.length && <EmptyState icon="tv" title="No episodes" />}
|
||||||
</div>
|
</div>
|
||||||
<EpisodeGrid episodes={episodes} upNextId={upNextId} />
|
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The season's name, which opens a menu of the show's other seasons. */
|
|
||||||
function SeasonSwitcher({ season, seasons }: { season: Item; seasons: Item[] }) {
|
|
||||||
if (seasons.length < 2) return <h1 className="detail-subtitle">{season.title}</h1>;
|
|
||||||
const choose = (e: React.MouseEvent<HTMLButtonElement>) =>
|
|
||||||
openMenu(
|
|
||||||
seasons.map((s) => ({
|
|
||||||
label: s.title,
|
|
||||||
hint: s.leafCount ? `${s.leafCount} episodes` : undefined,
|
|
||||||
checked: s.id === season.id,
|
|
||||||
// Replace, so Back still returns to the show rather than through each season.
|
|
||||||
onSelect: () => s.id !== season.id && navigate({ name: 'item', id: s.id, title: s.title }, { replace: true }),
|
|
||||||
})),
|
|
||||||
e.currentTarget,
|
|
||||||
{ minWidth: 240 },
|
|
||||||
);
|
|
||||||
return (
|
|
||||||
<h1 className="detail-subtitle">
|
|
||||||
<button className="season-switch" aria-haspopup="menu" title="Choose a season" onClick={choose}>
|
|
||||||
{season.title}
|
|
||||||
<Icon name="chevronDown" size={20} strokeWidth={2.4} />
|
|
||||||
</button>
|
|
||||||
</h1>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** "24 episodes · 8 unwatched", by Plex's own counts so it agrees with the Watched button. */
|
|
||||||
function seasonSubtitle(season: Item) {
|
|
||||||
const count = season.leafCount;
|
|
||||||
if (!count) return '';
|
|
||||||
const left = remainingEpisodes(season);
|
|
||||||
return [`${count} episode${count === 1 ? '' : 's'}`, left > 0 && left < count ? `${left} unwatched` : ''].filter(Boolean).join(' · ');
|
|
||||||
}
|
|
||||||
|
|
||||||
function ShowDetail({ item }: { item: Item }) {
|
function ShowDetail({ item }: { item: Item }) {
|
||||||
const seasons = useChildren(item.id);
|
const seasons = useChildren(item.id);
|
||||||
|
const server = useServer();
|
||||||
const next = useServerQuery(['onDeck', item.id], (s) => api.onDeckFor(s, item), PROGRESS);
|
const next = useServerQuery(['onDeck', item.id], (s) => api.onDeckFor(s, item), PROGRESS);
|
||||||
const nextEp = next.data;
|
const nextEp = next.data;
|
||||||
const seasonList = (seasons.data ?? []).filter((s) => s.type === 'season');
|
const seasonList = (seasons.data ?? []).filter((s) => s.type === 'season');
|
||||||
// A single-season show lists its episodes here instead of one lonely poster.
|
|
||||||
const only = seasonList.length === 1 ? seasonList[0] : undefined;
|
|
||||||
const onlyEpisodes = useChildren(only?.id);
|
|
||||||
const percent = useSettings((s) => s.watchedPercent);
|
const percent = useSettings((s) => s.watchedPercent);
|
||||||
const playLabel = nextEp ? (resumable(nextEp) ? `Resume ${episodeLabel(nextEp)}` : isWatched(item, percent) ? 'Play' : item.viewedLeafCount ? `Watch ${episodeLabel(nextEp)}` : 'Play') : 'Play';
|
const playLabel = nextEp ? (nextEp.viewOffset ? `Resume ${episodeLabel(nextEp)}` : isWatched(item, percent) ? 'Play' : item.viewedLeafCount ? `Watch ${episodeLabel(nextEp)}` : 'Play') : 'Play';
|
||||||
|
void server;
|
||||||
return (
|
return (
|
||||||
<div className="detail show">
|
<div className="detail show">
|
||||||
<DetailHero item={item}>
|
<DetailHero item={item}>
|
||||||
|
|
@ -385,16 +424,14 @@ function ShowDetail({ item }: { item: Item }) {
|
||||||
<DownloadButton item={item} />
|
<DownloadButton item={item} />
|
||||||
<MoreButton item={item} onDeleted={goBack} />
|
<MoreButton item={item} onDeleted={goBack} />
|
||||||
</div>
|
</div>
|
||||||
{/* The button names the episode number; this adds its title, and the time left when resuming. */}
|
|
||||||
{nextEp && (
|
{nextEp && (
|
||||||
<div className="detail-tech">
|
<div className="detail-tech">
|
||||||
Up next: {[nextEp.title, resumable(nextEp) ? remaining(nextEp) : ''].filter(Boolean).join(' · ')}
|
Up next: {episodeLabel(nextEp)} · {nextEp.title}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</DetailHero>
|
</DetailHero>
|
||||||
<div className="detail-body">
|
<div className="detail-body">
|
||||||
<div className="detail-main">
|
<div className="detail-main">
|
||||||
{seasons.isLoading && <PageLoader />}
|
|
||||||
{seasonList.length > 1 && (
|
{seasonList.length > 1 && (
|
||||||
<Shelf title="Seasons">
|
<Shelf title="Seasons">
|
||||||
{seasonList.map((s) => (
|
{seasonList.map((s) => (
|
||||||
|
|
@ -402,7 +439,7 @@ function ShowDetail({ item }: { item: Item }) {
|
||||||
))}
|
))}
|
||||||
</Shelf>
|
</Shelf>
|
||||||
)}
|
)}
|
||||||
{only && <EpisodesSection episodes={onlyEpisodes.data} subtitle={seasonSubtitle(only)} upNextId={nextEp?.id} />}
|
{seasons.isLoading ? <PageLoader /> : <Episodes seasons={seasonList} initialSeason={nextEp?.parentId} />}
|
||||||
<CastRow item={item} />
|
<CastRow item={item} />
|
||||||
<ExtrasRow item={item} />
|
<ExtrasRow item={item} />
|
||||||
<RelatedRows item={item} />
|
<RelatedRows item={item} />
|
||||||
|
|
@ -415,21 +452,12 @@ function ShowDetail({ item }: { item: Item }) {
|
||||||
|
|
||||||
function SeasonDetail({ item }: { item: Item }) {
|
function SeasonDetail({ item }: { item: Item }) {
|
||||||
const show = useItem(item.parentId);
|
const show = useItem(item.parentId);
|
||||||
const showItem = show.data;
|
|
||||||
const episodes = useChildren(item.id);
|
|
||||||
const siblings = useChildren(item.parentId);
|
const siblings = useChildren(item.parentId);
|
||||||
const seasonList = (siblings.data ?? []).filter((s) => s.type === 'season');
|
const seasonList = (siblings.data ?? []).filter((s) => s.type === 'season');
|
||||||
const deck = useServerQuery(['onDeck', item.parentId], (s) => (showItem ? api.onDeckFor(s, showItem) : Promise.resolve(null)), { ...PROGRESS, enabled: !!showItem });
|
const episodes = useChildren(item.id);
|
||||||
const percent = useSettings((s) => s.watchedPercent);
|
const percent = useSettings((s) => s.watchedPercent);
|
||||||
const list = episodes.data ?? [];
|
const next = (episodes.data ?? []).find((e) => !isWatched(e, percent)) ?? episodes.data?.[0];
|
||||||
// The show's up-next episode when it is in this season (so the season page and the
|
const showItem = show.data;
|
||||||
// show page agree), else the first one started but never finished, else the first
|
|
||||||
// unwatched, else the start of the season. Positions left by rewatches don't count.
|
|
||||||
const deckHere = deck.data?.parentId === item.id ? list.find((e) => e.id === deck.data!.id) : undefined;
|
|
||||||
const next = deckHere ?? list.find((e) => resumable(e) && !isWatched(e, percent)) ?? list.find((e) => !isWatched(e, percent)) ?? list[0];
|
|
||||||
const resumeNext = !!next && resumable(next) && (next === deckHere || !isWatched(next, percent));
|
|
||||||
const aired = list.find((e) => e.originallyAvailableAt)?.originallyAvailableAt;
|
|
||||||
const year = aired ? new Date(aired).getFullYear() : item.year;
|
|
||||||
return (
|
return (
|
||||||
<div className="detail season">
|
<div className="detail season">
|
||||||
<DetailHero
|
<DetailHero
|
||||||
|
|
@ -444,15 +472,15 @@ function SeasonDetail({ item }: { item: Item }) {
|
||||||
) : (
|
) : (
|
||||||
<h2 className="title-text small">{item.parentTitle}</h2>
|
<h2 className="title-text small">{item.parentTitle}</h2>
|
||||||
)}
|
)}
|
||||||
<SeasonSwitcher season={item} seasons={seasonList} />
|
<h1 className="detail-subtitle">{item.title}</h1>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Facts item={{ ...item, year, contentRating: showItem?.contentRating ?? item.contentRating, genres: [] }} />
|
<Facts item={{ ...item, contentRating: showItem?.contentRating ?? item.contentRating, genres: [] }} />
|
||||||
<Synopsis item={item} text={item.summary || showItem?.summary || ''} />
|
<Synopsis item={item} text={item.summary || showItem?.summary || ''} />
|
||||||
<div className="actions detail-actions">
|
<div className="actions detail-actions">
|
||||||
<Button variant="primary" icon="play" disabled={!next} onClick={() => next && playWithVersion(next, resumeNext ? {} : { offsetMs: 0, resume: false })}>
|
<Button variant="primary" icon="play" disabled={!next} onClick={() => next && playWithVersion(next)}>
|
||||||
{next ? `${resumeNext ? 'Resume' : 'Play'} ${episodeLabel(next)}` : 'Play'}
|
{next ? (next.viewOffset ? `Resume ${episodeLabel(next)}` : `Play ${episodeLabel(next)}`) : 'Play'}
|
||||||
</Button>
|
</Button>
|
||||||
<WatchedButton item={item} />
|
<WatchedButton item={item} />
|
||||||
<DownloadButton item={item} />
|
<DownloadButton item={item} />
|
||||||
|
|
@ -461,7 +489,7 @@ function SeasonDetail({ item }: { item: Item }) {
|
||||||
</DetailHero>
|
</DetailHero>
|
||||||
<div className="detail-body single">
|
<div className="detail-body single">
|
||||||
<div className="detail-main">
|
<div className="detail-main">
|
||||||
<EpisodesSection episodes={episodes.data} subtitle={seasonSubtitle(item)} upNextId={resumeNext ? next?.id : undefined} />
|
<Episodes seasons={seasonList.length ? seasonList : [item]} initialSeason={item.id} />
|
||||||
{showItem && <CastRow item={showItem} />}
|
{showItem && <CastRow item={showItem} />}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -472,7 +500,7 @@ function SeasonDetail({ item }: { item: Item }) {
|
||||||
function EpisodeDetail({ item }: { item: Item }) {
|
function EpisodeDetail({ item }: { item: Item }) {
|
||||||
const show = useItem(item.grandparentId);
|
const show = useItem(item.grandparentId);
|
||||||
const siblings = useChildren(item.parentId);
|
const siblings = useChildren(item.parentId);
|
||||||
const resume = resumable(item);
|
const resume = item.viewOffset > 0 && !isWatched(item);
|
||||||
const showItem = show.data;
|
const showItem = show.data;
|
||||||
const others = (siblings.data ?? []).filter((e) => e.id !== item.id);
|
const others = (siblings.data ?? []).filter((e) => e.id !== item.id);
|
||||||
const startIndex = Math.max(0, (siblings.data ?? []).findIndex((e) => e.id === item.id));
|
const startIndex = Math.max(0, (siblings.data ?? []).findIndex((e) => e.id === item.id));
|
||||||
|
|
@ -495,7 +523,7 @@ function EpisodeDetail({ item }: { item: Item }) {
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Facts item={{ ...item, viewOffset: 0, contentRating: item.contentRating || showItem?.contentRating || '' }} />
|
<Facts item={{ ...item, contentRating: item.contentRating || showItem?.contentRating || '' }} />
|
||||||
<Synopsis item={item} text={item.summary} />
|
<Synopsis item={item} text={item.summary} />
|
||||||
<div className="actions detail-actions">
|
<div className="actions detail-actions">
|
||||||
<Button variant="primary" icon="play" onClick={() => playWithVersion(item)}>
|
<Button variant="primary" icon="play" onClick={() => playWithVersion(item)}>
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@ import { useEffect, useRef } from 'react';
|
||||||
import { useSettings } from '../app/settings';
|
import { useSettings } from '../app/settings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The cold-start brand sequence, kept short because desktop startup is quick:
|
* The cold-start brand sequence: a kaleidoscope. A mirrored field of shards
|
||||||
* the mark's six facets spin in from a loose ring and snap together with a
|
* turns and gathers into the mark's six facets; if startup is still going,
|
||||||
* ring pulse. If startup is still going, small shards circle the mark. Once
|
* small shards keep circling the mark. Once startup is ready the camera flies
|
||||||
* startup is ready the camera flies through the mark's open centre, revealing
|
* through the mark's open centre, revealing the app drawn beneath (which
|
||||||
* the app drawn beneath (which settles from a slight zoom, `html.splash-arrival`).
|
* settles from a slight zoom, `html.splash-arrival`).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
type Point = { x: number; y: number };
|
type Point = { x: number; y: number };
|
||||||
|
|
@ -51,7 +51,7 @@ const rad = (deg: number) => (deg * Math.PI) / 180;
|
||||||
const PALETTE = ['#C3E8D3', '#71B9B0', '#3D7C7B', '#D0A977', '#E9D8AE', '#EEF2DD'];
|
const PALETTE = ['#C3E8D3', '#71B9B0', '#3D7C7B', '#D0A977', '#E9D8AE', '#EEF2DD'];
|
||||||
|
|
||||||
// The brand mark's facets, centred on its 64-unit viewport, each with the
|
// The brand mark's facets, centred on its 64-unit viewport, each with the
|
||||||
// outward normal of its hexagon edge and its centroid.
|
// angle of its hexagon edge's outward normal and its centroid.
|
||||||
const FACETS = [
|
const FACETS = [
|
||||||
[33, 4, 55.5, 17, 42.5, 24.5, 33, 19],
|
[33, 4, 55.5, 17, 42.5, 24.5, 33, 19],
|
||||||
[56.5, 19, 56.5, 45, 43.5, 37.5, 43.5, 26.5],
|
[56.5, 19, 56.5, 45, 43.5, 37.5, 43.5, 26.5],
|
||||||
|
|
@ -63,46 +63,48 @@ const FACETS = [
|
||||||
const points: Point[] = [];
|
const points: Point[] = [];
|
||||||
for (let k = 0; k < pts.length; k += 2) points.push({ x: pts[k] - 32, y: pts[k + 1] - 32 });
|
for (let k = 0; k < pts.length; k += 2) points.push({ x: pts[k] - 32, y: pts[k + 1] - 32 });
|
||||||
const centroid = { x: points.reduce((s, p) => s + p.x, 0) / 4, y: points.reduce((s, p) => s + p.y, 0) / 4 };
|
const centroid = { x: points.reduce((s, p) => s + p.x, 0) / 4, y: points.reduce((s, p) => s + p.y, 0) / 4 };
|
||||||
const angle = rad(-60 + 60 * i);
|
return { points, centroid, color: PALETTE[i], angle: rad(-60 + 60 * i) };
|
||||||
return { points, centroid, color: PALETTE[i], normal: { x: Math.cos(angle), y: Math.sin(angle) } };
|
|
||||||
});
|
});
|
||||||
type Facet = (typeof FACETS)[number];
|
type Facet = (typeof FACETS)[number];
|
||||||
|
|
||||||
|
// Loose shards around each facet: angle offset from the facet's normal, starting
|
||||||
|
// radius (px), size, palette offset and how far they tumble on the way in.
|
||||||
|
const SHARDS = [
|
||||||
|
{ angle: 20, radius: 170, scale: 0.42, color: 2, spin: 1.2 },
|
||||||
|
{ angle: -20, radius: 170, scale: 0.42, color: 4, spin: -1.2 },
|
||||||
|
{ angle: 36, radius: 320, scale: 0.3, color: 3, spin: 2.1 },
|
||||||
|
{ angle: -36, radius: 320, scale: 0.3, color: 1, spin: -2.1 },
|
||||||
|
{ angle: 8, radius: 420, scale: 0.2, color: 5, spin: 3 },
|
||||||
|
{ angle: -8, radius: 420, scale: 0.2, color: 5, spin: -3 },
|
||||||
|
];
|
||||||
|
|
||||||
// The inner hexagon traced by the facets' inner edges: the aperture the exit flies through.
|
// The inner hexagon traced by the facets' inner edges: the aperture the exit flies through.
|
||||||
const INNER_RADIUS = 13.6;
|
const INNER_RADIUS = 13.6;
|
||||||
const MARK_BOX = 140;
|
const MARK_BOX = 140;
|
||||||
// Timeline (ms): the last facet locks at INTRO_END; the sequence then idles until startup is ready.
|
// Timeline (ms): the mark has formed at INTRO_END; the sequence then idles until startup is ready.
|
||||||
const FACET_STAGGER = 18;
|
const INTRO_END = 1700;
|
||||||
const FACET_MS = 350;
|
const EXIT_MS = 640;
|
||||||
const INTRO_END = FACET_STAGGER * 5 + FACET_MS;
|
// The mark is larger than the old lockup, so it zooms less to end the flight at the same size.
|
||||||
// Still waiting at this point: shards start circling and a sheen crosses the mark.
|
|
||||||
const IDLE_START = 1100;
|
|
||||||
// Keep in step with the `splash-arrival` animation in app.css.
|
|
||||||
const EXIT_MS = 540;
|
|
||||||
const FLIGHT_ZOOM = 30;
|
const FLIGHT_ZOOM = 30;
|
||||||
|
|
||||||
const INK = '#090a0c';
|
const INK = '#090a0c';
|
||||||
const SEA_GLASS = [113, 185, 176];
|
const SEA_GLASS = [113, 185, 176];
|
||||||
|
const LIGHT = [238, 242, 221];
|
||||||
const rgba = (c: number[], a: number) => `rgba(${c[0]}, ${c[1]}, ${c[2]}, ${Math.max(0, a)})`;
|
const rgba = (c: number[], a: number) => `rgba(${c[0]}, ${c[1]}, ${c[2]}, ${Math.max(0, a)})`;
|
||||||
|
|
||||||
/**
|
/** A facet turned `rot` about the mark centre, shrunk and spun about its own centroid, then offset. */
|
||||||
* Facet `f` around mark centre `o`, `unit` px per grid unit: pushed `out` along its
|
function facetPath(ctx: CanvasRenderingContext2D, f: Facet, o: Point, unit: number, rot: number, scale: number, spin: number, offset: Point) {
|
||||||
* normal, shrunk and spun about its own centroid, then turned `rot` about the mark centre.
|
|
||||||
*/
|
|
||||||
function facetPath(ctx: CanvasRenderingContext2D, f: Facet, o: Point, unit: number, out = 0, scale = 1, spin = 0, rot = 0) {
|
|
||||||
const cr = Math.cos(rot);
|
const cr = Math.cos(rot);
|
||||||
const sr = Math.sin(rot);
|
const sr = Math.sin(rot);
|
||||||
const cs = Math.cos(spin);
|
const cs = Math.cos(spin);
|
||||||
const ss = Math.sin(spin);
|
const ss = Math.sin(spin);
|
||||||
const cx = f.centroid.x + f.normal.x * out;
|
|
||||||
const cy = f.centroid.y + f.normal.y * out;
|
|
||||||
f.points.forEach((p, i) => {
|
f.points.forEach((p, i) => {
|
||||||
const rx = p.x + f.normal.x * out - cx;
|
const rx = p.x - f.centroid.x;
|
||||||
const ry = p.y + f.normal.y * out - cy;
|
const ry = p.y - f.centroid.y;
|
||||||
const x = cx + (rx * cs - ry * ss) * scale;
|
const x = f.centroid.x + (rx * cs - ry * ss) * scale;
|
||||||
const y = cy + (rx * ss + ry * cs) * scale;
|
const y = f.centroid.y + (rx * ss + ry * cs) * scale;
|
||||||
const px = o.x + (x * cr - y * sr) * unit;
|
const px = o.x + (x * cr - y * sr) * unit + offset.x;
|
||||||
const py = o.y + (x * sr + y * cr) * unit;
|
const py = o.y + (x * sr + y * cr) * unit + offset.y;
|
||||||
if (i === 0) ctx.moveTo(px, py);
|
if (i === 0) ctx.moveTo(px, py);
|
||||||
else ctx.lineTo(px, py);
|
else ctx.lineTo(px, py);
|
||||||
});
|
});
|
||||||
|
|
@ -140,6 +142,9 @@ function draw(ctx: CanvasRenderingContext2D, w: number, h: number, time: number,
|
||||||
ctx.clearRect(0, 0, w, h);
|
ctx.clearRect(0, 0, w, h);
|
||||||
const zoom = q > 0 ? Math.exp(Math.log(FLIGHT_ZOOM) * Flight(q)) : 1;
|
const zoom = q > 0 ? Math.exp(Math.log(FLIGHT_ZOOM) * Flight(q)) : 1;
|
||||||
const unit = (MARK_BOX / 64) * zoom;
|
const unit = (MARK_BOX / 64) * zoom;
|
||||||
|
const gather = Emphasized(phase(time, 0, 1450));
|
||||||
|
// The whole field turns a little less than half a revolution as it gathers.
|
||||||
|
const field = rad(-150) * (1 - Emphasized(phase(time, 0, 1550)));
|
||||||
|
|
||||||
// The surface: ink everywhere, with the aperture's centre cut away on exit.
|
// The surface: ink everywhere, with the aperture's centre cut away on exit.
|
||||||
const hole = InOut(phase(q, 0.12, 0.5));
|
const hole = InOut(phase(q, 0.12, 0.5));
|
||||||
|
|
@ -158,7 +163,25 @@ function draw(ctx: CanvasRenderingContext2D, w: number, h: number, time: number,
|
||||||
ctx.globalAlpha = 1;
|
ctx.globalAlpha = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bloom = 0.09 * InOut(phase(time, 0, 260)) * (1 - Standard(phase(time, 420, 1100)));
|
// The kaleidoscope's mirror lines, turning with the field.
|
||||||
|
const lines = InOut(phase(time, 0, 450)) * (1 - Standard(phase(time, 1100, 1700)));
|
||||||
|
if (lines > 0) {
|
||||||
|
ctx.lineWidth = 1;
|
||||||
|
for (let s = 0; s < 6; s++) {
|
||||||
|
const a = field + rad(-90 + 60 * s);
|
||||||
|
const end = { x: o.x + Math.cos(a) * 640, y: o.y + Math.sin(a) * 640 };
|
||||||
|
const g = ctx.createLinearGradient(o.x, o.y, end.x, end.y);
|
||||||
|
g.addColorStop(0, rgba(LIGHT, 0.2 * lines));
|
||||||
|
g.addColorStop(1, rgba(LIGHT, 0));
|
||||||
|
ctx.strokeStyle = g;
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.moveTo(o.x, o.y);
|
||||||
|
ctx.lineTo(end.x, end.y);
|
||||||
|
ctx.stroke();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const bloom = 0.09 * InOut(phase(time, 200, 1000)) * (1 - Standard(phase(time, 1500, 2600)));
|
||||||
if (bloom > 0.001) {
|
if (bloom > 0.001) {
|
||||||
ctx.globalCompositeOperation = 'lighter';
|
ctx.globalCompositeOperation = 'lighter';
|
||||||
const g = ctx.createRadialGradient(o.x, o.y, 0, o.x, o.y, 300);
|
const g = ctx.createRadialGradient(o.x, o.y, 0, o.x, o.y, 300);
|
||||||
|
|
@ -172,36 +195,56 @@ function draw(ctx: CanvasRenderingContext2D, w: number, h: number, time: number,
|
||||||
ctx.globalCompositeOperation = 'source-over';
|
ctx.globalCompositeOperation = 'source-over';
|
||||||
}
|
}
|
||||||
|
|
||||||
// The six facets spin in from a loose ring and lock into the mark.
|
// Shards spiral inward, faster than the field turns, and vanish into the centre.
|
||||||
|
ctx.globalCompositeOperation = 'screen';
|
||||||
|
const inward = Emphasized(phase(time, 0, 1350));
|
||||||
FACETS.forEach((f, s) => {
|
FACETS.forEach((f, s) => {
|
||||||
const start = s * FACET_STAGGER;
|
SHARDS.forEach((d, j) => {
|
||||||
const p = Emphasized(phase(time, start, start + FACET_MS));
|
const appear = Standard(phase(time, j * 50 + s * 25, j * 50 + s * 25 + 420));
|
||||||
ctx.globalAlpha = Standard(phase(time, start, start + 160));
|
const vanish = Standard(phase(time, 750 + j * 45, 1350 + j * 45));
|
||||||
|
if (appear <= 0 || vanish >= 1) return;
|
||||||
|
const a = f.angle + rad(d.angle) + field * 1.5;
|
||||||
|
const r = d.radius * (1 - 0.88 * inward);
|
||||||
|
ctx.globalAlpha = appear * (1 - vanish) * 0.9;
|
||||||
|
ctx.fillStyle = PALETTE[(s + d.color) % 6];
|
||||||
|
ctx.beginPath();
|
||||||
|
shardPath(ctx, f, { x: o.x + Math.cos(a) * r, y: o.y + Math.sin(a) * r }, unit * d.scale * (1 - 0.6 * vanish), field * 2 + d.spin * (1 - gather));
|
||||||
|
ctx.fill();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
ctx.globalAlpha = 1;
|
||||||
|
ctx.globalCompositeOperation = 'source-over';
|
||||||
|
|
||||||
|
// The six facets ride in from the field and lock into the mark.
|
||||||
|
FACETS.forEach((f, s) => {
|
||||||
|
const r = 240 * (1 - gather);
|
||||||
|
const a = f.angle + field;
|
||||||
|
ctx.globalAlpha = Standard(phase(time, s * 25, s * 25 + 420));
|
||||||
ctx.fillStyle = f.color;
|
ctx.fillStyle = f.color;
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
facetPath(ctx, f, o, unit, 7 * (1 - p), mix(0.5, 1, p), rad(-45) * (1 - p), rad(-60) * (1 - p));
|
facetPath(ctx, f, o, unit, field, mix(0.55, 1, gather), rad(-60) * (1 - gather), { x: Math.cos(a) * r, y: Math.sin(a) * r });
|
||||||
ctx.fill();
|
ctx.fill();
|
||||||
});
|
});
|
||||||
ctx.globalAlpha = 1;
|
ctx.globalAlpha = 1;
|
||||||
|
|
||||||
// A ring pulses out as the facets lock.
|
// A ring pulses out as the facets lock.
|
||||||
const pulse = phase(time, 340, 900);
|
const pulse = phase(time, 1380, 2050);
|
||||||
if (pulse > 0 && pulse < 1) {
|
if (pulse > 0 && pulse < 1) {
|
||||||
ctx.strokeStyle = rgba(SEA_GLASS, 0.45 * (1 - pulse) * (1 - phase(q, 0, 0.3)));
|
ctx.strokeStyle = rgba(SEA_GLASS, 0.45 * (1 - pulse));
|
||||||
ctx.lineWidth = 1.5;
|
ctx.lineWidth = 1.5;
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
hexagon(ctx, o, (30 + 22 * EmphasizedDecelerate(pulse)) * unit);
|
hexagon(ctx, o, (30 + 24 * EmphasizedDecelerate(pulse)) * unit);
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Still starting: small shards circle the mark.
|
// Still starting: small shards keep circling the mark.
|
||||||
const idle = Standard(phase(time, IDLE_START, IDLE_START + 600)) * (1 - phase(q, 0, 0.25));
|
const idle = Standard(phase(time, 2300, 2900)) * (1 - phase(q, 0, 0.25));
|
||||||
if (idle > 0) {
|
if (idle > 0) {
|
||||||
ctx.globalCompositeOperation = 'screen';
|
ctx.globalCompositeOperation = 'screen';
|
||||||
ctx.globalAlpha = 0.4 * idle;
|
ctx.globalAlpha = 0.4 * idle;
|
||||||
for (let s = 0; s < 6; s++) {
|
for (let s = 0; s < 6; s++) {
|
||||||
for (const side of [-1, 1]) {
|
for (const side of [-1, 1]) {
|
||||||
const a = rad(-60 + 60 * s) + side * rad(11) + (time - IDLE_START) * 0.00032;
|
const a = rad(-60 + 60 * s) + side * rad(11) + (time - 2300) * 0.00032;
|
||||||
ctx.fillStyle = PALETTE[(s + (side > 0 ? 2 : 4)) % 6];
|
ctx.fillStyle = PALETTE[(s + (side > 0 ? 2 : 4)) % 6];
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
shardPath(ctx, FACETS[s], { x: o.x + Math.cos(a) * 50 * unit, y: o.y + Math.sin(a) * 50 * unit }, unit * 0.16, a * 2);
|
shardPath(ctx, FACETS[s], { x: o.x + Math.cos(a) * 50 * unit, y: o.y + Math.sin(a) * 50 * unit }, unit * 0.16, a * 2);
|
||||||
|
|
@ -212,12 +255,12 @@ function draw(ctx: CanvasRenderingContext2D, w: number, h: number, time: number,
|
||||||
ctx.globalCompositeOperation = 'source-over';
|
ctx.globalCompositeOperation = 'source-over';
|
||||||
}
|
}
|
||||||
|
|
||||||
// While it waits, a band of light crosses the mark every few seconds.
|
// A band of light crosses the settled mark, then again every few seconds while it waits.
|
||||||
const sheen = time < IDLE_START ? 0 : ((time - IDLE_START) % 3600) / 900;
|
const sheen = time < 1500 ? 0 : ((time - 1500) % 3600) / 900;
|
||||||
if (q === 0 && sheen > 0 && sheen < 1) {
|
if (q === 0 && sheen > 0 && sheen < 1) {
|
||||||
ctx.save();
|
ctx.save();
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
FACETS.forEach((f) => facetPath(ctx, f, o, unit));
|
FACETS.forEach((f) => facetPath(ctx, f, o, unit, 0, 1, 0, { x: 0, y: 0 }));
|
||||||
ctx.clip();
|
ctx.clip();
|
||||||
const reach = 40 * unit;
|
const reach = 40 * unit;
|
||||||
const a = rad(36);
|
const a = rad(36);
|
||||||
|
|
@ -291,7 +334,7 @@ export function Splash({ ready, onDone }: { ready: boolean; onDone: () => void }
|
||||||
cancelAnimationFrame(raf);
|
cancelAnimationFrame(raf);
|
||||||
window.removeEventListener('resize', size);
|
window.removeEventListener('resize', size);
|
||||||
// Let the arrival settle finish after the splash is gone.
|
// Let the arrival settle finish after the splash is gone.
|
||||||
setTimeout(() => document.documentElement.classList.remove('splash-arrival'), EXIT_MS + 60);
|
setTimeout(() => document.documentElement.classList.remove('splash-arrival'), 700);
|
||||||
};
|
};
|
||||||
}, [reduced]);
|
}, [reduced]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -192,10 +192,10 @@ export function AppSettings({ tab }: { tab: string }) {
|
||||||
<Pref label="Skip intros">
|
<Pref label="Skip intros">
|
||||||
<Select value={s.skipIntro} onChange={(v) => set('skipIntro', v)} options={skipOptions} />
|
<Select value={s.skipIntro} onChange={(v) => set('skipIntro', v)} options={skipOptions} />
|
||||||
</Pref>
|
</Pref>
|
||||||
<Pref label="Skip movie credits" description="Episodes open Up Next when their credits begin.">
|
<Pref label="Skip credits" description="For episodes, opens Up Next while the credits keep playing. Show button lets you choose when; Skip automatically opens it as credits begin.">
|
||||||
<Select value={s.skipCredits} onChange={(v) => set('skipCredits', v)} options={skipOptions} />
|
<Select value={s.skipCredits} onChange={(v) => set('skipCredits', v)} options={skipOptions} />
|
||||||
</Pref>
|
</Pref>
|
||||||
<Pref label="Automatic skip delay" description="How long the button counts down before skipping automatically. Pause, seek or press any key to keep watching instead.">
|
<Pref label="Automatic skip delay" description="Delay for intros and movie credits. Episode credits use the single Up Next countdown below. Pause, seek or press any key to cancel a skip.">
|
||||||
<Select
|
<Select
|
||||||
value={s.autoSkipDelay}
|
value={s.autoSkipDelay}
|
||||||
disabled={s.skipIntro !== 'auto' && s.skipCredits !== 'auto'}
|
disabled={s.skipIntro !== 'auto' && s.skipCredits !== 'auto'}
|
||||||
|
|
@ -203,16 +203,11 @@ export function AppSettings({ tab }: { tab: string }) {
|
||||||
options={[0, 3, 5, 10].map((v) => ({ value: v, label: v ? `${v} seconds` : 'Skip straight away' }))}
|
options={[0, 3, 5, 10].map((v) => ({ value: v, label: v ? `${v} seconds` : 'Skip straight away' }))}
|
||||||
/>
|
/>
|
||||||
</Pref>
|
</Pref>
|
||||||
<Pref label="Autoplay next episode">
|
<Pref label="Play the next episode automatically">
|
||||||
<Select
|
<Switch checked={s.autoplayNext} onChange={(v) => set('autoplayNext', v)} />
|
||||||
label="Autoplay next episode"
|
</Pref>
|
||||||
value={s.autoplayNext ? s.countdownSeconds : 0}
|
<Pref label="Countdown" description="Seconds before Up Next plays the next episode. Click, scroll or press any key to cancel. Pauses while Kaleido is in the background.">
|
||||||
onChange={(seconds) => {
|
<Select value={s.countdownSeconds} disabled={!s.autoplayNext} onChange={(v) => set('countdownSeconds', v)} options={[5, 8, 10, 15, 20, 30].map((v) => ({ value: v, label: `${v} seconds` }))} />
|
||||||
set('autoplayNext', seconds > 0);
|
|
||||||
if (seconds > 0) set('countdownSeconds', seconds);
|
|
||||||
}}
|
|
||||||
options={[{ value: 0, label: 'Off' }, ...[5, 8, 10, 15, 20, 30].map((v) => ({ value: v, label: `After ${v} seconds` }))]}
|
|
||||||
/>
|
|
||||||
</Pref>
|
</Pref>
|
||||||
<Pref label="Arrow-key seek">
|
<Pref label="Arrow-key seek">
|
||||||
<Select value={s.seekStep} onChange={(v) => set('seekStep', v)} options={[5, 10, 15, 30].map((v) => ({ value: v, label: `${v} seconds` }))} />
|
<Select value={s.seekStep} onChange={(v) => set('seekStep', v)} options={[5, 10, 15, 30].map((v) => ({ value: v, label: `${v} seconds` }))} />
|
||||||
|
|
|
||||||
|
|
@ -270,11 +270,10 @@ html.os-macos:not(.window-fullscreen) .topbar {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
/* The app beneath settles from a slight zoom as the camera flies through the
|
/* The app beneath settles from a slight zoom as the camera flies through the
|
||||||
aperture (held for the first quarter of the exit, then decelerating).
|
aperture (held for the first quarter of the exit, then decelerating). */
|
||||||
The duration matches EXIT_MS in Splash.tsx. */
|
|
||||||
html.splash-arrival .app-shell,
|
html.splash-arrival .app-shell,
|
||||||
html.splash-arrival .auth-screen {
|
html.splash-arrival .auth-screen {
|
||||||
animation: splash-arrival 540ms linear both;
|
animation: splash-arrival 640ms linear both;
|
||||||
}
|
}
|
||||||
@keyframes splash-arrival {
|
@keyframes splash-arrival {
|
||||||
0% {
|
0% {
|
||||||
|
|
@ -854,7 +853,6 @@ html.splash-arrival .auth-screen {
|
||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
scroll-snap-type: x proximity;
|
scroll-snap-type: x proximity;
|
||||||
scroll-padding: 0 var(--gutter);
|
scroll-padding: 0 var(--gutter);
|
||||||
overflow-anchor: none;
|
|
||||||
padding: 4px var(--gutter) 10px;
|
padding: 4px var(--gutter) 10px;
|
||||||
scrollbar-width: none;
|
scrollbar-width: none;
|
||||||
}
|
}
|
||||||
|
|
@ -1093,23 +1091,6 @@ html.splash-arrival .auth-screen {
|
||||||
.card.landscape .card-title {
|
.card.landscape .card-title {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
.card-title-link {
|
|
||||||
max-width: 100%;
|
|
||||||
font: inherit;
|
|
||||||
color: inherit;
|
|
||||||
text-align: left;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-decoration: underline;
|
|
||||||
text-decoration-color: transparent;
|
|
||||||
text-underline-offset: 3px;
|
|
||||||
transition: text-decoration-color var(--t-fast);
|
|
||||||
}
|
|
||||||
.card-title-link:hover {
|
|
||||||
color: #fff;
|
|
||||||
text-decoration-color: rgba(255, 255, 255, 0.5);
|
|
||||||
}
|
|
||||||
.card-meta {
|
.card-meta {
|
||||||
font-size: 11.5px;
|
font-size: 11.5px;
|
||||||
color: #8a9196;
|
color: #8a9196;
|
||||||
|
|
|
||||||
|
|
@ -350,10 +350,6 @@ html.os-macos:not(.window-fullscreen) .player-top {
|
||||||
.player-controls-center {
|
.player-controls-center {
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
}
|
}
|
||||||
.player-icon-spacer {
|
|
||||||
width: 44px;
|
|
||||||
height: 44px;
|
|
||||||
}
|
|
||||||
.player-icon:disabled {
|
.player-icon:disabled {
|
||||||
opacity: 0.32;
|
opacity: 0.32;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
|
@ -708,254 +704,281 @@ html.os-macos:not(.window-fullscreen) .player-top {
|
||||||
.skip-button > * {
|
.skip-button > * {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
/* —— Up Next ————————————————————————————————————————————————————————
|
/* Up Next keeps a stationary opening over the native video;
|
||||||
The credits keep playing in the top-left frame: the native video is drawn
|
only the rows scroll. */
|
||||||
into its rectangle and the scene has a matching hole (PostPlay.tsx). Only
|
|
||||||
the rows scroll, so the frame never moves. */
|
|
||||||
.up-next {
|
.up-next {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
--up-top: 64px;
|
--up-gutter: clamp(28px, 4vw, 64px);
|
||||||
--up-video-w: clamp(320px, 34vw, 640px);
|
|
||||||
}
|
}
|
||||||
.up-next-scene {
|
.up-next-scene {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
overflow: hidden;
|
|
||||||
isolation: isolate;
|
|
||||||
background: var(--bg);
|
background: var(--bg);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
.up-next.placed .up-next-scene {
|
.up-next.placed .up-next-scene {
|
||||||
-webkit-mask-image: linear-gradient(#000 0 0), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 90'%3E%3Crect width='160' height='90' rx='2.4'/%3E%3C/svg%3E");
|
-webkit-mask-image: linear-gradient(#000 0 0), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 90'%3E%3Crect width='160' height='90' rx='3'/%3E%3C/svg%3E");
|
||||||
-webkit-mask-size: 100% 100%, var(--up-w) var(--up-h);
|
-webkit-mask-size: 100% 100%, var(--up-video-w) var(--up-video-h);
|
||||||
-webkit-mask-position: 0 0, var(--up-x) var(--up-y);
|
-webkit-mask-position: 0 0, var(--up-video-x) var(--up-video-y);
|
||||||
-webkit-mask-repeat: no-repeat;
|
-webkit-mask-repeat: no-repeat;
|
||||||
-webkit-mask-composite: xor;
|
-webkit-mask-composite: xor;
|
||||||
mask-composite: exclude;
|
mask-composite: exclude;
|
||||||
}
|
}
|
||||||
.up-next-backdrop {
|
.up-next-toolbar {
|
||||||
height: min(78vh, 860px);
|
|
||||||
bottom: auto;
|
|
||||||
}
|
|
||||||
.backdrop-tint.up-next-backdrop {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
/* The next episode's details sit over the artwork, so it stays dimmer here
|
|
||||||
than on a title page, with or without the colour wash. */
|
|
||||||
.up-next-backdrop .backdrop-scrim,
|
|
||||||
.up-next-backdrop.washed .backdrop-scrim {
|
|
||||||
background:
|
|
||||||
linear-gradient(90deg, rgba(9, 10, 12, 0.96) 0%, rgba(9, 10, 12, 0.9) 38%, rgba(9, 10, 12, 0.74) 62%, rgba(9, 10, 12, 0.55) 100%),
|
|
||||||
linear-gradient(0deg, var(--bg) 0%, rgba(9, 10, 12, 0.6) 22%, transparent 55%);
|
|
||||||
}
|
|
||||||
.up-next-top {
|
|
||||||
height: 60px;
|
|
||||||
z-index: 3;
|
|
||||||
}
|
|
||||||
.up-next-fullscreen {
|
|
||||||
margin-left: auto;
|
|
||||||
}
|
|
||||||
/* Beside the window's own buttons (Windows, outside full screen), it takes
|
|
||||||
their size and line so the four read as one group. */
|
|
||||||
.up-next-top:has(> .window-controls) .up-next-fullscreen {
|
|
||||||
align-self: flex-start;
|
|
||||||
width: 46px;
|
|
||||||
height: 34px;
|
|
||||||
margin-right: 110px;
|
|
||||||
border-radius: 0;
|
|
||||||
color: #e4e8e9;
|
|
||||||
}
|
|
||||||
.up-next-top:has(> .window-controls) .up-next-fullscreen svg {
|
|
||||||
width: 15px;
|
|
||||||
height: 15px;
|
|
||||||
}
|
|
||||||
.up-next-head {
|
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
|
||||||
flex: none;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: center;
|
||||||
gap: clamp(28px, 3vw, 48px);
|
gap: 24px;
|
||||||
padding: var(--up-top) var(--gutter) 30px;
|
flex: none;
|
||||||
animation: fade-in 320ms var(--ease);
|
height: 62px;
|
||||||
|
padding: 0 var(--up-gutter);
|
||||||
|
}
|
||||||
|
.up-next-toolbar > .up-next-back:first-child {
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
.up-next-toolbar .window-controls {
|
||||||
|
margin-right: calc(-1 * var(--up-gutter));
|
||||||
|
}
|
||||||
|
html.os-macos:not(.window-fullscreen) .up-next-toolbar {
|
||||||
|
padding-left: max(var(--up-gutter), var(--traffic-lights));
|
||||||
|
}
|
||||||
|
.up-next-back, .up-next-cancel {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #b6bdbf;
|
||||||
|
padding: 8px 0;
|
||||||
|
}
|
||||||
|
.up-next-back:hover, .up-next-cancel:hover {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.up-next-header {
|
||||||
|
position: relative;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: minmax(240px, 37%) minmax(0, 1fr);
|
||||||
|
gap: clamp(28px, 4vw, 64px);
|
||||||
|
padding: 14px var(--up-gutter) 26px;
|
||||||
|
flex: none;
|
||||||
}
|
}
|
||||||
.up-next-now {
|
.up-next-now {
|
||||||
flex: none;
|
min-width: 0;
|
||||||
width: var(--up-video-w);
|
|
||||||
}
|
}
|
||||||
.up-next-video {
|
.up-next-video {
|
||||||
display: block;
|
display: block;
|
||||||
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
aspect-ratio: 16 / 9;
|
aspect-ratio: 16 / 9;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
|
outline: 1px solid #ffffff30;
|
||||||
transition: box-shadow var(--t-fast);
|
outline-offset: 2px;
|
||||||
}
|
}
|
||||||
.up-next-video:hover,
|
.up-next-video > span {
|
||||||
.up-next-video:focus-visible {
|
position: absolute;
|
||||||
outline: none;
|
inset: 0;
|
||||||
box-shadow: 0 0 0 2px #fff;
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border-radius: inherit;
|
||||||
|
background: #0007;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 150ms;
|
||||||
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
.up-next-progress {
|
.up-next-video:hover > span, .up-next-video:focus-visible > span {
|
||||||
margin-top: 12px;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
.up-next-progress-text {
|
.up-next-caption {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
|
margin: 14px 0 8px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: var(--muted);
|
color: #b8bfc1;
|
||||||
}
|
}
|
||||||
.up-next-progress-text span {
|
.up-next-caption > span {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
.up-next-progress-text small {
|
.up-next-caption small {
|
||||||
flex: none;
|
flex: none;
|
||||||
font-size: inherit;
|
|
||||||
color: var(--dim);
|
|
||||||
font-variant-numeric: tabular-nums;
|
font-variant-numeric: tabular-nums;
|
||||||
}
|
}
|
||||||
.up-next-video:hover + .up-next-progress .up-next-progress-text span {
|
.up-next-progress {
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
.up-next-progress-bar {
|
|
||||||
height: 3px;
|
height: 3px;
|
||||||
margin-top: 8px;
|
border-radius: 2px;
|
||||||
border-radius: 3px;
|
background: #ffffff25;
|
||||||
background: rgba(255, 255, 255, 0.22);
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.up-next-progress-bar i {
|
.up-next-progress i {
|
||||||
display: block;
|
display: block;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: var(--accent);
|
background: var(--accent);
|
||||||
}
|
}
|
||||||
.up-next-info {
|
.up-next-details {
|
||||||
flex: 1;
|
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
max-width: 680px;
|
align-self: center;
|
||||||
padding-top: 6px;
|
|
||||||
text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
|
|
||||||
}
|
}
|
||||||
.up-next-info .micro {
|
.up-next-details .micro {
|
||||||
display: block;
|
display: block;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 10px;
|
||||||
|
color: #a5adaf;
|
||||||
}
|
}
|
||||||
.up-next-info .up-next-logo {
|
.up-next-details .title-art {
|
||||||
margin-bottom: 14px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
.up-next-info .title-text {
|
.up-next-details h1 {
|
||||||
font-size: clamp(26px, 2.4vw, 36px);
|
margin: 10px 0;
|
||||||
margin-bottom: 12px;
|
font-size: clamp(22px, 2vw, 30px);
|
||||||
}
|
|
||||||
.up-next-info h1 {
|
|
||||||
margin: 0 0 10px;
|
|
||||||
font-size: clamp(20px, 1.7vw, 26px);
|
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
letter-spacing: -0.025em;
|
letter-spacing: -.025em;
|
||||||
font-weight: 680;
|
|
||||||
overflow: hidden;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
}
|
||||||
.up-next-summary {
|
.up-next-summary {
|
||||||
margin: 14px 0 0;
|
color: #b6bdbf;
|
||||||
color: #e3e7e9;
|
font-size: 13px;
|
||||||
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 1px 14px rgba(0, 0, 0, 0.55);
|
line-height: 1.65;
|
||||||
font-size: 14px;
|
margin: 12px 0 18px;
|
||||||
line-height: 1.62;
|
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
-webkit-line-clamp: 3;
|
-webkit-line-clamp: 3;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
max-width: 720px;
|
||||||
}
|
}
|
||||||
/* The countdown: a lighter fill sweeps across the button, without numbers. */
|
|
||||||
.up-next-play {
|
.up-next-play {
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
isolation: isolate;
|
min-height: 42px;
|
||||||
margin-top: 22px;
|
padding: 0 20px;
|
||||||
text-shadow: none;
|
border-radius: 6px;
|
||||||
|
background: #eee;
|
||||||
|
color: #101214;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 650;
|
||||||
}
|
}
|
||||||
.up-next-play.counting,
|
.up-next-play.counting {
|
||||||
.up-next-play.counting:hover:not(:disabled) {
|
background: #999;
|
||||||
background: #a3a8a9;
|
|
||||||
}
|
}
|
||||||
.up-next-play-fill {
|
.up-next-play.counting::before {
|
||||||
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
inset: 0;
|
inset: 0 auto 0 0;
|
||||||
z-index: -1;
|
width: var(--p);
|
||||||
background: #f6f7f7;
|
background: #f4f4f4;
|
||||||
transform: scaleX(0);
|
transition: width 60ms linear;
|
||||||
transform-origin: left;
|
|
||||||
will-change: transform;
|
|
||||||
}
|
}
|
||||||
.up-next-play:focus-visible {
|
.up-next-play > span {
|
||||||
outline: 2px solid #fff;
|
position: relative;
|
||||||
outline-offset: 3px;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
.up-next-play:hover {
|
||||||
|
box-shadow: 0 0 0 2px #ffffff40;
|
||||||
|
}
|
||||||
|
.up-next-hint {
|
||||||
|
font-size: 11px;
|
||||||
|
color: #90999c;
|
||||||
|
margin: 10px 0 0;
|
||||||
}
|
}
|
||||||
.up-next-rows {
|
.up-next-rows {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
|
||||||
flex: 1;
|
|
||||||
min-height: 0;
|
|
||||||
overflow-x: hidden;
|
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
padding-bottom: 12px;
|
min-height: 0;
|
||||||
animation: fade-in 420ms var(--ease);
|
padding: 0 var(--up-gutter) 32px;
|
||||||
|
scrollbar-gutter: stable;
|
||||||
}
|
}
|
||||||
.up-next-shelf {
|
.up-next-rail {
|
||||||
margin-bottom: 22px;
|
margin-bottom: 24px;
|
||||||
}
|
}
|
||||||
/* Cards are sized from the space below the header, so the season and related
|
.up-next-rail h2 {
|
||||||
rows fill it (--up-row: a row's height besides its artwork). In a short,
|
font-size: 18px;
|
||||||
wide window they keep a sensible size and the related row runs off the
|
font-weight: 650;
|
||||||
bottom, as on Android TV. */
|
margin: 0 0 14px;
|
||||||
.up-next-rows {
|
|
||||||
container-type: size;
|
|
||||||
--up-row: 128px;
|
|
||||||
}
|
}
|
||||||
.up-next-shelf .shelf .card.landscape {
|
.up-next-cards {
|
||||||
width: clamp(15vw, calc((50cqh - var(--up-row)) * 16 / 9), 26vw);
|
display: flex;
|
||||||
|
gap: 16px;
|
||||||
|
overflow-x: auto;
|
||||||
|
padding: 4px 4px 14px;
|
||||||
|
scroll-snap-type: x proximity;
|
||||||
}
|
}
|
||||||
@media (max-width: 1333px) {
|
.up-next-card {
|
||||||
.up-next-shelf .shelf .card.landscape {
|
flex: 0 0 clamp(190px, 20vw, 280px);
|
||||||
width: clamp(200px, calc((50cqh - var(--up-row)) * 16 / 9), 26vw);
|
min-width: 0;
|
||||||
|
text-align: left;
|
||||||
|
scroll-snap-align: start;
|
||||||
|
}
|
||||||
|
.up-next-card-art {
|
||||||
|
position: relative;
|
||||||
|
background: #202427;
|
||||||
|
aspect-ratio: 16 / 9;
|
||||||
|
border-radius: 7px;
|
||||||
|
overflow: hidden;
|
||||||
|
outline: 1px solid #ffffff15;
|
||||||
|
}
|
||||||
|
.up-next-card-art img {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
transition: transform 180ms;
|
||||||
|
}
|
||||||
|
.up-next-card:hover img {
|
||||||
|
transform: scale(1.035);
|
||||||
|
}
|
||||||
|
.up-next-card-art > span {
|
||||||
|
position: absolute;
|
||||||
|
left: 8px;
|
||||||
|
bottom: 8px;
|
||||||
|
background: #0b0d0fe6;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 4px 7px;
|
||||||
|
font-size: 10px;
|
||||||
|
font-weight: 650;
|
||||||
|
}
|
||||||
|
.up-next-card > b {
|
||||||
|
display: block;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 550;
|
||||||
|
margin-top: 10px;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
.up-next-card.poster {
|
||||||
|
flex-basis: clamp(120px, 12vw, 170px);
|
||||||
|
}
|
||||||
|
.up-next-card.poster .up-next-card-art {
|
||||||
|
aspect-ratio: 2 / 3;
|
||||||
|
}
|
||||||
|
.up-next button:focus-visible {
|
||||||
|
outline: 2px solid #fff;
|
||||||
|
outline-offset: 3px;
|
||||||
|
}
|
||||||
|
@media (max-height: 720px) {
|
||||||
|
.up-next-header {
|
||||||
|
grid-template-columns: minmax(220px, 32%) minmax(0, 1fr);
|
||||||
|
gap: 28px;
|
||||||
|
padding-top: 8px;
|
||||||
|
padding-bottom: 22px;
|
||||||
}
|
}
|
||||||
}
|
.up-next-details .title-art {
|
||||||
.up-next-shelf .card {
|
max-height: 38px;
|
||||||
scroll-margin-left: 0;
|
|
||||||
}
|
|
||||||
@media (max-height: 760px) {
|
|
||||||
.up-next-head {
|
|
||||||
padding-bottom: 20px;
|
|
||||||
}
|
}
|
||||||
.up-next-info .micro {
|
.up-next-details h1 {
|
||||||
margin-bottom: 8px;
|
font-size: 22px;
|
||||||
}
|
margin: 6px 0;
|
||||||
.up-next-info .up-next-logo {
|
|
||||||
height: 44px !important;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
.up-next-info .up-next-logo img {
|
|
||||||
max-height: 44px !important;
|
|
||||||
}
|
}
|
||||||
.up-next-summary {
|
.up-next-summary {
|
||||||
-webkit-line-clamp: 2;
|
-webkit-line-clamp: 2;
|
||||||
margin-top: 10px;
|
margin: 8px 0 12px;
|
||||||
}
|
}
|
||||||
.up-next-play {
|
.up-next-details .micro {
|
||||||
margin-top: 16px;
|
margin-bottom: 6px;
|
||||||
}
|
}
|
||||||
.up-next-shelf {
|
|
||||||
margin-bottom: 14px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.up-next .card:focus-visible {
|
|
||||||
outline: none;
|
|
||||||
}
|
}
|
||||||
.player-error {
|
.player-error {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
|
||||||
|
|
@ -430,30 +430,6 @@ button.chip:hover {
|
||||||
letter-spacing: -0.035em;
|
letter-spacing: -0.035em;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
.season-switch {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 6px;
|
|
||||||
margin-left: -8px;
|
|
||||||
padding: 2px 6px 2px 8px;
|
|
||||||
border-radius: 8px;
|
|
||||||
font: inherit;
|
|
||||||
letter-spacing: inherit;
|
|
||||||
transition: background var(--t-fast);
|
|
||||||
}
|
|
||||||
.season-switch svg {
|
|
||||||
color: #aeb5b8;
|
|
||||||
transition:
|
|
||||||
color var(--t-fast),
|
|
||||||
transform var(--t-fast);
|
|
||||||
}
|
|
||||||
.season-switch:hover {
|
|
||||||
background: rgba(255, 255, 255, 0.08);
|
|
||||||
}
|
|
||||||
.season-switch:hover svg {
|
|
||||||
color: #fff;
|
|
||||||
transform: translateY(1px);
|
|
||||||
}
|
|
||||||
.synopsis-wrap {
|
.synopsis-wrap {
|
||||||
max-width: 640px;
|
max-width: 640px;
|
||||||
}
|
}
|
||||||
|
|
@ -604,29 +580,122 @@ button.chip:hover {
|
||||||
}
|
}
|
||||||
/* Episodes */
|
/* Episodes */
|
||||||
.episodes {
|
.episodes {
|
||||||
margin-bottom: 34px;
|
margin-bottom: 36px;
|
||||||
}
|
}
|
||||||
.episodes .shelf-head {
|
.episodes-head {
|
||||||
padding: 0;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 16px;
|
||||||
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
.episode-grid {
|
.episodes-head h2 {
|
||||||
display: grid;
|
margin: 0;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(clamp(240px, 19vw, 320px), 1fr));
|
font-size: 19px;
|
||||||
gap: 30px 16px;
|
letter-spacing: -0.028em;
|
||||||
}
|
}
|
||||||
.episode-grid .card {
|
.episodes-sub {
|
||||||
|
color: var(--dim);
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
.season-summary {
|
||||||
|
color: #aeb5b8;
|
||||||
|
font-size: 12.5px;
|
||||||
|
line-height: 1.6;
|
||||||
|
max-width: 760px;
|
||||||
|
margin: 4px 0 8px;
|
||||||
|
}
|
||||||
|
.episode-row {
|
||||||
scroll-margin: 96px 0 48px;
|
scroll-margin: 96px 0 48px;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 34px 220px minmax(0, 1fr) 40px;
|
||||||
|
gap: 20px;
|
||||||
|
align-items: center;
|
||||||
|
padding: 16px 12px 16px 6px;
|
||||||
|
border-bottom: 1px solid var(--line-soft);
|
||||||
|
border-radius: 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background var(--t-fast);
|
||||||
}
|
}
|
||||||
.episode-card-summary {
|
.episode-row:hover,
|
||||||
margin: 7px 0 0;
|
.episode-row:focus-visible {
|
||||||
|
background: rgba(255, 255, 255, 0.045);
|
||||||
|
}
|
||||||
|
.episode-row:focus-visible {
|
||||||
|
outline: 2px solid #f2f5f4;
|
||||||
|
outline-offset: 0;
|
||||||
|
}
|
||||||
|
.episode-index {
|
||||||
|
font-size: 22px;
|
||||||
|
font-weight: 650;
|
||||||
|
color: #8a9196;
|
||||||
|
text-align: center;
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
}
|
||||||
|
.episode-pic {
|
||||||
|
position: relative;
|
||||||
|
aspect-ratio: 16 / 9;
|
||||||
|
border-radius: 6px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #1c2024;
|
||||||
|
}
|
||||||
|
.episode-pic .artwork {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
}
|
||||||
|
.episode-play {
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
width: 42px;
|
||||||
|
height: 42px;
|
||||||
|
margin: -21px 0 0 -21px;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
background: rgba(255, 255, 255, 0.92);
|
||||||
|
color: #121314;
|
||||||
|
opacity: 0;
|
||||||
|
transform: scale(0.9);
|
||||||
|
transition:
|
||||||
|
opacity var(--t),
|
||||||
|
transform var(--t) var(--ease-out);
|
||||||
|
}
|
||||||
|
.episode-row:hover .episode-play {
|
||||||
|
opacity: 1;
|
||||||
|
transform: none;
|
||||||
|
}
|
||||||
|
.episode-text h3 {
|
||||||
|
font-size: 14px;
|
||||||
|
margin: 0 0 4px;
|
||||||
|
font-weight: 640;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
.episode-watched {
|
||||||
|
color: #9fd6bb;
|
||||||
|
}
|
||||||
|
.episode-meta {
|
||||||
|
font-size: 11.5px;
|
||||||
|
color: #8a9196;
|
||||||
|
margin-bottom: 7px;
|
||||||
|
}
|
||||||
|
.episode-text p {
|
||||||
|
margin: 0;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 1.55;
|
line-height: 1.55;
|
||||||
color: #a1a8ac;
|
color: #a8afb3;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
-webkit-line-clamp: 3;
|
-webkit-line-clamp: 2;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
.episode-more {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
.episode-row:hover .episode-more {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* —— Search ————————————————————————————————————————————————— */
|
/* —— Search ————————————————————————————————————————————————— */
|
||||||
.search-hero {
|
.search-hero {
|
||||||
|
|
@ -1976,6 +2045,10 @@ button.chip:hover {
|
||||||
.download-intro {
|
.download-intro {
|
||||||
grid-template-columns: minmax(0, 1fr);
|
grid-template-columns: minmax(0, 1fr);
|
||||||
}
|
}
|
||||||
|
.episode-row {
|
||||||
|
grid-template-columns: 26px 160px minmax(0, 1fr) 36px;
|
||||||
|
gap: 14px;
|
||||||
|
}
|
||||||
.history-row {
|
.history-row {
|
||||||
grid-template-columns: 36px minmax(0, 1fr) 120px 90px;
|
grid-template-columns: 36px minmax(0, 1fr) 120px 90px;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ const PATHS: Record<string, string> = {
|
||||||
arrowLeft: '<path d="M19 12H5m6-6-6 6 6 6"/>',
|
arrowLeft: '<path d="M19 12H5m6-6-6 6 6 6"/>',
|
||||||
play: '<path d="M7 4.8v14.4a.8.8 0 0 0 1.2.7l11.6-7.2a.8.8 0 0 0 0-1.4L8.2 4.1a.8.8 0 0 0-1.2.7Z" fill="currentColor" stroke="none"/>',
|
play: '<path d="M7 4.8v14.4a.8.8 0 0 0 1.2.7l11.6-7.2a.8.8 0 0 0 0-1.4L8.2 4.1a.8.8 0 0 0-1.2.7Z" fill="currentColor" stroke="none"/>',
|
||||||
pause: '<rect x="6" y="4.5" width="4" height="15" rx="1.2" fill="currentColor" stroke="none"/><rect x="14" y="4.5" width="4" height="15" rx="1.2" fill="currentColor" stroke="none"/>',
|
pause: '<rect x="6" y="4.5" width="4" height="15" rx="1.2" fill="currentColor" stroke="none"/><rect x="14" y="4.5" width="4" height="15" rx="1.2" fill="currentColor" stroke="none"/>',
|
||||||
stop: '<rect x="5.5" y="5.5" width="13" height="13" rx="1.6" fill="currentColor" stroke="none"/>',
|
|
||||||
plus: '<path d="M12 5v14M5 12h14"/>',
|
plus: '<path d="M12 5v14M5 12h14"/>',
|
||||||
minus: '<path d="M5 12h14"/>',
|
minus: '<path d="M5 12h14"/>',
|
||||||
check: '<path d="m5 12.5 4.2 4.2L19 7"/>',
|
check: '<path d="m5 12.5 4.2 4.2L19 7"/>',
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
import { memo, useEffect, useLayoutEffect, useRef, useState, type ReactNode } from 'react';
|
import { memo, useEffect, useRef, useState, type ReactNode } from 'react';
|
||||||
import type { Item } from '../plex/types';
|
import type { Item } from '../plex/types';
|
||||||
import { useServer, useSession } from '../app/session';
|
import { useServer, useSession } from '../app/session';
|
||||||
import { useSettings } from '../app/settings';
|
import { useSettings } from '../app/settings';
|
||||||
import { art, date, displayTitle, duration, episodeLabel, formatBadges, isWatched, progress, remaining, remainingEpisodes } from '../app/format';
|
import { art, displayTitle, duration, episodeLabel, formatBadges, isWatched, progress, remaining, remainingEpisodes } from '../app/format';
|
||||||
import { itemMenu, openItem, playWithVersion } from '../app/actions';
|
import { itemMenu, openItem, playWithVersion } from '../app/actions';
|
||||||
import { navigate } from '../app/router';
|
|
||||||
import { Artwork } from './primitives';
|
import { Artwork } from './primitives';
|
||||||
import { Icon } from './Icon';
|
import { Icon } from './Icon';
|
||||||
import { openMenu } from './overlays';
|
import { openMenu } from './overlays';
|
||||||
|
|
@ -142,14 +141,9 @@ function WatchBadge({ item }: { item: Item }) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
function ProgressLine({ item }: { item: Item }) {
|
||||||
* A watched title's leftover position (from an unfinished rewatch) only shows where it's
|
|
||||||
* what you're resuming: Continue Watching, or the season's up-next episode.
|
|
||||||
*/
|
|
||||||
function ProgressLine({ item, always = false }: { item: Item; always?: boolean }) {
|
|
||||||
const percent = useSettings((s) => s.watchedPercent);
|
|
||||||
const p = progress(item);
|
const p = progress(item);
|
||||||
if (!p || p > 0.995 || (!always && isWatched(item, percent))) return null;
|
if (!p || p > 0.995) return null;
|
||||||
return (
|
return (
|
||||||
<span className="progress-line">
|
<span className="progress-line">
|
||||||
<i style={{ width: `${Math.max(3, p * 100)}%` }} />
|
<i style={{ width: `${Math.max(3, p * 100)}%` }} />
|
||||||
|
|
@ -210,15 +204,12 @@ export const PosterCard = memo(function PosterCard({ item, caption = 'year', cla
|
||||||
const server = useServer();
|
const server = useServer();
|
||||||
const handlers = useCardHandlers(item);
|
const handlers = useCardHandlers(item);
|
||||||
const path = art.poster(item);
|
const path = art.poster(item);
|
||||||
// On its show's page a season is just "Season 2"; anywhere else it needs the show's name.
|
|
||||||
const seasonAlone = item.type === 'season' && caption !== 'episodes' && !!item.parentTitle;
|
|
||||||
const title = item.type === 'season' && !seasonAlone ? item.title : displayTitle(item);
|
|
||||||
let meta: ReactNode = null;
|
let meta: ReactNode = null;
|
||||||
if (caption === 'year') meta = item.type === 'episode' ? episodeLabel(item) : item.type === 'season' ? item.title : item.type === 'collection' ? (item.childCount ? `${item.childCount} titles` : 'Collection') : item.year || '';
|
if (caption === 'year') meta = item.type === 'episode' ? episodeLabel(item) : item.type === 'season' ? (item.leafCount ? `${item.leafCount} episodes` : '') : item.type === 'collection' ? (item.childCount ? `${item.childCount} titles` : 'Collection') : item.year || '';
|
||||||
if (caption === 'episodes') meta = item.leafCount ? `${item.leafCount} episodes` : '';
|
if (caption === 'episodes') meta = item.leafCount ? `${item.leafCount} episodes` : '';
|
||||||
if (caption === 'role') meta = (item as any).roleName ?? item.year;
|
if (caption === 'role') meta = (item as any).roleName ?? item.year;
|
||||||
return (
|
return (
|
||||||
<article className={`card poster ${className}`} role="button" tabIndex={0} aria-label={seasonAlone ? `${title}, ${item.title}` : title} {...handlers} {...previewHandlers(item)}>
|
<article className={`card poster ${className}`} role="button" tabIndex={0} aria-label={item.title} {...handlers} {...previewHandlers(item)}>
|
||||||
<div className="card-cover">
|
<div className="card-cover">
|
||||||
<Artwork src={server.image(path, 240, 360)} alt="" fallback={<span className="cover-fallback">{displayTitle(item)}</span>} />
|
<Artwork src={server.image(path, 240, 360)} alt="" fallback={<span className="cover-fallback">{displayTitle(item)}</span>} />
|
||||||
<div className="card-hover" />
|
<div className="card-hover" />
|
||||||
|
|
@ -228,8 +219,8 @@ export const PosterCard = memo(function PosterCard({ item, caption = 'year', cla
|
||||||
</div>
|
</div>
|
||||||
{caption !== 'none' && (
|
{caption !== 'none' && (
|
||||||
<div className="card-caption">
|
<div className="card-caption">
|
||||||
<div className="card-title" title={title}>
|
<div className="card-title" title={item.type === 'season' ? item.title : displayTitle(item)}>
|
||||||
{title}
|
{item.type === 'season' ? item.title : displayTitle(item)}
|
||||||
</div>
|
</div>
|
||||||
{meta ? <div className="card-meta">{meta}</div> : null}
|
{meta ? <div className="card-meta">{meta}</div> : null}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -241,16 +232,14 @@ export const PosterCard = memo(function PosterCard({ item, caption = 'year', cla
|
||||||
export const LandscapeCard = memo(function LandscapeCard({ item, continueWatching, showTitle = true, episodeStyle = false }: { item: Item; continueWatching?: boolean; showTitle?: boolean; episodeStyle?: boolean }) {
|
export const LandscapeCard = memo(function LandscapeCard({ item, continueWatching, showTitle = true, episodeStyle = false }: { item: Item; continueWatching?: boolean; showTitle?: boolean; episodeStyle?: boolean }) {
|
||||||
const server = useServer();
|
const server = useServer();
|
||||||
const handlers = useCardHandlers(item, { continueWatching });
|
const handlers = useCardHandlers(item, { continueWatching });
|
||||||
const percent = useSettings((s) => s.watchedPercent);
|
|
||||||
const inProgress = !!item.viewOffset && (continueWatching || !isWatched(item, percent));
|
|
||||||
const isEp = item.type === 'episode';
|
const isEp = item.type === 'episode';
|
||||||
const path = isEp ? item.thumb || item.grandparentArt : art.landscape(item);
|
const path = isEp ? item.thumb || item.grandparentArt : art.landscape(item);
|
||||||
const title = episodeStyle && isEp ? `${item.index}. ${item.title}` : displayTitle(item);
|
const title = episodeStyle && isEp ? `${item.index}. ${item.title}` : displayTitle(item);
|
||||||
const meta = isEp
|
const meta = isEp
|
||||||
? episodeStyle
|
? episodeStyle
|
||||||
? [duration(item.duration), inProgress ? remaining(item) : ''].filter(Boolean).join(' · ')
|
? [duration(item.duration), item.viewOffset ? remaining(item) : ''].filter(Boolean).join(' · ')
|
||||||
: `${episodeLabel(item)} ${item.title}`
|
: `${episodeLabel(item)} ${item.title}`
|
||||||
: inProgress
|
: item.viewOffset
|
||||||
? remaining(item)
|
? remaining(item)
|
||||||
: [item.year, duration(item.duration)].filter(Boolean).join(' · ');
|
: [item.year, duration(item.duration)].filter(Boolean).join(' · ');
|
||||||
return (
|
return (
|
||||||
|
|
@ -265,25 +254,12 @@ export const LandscapeCard = memo(function LandscapeCard({ item, continueWatchin
|
||||||
<div className="card-hover" />
|
<div className="card-hover" />
|
||||||
<CardActions item={item} ctx={{ continueWatching }} />
|
<CardActions item={item} ctx={{ continueWatching }} />
|
||||||
{episodeStyle && <WatchBadge item={item} />}
|
{episodeStyle && <WatchBadge item={item} />}
|
||||||
<ProgressLine item={item} always={continueWatching} />
|
<ProgressLine item={item} />
|
||||||
</div>
|
</div>
|
||||||
{showTitle && (
|
{showTitle && (
|
||||||
<div className="card-caption">
|
<div className="card-caption">
|
||||||
<div className="card-title" title={title}>
|
<div className="card-title" title={title}>
|
||||||
{isEp && !episodeStyle && item.grandparentId ? (
|
{title}
|
||||||
<button
|
|
||||||
className="card-title-link"
|
|
||||||
tabIndex={-1}
|
|
||||||
onClick={(e) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
navigate({ name: 'item', id: item.grandparentId, title: item.grandparentTitle });
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{title}
|
|
||||||
</button>
|
|
||||||
) : (
|
|
||||||
title
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
<div className="card-meta">{meta}</div>
|
<div className="card-meta">{meta}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -292,34 +268,6 @@ export const LandscapeCard = memo(function LandscapeCard({ item, continueWatchin
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
/** An episode with its synopsis, for a season's episode grid. `upNext` shows its resume point even when watched. */
|
|
||||||
export const EpisodeCard = memo(function EpisodeCard({ item, upNext = false }: { item: Item; upNext?: boolean }) {
|
|
||||||
const server = useServer();
|
|
||||||
const handlers = useCardHandlers(item);
|
|
||||||
const percent = useSettings((s) => s.watchedPercent);
|
|
||||||
const inProgress = !!item.viewOffset && (upNext || !isWatched(item, percent));
|
|
||||||
const title = item.index ? `${item.index}. ${item.title}` : item.title;
|
|
||||||
const meta = [duration(item.duration), inProgress ? remaining(item) : date(item.originallyAvailableAt)].filter(Boolean).join(' · ');
|
|
||||||
return (
|
|
||||||
<article className="card landscape episode-card" role="button" tabIndex={0} aria-label={title} {...handlers}>
|
|
||||||
<div className="card-cover">
|
|
||||||
<Artwork src={server.image(item.thumb || item.grandparentArt, 400, 225)} alt="" fallback={<span className="cover-fallback">{title}</span>} />
|
|
||||||
<div className="card-hover" />
|
|
||||||
<CardActions item={item} />
|
|
||||||
<WatchBadge item={item} />
|
|
||||||
<ProgressLine item={item} always={upNext} />
|
|
||||||
</div>
|
|
||||||
<div className="card-caption">
|
|
||||||
<div className="card-title" title={title}>
|
|
||||||
{title}
|
|
||||||
</div>
|
|
||||||
<div className="card-meta">{meta}</div>
|
|
||||||
{item.summary && <p className="episode-card-summary">{item.summary}</p>}
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
export function PersonCard({ name, role, thumb, onClick }: { name: string; role?: string; thumb?: string; onClick?: () => void }) {
|
export function PersonCard({ name, role, thumb, onClick }: { name: string; role?: string; thumb?: string; onClick?: () => void }) {
|
||||||
const server = useServer();
|
const server = useServer();
|
||||||
const initials = name
|
const initials = name
|
||||||
|
|
@ -342,22 +290,15 @@ export function PersonCard({ name, role, thumb, onClick }: { name: string; role?
|
||||||
|
|
||||||
export function Shelf({ title, subtitle, onViewAll, children, className = '', kind = 'poster' }: { title: ReactNode; subtitle?: ReactNode; onViewAll?: () => void; children: ReactNode; className?: string; kind?: 'poster' | 'landscape' | 'people' | 'wide' }) {
|
export function Shelf({ title, subtitle, onViewAll, children, className = '', kind = 'poster' }: { title: ReactNode; subtitle?: ReactNode; onViewAll?: () => void; children: ReactNode; className?: string; kind?: 'poster' | 'landscape' | 'people' | 'wide' }) {
|
||||||
const row = useRef<HTMLDivElement>(null);
|
const row = useRef<HTMLDivElement>(null);
|
||||||
const atStart = useRef(true);
|
|
||||||
const [edges, setEdges] = useState({ start: true, end: false });
|
const [edges, setEdges] = useState({ start: true, end: false });
|
||||||
const update = () => {
|
const update = () => {
|
||||||
const el = row.current;
|
const el = row.current;
|
||||||
if (!el) return;
|
if (!el) return;
|
||||||
const start = el.scrollLeft < 8;
|
const start = el.scrollLeft < 8;
|
||||||
const end = el.scrollLeft + el.clientWidth >= el.scrollWidth - 8;
|
const end = el.scrollLeft + el.clientWidth >= el.scrollWidth - 8;
|
||||||
atStart.current = start;
|
|
||||||
// Runs on every scroll event; re-render only when an edge changes.
|
// Runs on every scroll event; re-render only when an edge changes.
|
||||||
setEdges((prev) => (prev.start === start && prev.end === end ? prev : { start, end }));
|
setEdges((prev) => (prev.start === start && prev.end === end ? prev : { start, end }));
|
||||||
};
|
};
|
||||||
// A row the viewer hasn't scrolled stays at its start when items are added
|
|
||||||
// in front (Continue Watching), rather than holding on to the old first card.
|
|
||||||
useLayoutEffect(() => {
|
|
||||||
if (atStart.current && row.current) row.current.scrollLeft = 0;
|
|
||||||
}, [children]);
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
update();
|
update();
|
||||||
const el = row.current;
|
const el = row.current;
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
{
|
{
|
||||||
"version": "1.0.1",
|
"version": "0.1.0-beta.14",
|
||||||
"notes": "A quicker start, a Stop button, and recovery when the server drops out mid-video.\r\n\r\n- Kaleido starts faster: the opening animation is shorter, so you reach your library in about a second.\r\n- The player has a Stop button, next to the forward controls, which closes the player completely instead of moving it to the miniplayer.\r\n- If your Plex server goes down while you're watching, the player waits for it once the buffered video runs out, then carries on from the same spot when the server is back. Before, it treated the video as finished and Play started it again from the beginning. Pressing Play while it waits tries to reconnect straight away.",
|
"notes": "Full screen stays on with the miniplayer, a smoother colour wash, and a round of playback and download fixes.\n\n- Going back from the full-screen player to the miniplayer now keeps Kaleido in full screen, so you can browse full screen while the video plays in the corner. Press Esc to go back to a window, or on Windows use the new Exit full screen button beside the window controls. Closing the miniplayer leaves the window as it is.\n- The colour wash behind the featured titles and title pages now blends into the next title's colours instead of jumping when the artwork changes. Clicking quickly through featured titles no longer blanks the background for a moment.\n- Playback stays with the server it started on: progress and watched marks never go to a server you switch to later, and switching account, profile or server ends playback from the old one. Downloads report only to their own server.\n- When Plex converts a video, the audio and subtitle tracks you chose (and your language preferences) are now applied, and kept when you change quality.\n- Watching a download offline now saves where you stopped and marks it watched.\n- Fixed: playing something offline could crash the player.\n- Fixed: closing or switching titles while a video was still starting could start it anyway.\n- Fixed: Home and the libraries could still show the previous account's or profile's titles after switching.\n- Fixed: titles split into several files were downloaded only in part; Kaleido now picks a single-file version, or says it can't download the title.\n- Fixed: episodes downloaded into the same season folder could overwrite or delete each other's artwork, and pause or remove could stop working after a download restarted.\n- Library grids refresh fully when something changes, slow server responses time out properly, and the featured titles start rotating again when you scroll back to them.",
|
||||||
"pub_date": "2026-11-17T17:47:20.996Z",
|
"pub_date": "2026-11-07T02:37:16.806Z",
|
||||||
"platforms": {
|
"platforms": {
|
||||||
"windows-x86_64": {
|
"windows-x86_64": {
|
||||||
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVST1RiNHdFVm01NFZMQVRPVll0SHZPQWJWUlIyQnZEME10bldKUnYxSkhHWEJSWWxOT3FoVHp6NlNsU0dwdlg1UmUweGlEdzNoQnduSnora0dZempZS2ZWdFZLa3BIRkFJPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzk0OTM3NjI5CWZpbGU6S2FsZWlkb18xLjAuMV94NjQtc2V0dXAuZXhlCXZlcnNpb246MS4wLjEKeUI5aUJ4d3hONmVlNlBBWDFxQkFkYTV4WXU0eHIzb1ZKaVZjaDhpODhpbXdvL2RWRlhTRTBwQXJGV3hJYlg2RERnMDBhSFBRWHZDekxCRTVNNCtIRFE9PQo=",
|
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVST1RiNHdFVm01NFgxcit2QjBSdGQ4ait3d1FwdzZXMlJBeS95R25BTFV5ekUremhQdVAzd0h3M2hTMXVNWTBkeHlnRXlaam1rTHRIbGhOSWM2aXVqcFJHLzBCZTdJandrPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzk0MDE5MDE2CWZpbGU6S2FsZWlkb18wLjEuMC1iZXRhLjE0X3g2NC1zZXR1cC5leGUJdmVyc2lvbjowLjEuMC1iZXRhLjE0CkpqTDRPeGVDeDFSZjdkSWUxeDdQbXlpUTdLR1BrRk00Z2labzMyVjEzQUZFZkJrM3lVKzlheGpKQm5TQTVyMmFpTHFwNUYrd2huUkZ4OFhiaTFjNUNBPT0K",
|
||||||
"url": "https://git.elijahkuntz.com/Elijah/Kaleido-Desktop/releases/download/v1.0.1/Kaleido_1.0.1_x64-setup.exe"
|
"url": "https://git.elijahkuntz.com/Elijah/Kaleido-Desktop/releases/download/v0.1.0-beta.14/Kaleido_0.1.0-beta.14_x64-setup.exe"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue