mirror of
https://github.com/KuekHaoYang/KVideo.git
synced 2026-08-12 23:33:43 +08:00
- 将 groupedSources 存储在 sessionStorage 中而非 URL 参数里,以防止因 URL 过长导致的 CDN 414 错误 (#112) - 自动将旧版 groupedSources URL 迁移至短 gs 键 - 从视频元素中检测并显示实际视频分辨率(例如 1920x1080),不再依赖来源提供的标签 - 修复 PlayerNavbar 设置链接在高级模式下总是跳转到 /settings 而非 /premium/settings 的问题 (#106) - 修复 WatchHistorySidebar 未向 HistoryList 传递 isPremium,导致历史记录项 URL 丢失 premium=1 参数的问题 (#106) - 为 HLS 播放添加多级浏览器回退机制 (HLS.js → 原生 → 代理 → 错误并提供浏览器建议) (#104) - 在 IPTV 播放器中添加 HEVC/H.265 级别过滤,防止 CCTV 等频道出现仅有音频播放的问题 (#81) - 更新依赖并升级版本至 4.5.0
56 lines
3.5 KiB
TypeScript
56 lines
3.5 KiB
TypeScript
import { useRouter } from 'next/navigation';
|
|
import Link from 'next/link';
|
|
import Image from 'next/image';
|
|
import { Button } from '@/components/ui/Button';
|
|
import { ThemeSwitcher } from '@/components/ThemeSwitcher';
|
|
import { Icons } from '@/components/ui/Icon';
|
|
import { siteConfig } from '@/lib/config/site-config';
|
|
|
|
export function PlayerNavbar({ isPremium }: { isPremium?: boolean }) {
|
|
const router = useRouter();
|
|
|
|
return (
|
|
<nav className="sticky top-0 z-50 pt-4 pb-2 px-4" style={{ transform: 'translateZ(0)' }}>
|
|
<div className="max-w-7xl mx-auto bg-[var(--glass-bg)] border border-[var(--glass-border)] rounded-[var(--radius-2xl)] shadow-[var(--shadow-sm)] px-4 sm:px-6 py-4">
|
|
<div className="flex items-center justify-between gap-2">
|
|
<div className="flex items-center gap-2 sm:gap-4 min-w-0">
|
|
<button
|
|
onClick={() => router.push(isPremium ? '/premium' : '/')}
|
|
className="flex items-center justify-center hover:opacity-80 transition-opacity flex-shrink-0 cursor-pointer"
|
|
title={isPremium ? "返回高级主页" : "返回首页"}
|
|
>
|
|
<Image
|
|
src="/icon.png"
|
|
alt={siteConfig.name}
|
|
width={40}
|
|
height={40}
|
|
className="object-contain"
|
|
/>
|
|
</button>
|
|
<Button
|
|
variant="secondary"
|
|
onClick={() => router.back()}
|
|
className="flex items-center gap-2"
|
|
>
|
|
<Icons.ChevronLeft size={20} />
|
|
<span className="hidden sm:inline">返回</span>
|
|
</Button>
|
|
</div>
|
|
<div className="flex items-center gap-3">
|
|
<Link
|
|
href={isPremium ? '/premium/settings' : '/settings'}
|
|
className="w-10 h-10 flex items-center justify-center rounded-[var(--radius-full)] bg-[var(--glass-bg)] border border-[var(--glass-border)] text-[var(--text-color)] hover:bg-[color-mix(in_srgb,var(--accent-color)_10%,transparent)] transition-all duration-200 cursor-pointer"
|
|
aria-label="设置"
|
|
>
|
|
<svg className="w-5 h-5" viewBox="0 -960 960 960" fill="currentColor">
|
|
<path d="m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z" />
|
|
</svg>
|
|
</Link>
|
|
<ThemeSwitcher />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
);
|
|
}
|