mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-22 04:19:29 +00:00
On Safari/WebKit, video.currentTime (the playback clock) runs ahead of the frame actually presented on screen at playback start, and the first requestVideoFrameCallback arrives only after a delay. useFramePlayer drove the playhead from currentTime immediately on play, racing it forward, then snapped it backward when the first rVFC reported the true (lower) presented frame. Fix 1 (play-start rewind): reset the per-session VFC state on each play and only use the currentTime/RAF path when rVFC is unsupported, or has delivered a frame this session and then stalled (e.g. video track ended while audio continues), or never delivered within a safety grace. The playhead now follows the actually presented frame instead of the leading playback clock. Fix 2 (pause snap): on pause, prefer the last presented mediaTime when rVFC is fresh so the playhead locks to the frame the user is looking at, instead of jumping forward to the leading currentTime. Falls back to currentTime when rVFC is stale/unsupported. Add a deterministic useFramePlayer hook unit test (happy-dom) that simulates Safari's leading currentTime and lagging mediaTime; it asserts the playhead is monotonic on play and locks to the presented frame on pause (both fail on the old logic), and that the end-of-track currentTime fallback still works.
74 lines
2.8 KiB
JSON
74 lines
2.8 KiB
JSON
{
|
|
"name": "shumai",
|
|
"version": "0.1.5",
|
|
"private": true,
|
|
"type": "module",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/shumaiOne/shumai.git"
|
|
},
|
|
"workspaces": [
|
|
"packages/*",
|
|
"apps/*"
|
|
],
|
|
"scripts": {
|
|
"dev": "bun run --hot apps/web/src/index.ts",
|
|
"i18n:compile": "paraglide-js compile --project ./packages/webui/project.inlang --outdir ./packages/webui/paraglide --emit-ts-declarations --no-emit-git-ignore",
|
|
"i18n:watch": "paraglide-js compile --project ./packages/webui/project.inlang --outdir ./packages/webui/paraglide --watch --emit-ts-declarations --no-emit-git-ignore",
|
|
"typecheck": "tsc --noEmit",
|
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
"test": "bun --bun vitest run",
|
|
"test:e2e": "playwright test",
|
|
"test:e2e:ui": "playwright test --ui",
|
|
"test:e2e:report": "playwright show-report",
|
|
"test:e2e:install": "playwright install --with-deps",
|
|
"harness:dev": "bun run packages/webui/e2e/harness/serve.ts",
|
|
"format": "prettier --write .",
|
|
"db:migrate": "bun run prisma migrate dev",
|
|
"db:deploy": "bun run prisma migrate deploy",
|
|
"db:generate": "cd packages/db && bunx prisma generate",
|
|
"generate-providers": "bun run scripts/generate-builtin-providers.ts",
|
|
"worker:agent": "bun apps/agent/src/index.ts",
|
|
"worker:transcode": "bun apps/transcode/src/index.ts",
|
|
"build": "bun run build.ts",
|
|
"build-npm": "bun scripts/build-npm.ts",
|
|
"prepublishOnly": "bun run build-npm && bun run lint && bun run typecheck",
|
|
"publish": "bun run prepublishOnly && bun run scripts/publish.ts",
|
|
"publish:dry": "bun run prepublishOnly && bun run scripts/publish.ts --dry-run",
|
|
"release:local": "bun run scripts/release-local.ts",
|
|
"release:patch": "bun run scripts/release.ts patch",
|
|
"release:minor": "bun run scripts/release.ts minor",
|
|
"release:major": "bun run scripts/release.ts major"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "10.0.1",
|
|
"@inlang/paraglide-js": "2.20.0",
|
|
"@playwright/test": "1.61.1",
|
|
"@testcontainers/postgresql": "12.0.1",
|
|
"@testing-library/dom": "10.4.1",
|
|
"@testing-library/react": "16.3.2",
|
|
"@types/bun": "1.3.14",
|
|
"@types/node": "25.9.1",
|
|
"bun-plugin-pino": "1.5.0",
|
|
"bun-plugin-tailwind": "0.1.2",
|
|
"bun-types": "1.3.14",
|
|
"eslint": "10.4.1",
|
|
"eslint-config-prettier": "10.1.8",
|
|
"eslint-plugin-prettier": "5.5.6",
|
|
"eslint-plugin-react": "7.37.5",
|
|
"globals": "17.6.0",
|
|
"happy-dom": "20.10.6",
|
|
"pino-pretty": "13.1.3",
|
|
"prisma": "7.8.0",
|
|
"testcontainers": "12.0.1",
|
|
"typescript": "6.0.3",
|
|
"typescript-eslint": "8.60.1",
|
|
"vite-tsconfig-paths": "6.1.1",
|
|
"vitest": "4.1.8"
|
|
},
|
|
"dependencies": {
|
|
"@tanstack/react-virtual": "3.14.2",
|
|
"jittered-fractional-indexing": "1.0.1"
|
|
}
|
|
}
|