feat: tile view, in-app streaming, and self-painted title bar
Clicking an undownloaded video now plays it in the app instead of handing off to the browser. YouTube's iframe embed cannot be used — it rejects a tauri:// origin with Error 153 — so yt-dlp resolves YouTube's HLS master playlist instead, whose H.264+AAC variants AVFoundation streams natively in WKWebView, adaptive up to 1080p. Adds an optional Tiles view alongside the list, remembered between launches. The title bar is now transparent with the title hidden, and the app paints that strip itself in the page background so it matches instead of showing macOS chrome beside the traffic lights.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { BTN_PRIMARY, INPUT } from "./ui";
|
||||
import { BTN_PRIMARY, INPUT, Segmented } from "./ui";
|
||||
|
||||
export type ViewMode = "list" | "grid";
|
||||
|
||||
interface Props {
|
||||
search: string;
|
||||
@@ -15,6 +17,8 @@ interface Props {
|
||||
refreshing: boolean;
|
||||
refreshProgress: { done: number; total: number } | null;
|
||||
resultCount: number;
|
||||
view: ViewMode;
|
||||
onView: (v: ViewMode) => void;
|
||||
}
|
||||
|
||||
/** Neutral outline until active; active is the one filled state. */
|
||||
@@ -49,7 +53,7 @@ function Toggle({
|
||||
export default function TopBar({
|
||||
search, onSearch, downloadedOnly, onDownloadedOnly, hideShorts, onHideShorts,
|
||||
online, reachable, forcedOffline, onToggleForcedOffline,
|
||||
onRefresh, refreshing, refreshProgress, resultCount,
|
||||
onRefresh, refreshing, refreshProgress, resultCount, view, onView,
|
||||
}: Props) {
|
||||
const pct = refreshProgress && refreshProgress.total > 0
|
||||
? (refreshProgress.done / refreshProgress.total) * 100
|
||||
@@ -85,6 +89,15 @@ export default function TopBar({
|
||||
Hide Shorts
|
||||
</Toggle>
|
||||
|
||||
<Segmented
|
||||
value={view}
|
||||
onChange={onView}
|
||||
options={[
|
||||
{ value: "list", label: "List" },
|
||||
{ value: "grid", label: "Tiles" },
|
||||
]}
|
||||
/>
|
||||
|
||||
<button
|
||||
onClick={onToggleForcedOffline}
|
||||
title={
|
||||
|
||||
Reference in New Issue
Block a user