项目文件夹

文件
caorushizi de3b805ea0 feat(core,player-ui): refactor video API to use database and fix playback
Refactor video player API from filesystem scanning to database-backed:
- Video list queries downloads with status="success" + file existence check
- Add GET /api/v1/videos/:id endpoint for playing specific video by task ID
- Add playerUrl to /api/env response (computed from request host)
- Whitelist player/video paths in auth middleware
- Fix video URL generation to preserve folder structure (relative path)
- Fix player-ui Vite base path and video URL resolution under /player/
- Add openUrl implementation to web platform stubs
- Player-UI supports ?id= query param to auto-play specific video
- Play button now passes task.id instead of filename

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 22:45:27 +08:00

33 行
722 B
TypeScript

import path from "node:path";
import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
// https://vite.dev/config/
export default defineConfig({
clearScreen: false,
server: {
port: 8556,
strictPort: true,
},
envDir: "../../",
base: "/player/",
build: {
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes("video.js")) return "videojs";
if (id.includes("react-dom") || id.includes("react/"))
return "vendor";
},
},
},
},
plugins: [react(), tailwindcss()],
resolve: {
alias: {
"@": path.resolve(import.meta.dirname, "./src"),
},
},
});