{"_id":"@animastor/player","name":"@animastor/player","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@animastor/player","version":"0.1.0","description":"Animastor Player — playback HTTP contour: scene media serving (Range/206/ETag/If-Range), scene data (status/storyboard/timings/waveform), IU media, playback queue and assets-state. Reads book content only through the injected playerModel (VBook boundary);","keywords":["animastor","player","playback","http-range","media-streaming"],"main":"src/index.cjs","exports":{".":"./src/index.cjs"},"scripts":{"test":"mocha --exit test/*.test.js"},"engines":{"node":">=18"},"license":"MIT","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/Animastor/animastor.git","directory":"packages/animastor-player"},"homepage":"https://github.com/Animastor/animastor/tree/main/packages/animastor-player#readme","bugs":{"url":"https://github.com/Animastor/animastor/issues"},"dependencies":{"@animastor/vbook-runtime":"^0.1.0"},"devDependencies":{"chai":"^6.2.2","mocha":"^11.7.5"},"_id":"@animastor/player@0.1.0","gitHead":"99d8f2705bb27d30bd62df3b1f7fd7023e6c954f","_nodeVersion":"22.22.3","_npmVersion":"10.9.8","dist":{"integrity":"sha512-OzDmaznaRk5PMvESPJZ2nccU52UEp1FEfwiDTtADlZcjirzcY6hFMsPGZiIsP8EINaR8K0D3Z6c4vNVhk0HG3A==","shasum":"ff5df5b1b0f479bf55cc330a633823265fd735b1","tarball":"https://registry.npmjs.org/@animastor/player/-/player-0.1.0.tgz","fileCount":13,"unpackedSize":92406,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDqMRYA89UrxBzbemmtO/987lF3t1PCMQxpSEOjOJM+IAIgfrxuUsuCrTIWgtPwysXDUDd8yZqUUKi9eZLKWpU7Wv4="}]},"_npmUser":{"name":"animastor","email":"admin@animastor.in"},"directories":{},"maintainers":[{"name":"animastor","email":"admin@animastor.in"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/player_0.1.0_1788840906894_0.6512854925632281"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-08T04:15:06.695Z","0.1.0":"2026-09-08T04:15:07.033Z","modified":"2026-09-08T04:15:07.279Z"},"maintainers":[{"name":"animastor","email":"admin@animastor.in"}],"description":"Animastor Player — playback HTTP contour: scene media serving (Range/206/ETag/If-Range), scene data (status/storyboard/timings/waveform), IU media, playback queue and assets-state. Reads book content only through the injected playerModel (VBook boundary);","homepage":"https://github.com/Animastor/animastor/tree/main/packages/animastor-player#readme","keywords":["animastor","player","playback","http-range","media-streaming"],"repository":{"type":"git","url":"git+https://github.com/Animastor/animastor.git","directory":"packages/animastor-player"},"bugs":{"url":"https://github.com/Animastor/animastor/issues"},"license":"MIT","readme":"# @animastor/player\n\nAnimastor **Player** — the playback HTTP contour of the Animastor backend:\nscene media serving (HTTP Range / 206 / ETag / If-Range streaming), scene\ndata (status / storyboard / timings / waveform), IU media (iu-image /\npreview / chunk storyboard), the playback queue (chunk dedup,\n`cover_chunk_id`, `chunk_positions`) and the assets-state readiness\nprojection. Includes the `createPlayerModel` facade over the Canonical Book\nModel and the read-side artifact-naming grammar.\n\n**Status: EXTRACTED (0.1.0).** The playback contour physically lives in this\npackage (`src/`); the host backend consumes it only through the package\nentrypoint. See\n[`docs/architecture/PLAYER_ROUTE_SPLIT_CHECKLIST.md`](https://github.com/Animastor/animastor/blob/main/docs/architecture/PLAYER_ROUTE_SPLIT_CHECKLIST.md)\n(physical move COMPLETE) and\n[`docs/architecture/PLAYER_PACKAGE_EXTRACTION_READINESS_AUDIT.md`](https://github.com/Animastor/animastor/blob/main/docs/architecture/PLAYER_PACKAGE_EXTRACTION_READINESS_AUDIT.md).\n\n## Requirements\n\n- Node.js >= 18\n- [`@animastor/vbook-runtime`](https://www.npmjs.com/package/@animastor/vbook-runtime)\n  (installed automatically as the only runtime dependency — the Player Model\n  facade over its Canonical Book Model)\n\n## Installation\n\n```bash\nnpm install @animastor/player\n```\n\n## Public API\n\nThe package exposes a single entrypoint — `require('@animastor/player')`\nreturns `{ createPlayerModel, createPlayerRoutes }`. Deep imports\n(`@animastor/player/src/...`) are intentionally not exported.\n\n## Boundary\n\nThe package imports **nothing** from the backend host: no config, no\ngeneration implementation, no `workflows/`, no middleware, no\nwaveform/video-timeline host modules, no Redis/PG internals, no backend\nstorage. Book content is reached only through the injected `playerModel`\n(VBook boundary — the facade over `@animastor/vbook-runtime`'s Book Model).\nEvery host dependency arrives as an injected port at registration time.\n\n## Standalone use (repository checkout)\n\n```bash\nnpm install        # dep: @animastor/vbook-runtime (dev: mocha + chai)\nnpm test           # 17 behavioral tests, no host needed\n```\n\n## Host integration (composition root)\n\n```js\nconst { createPlayerModel, createPlayerRoutes } = require('@animastor/player');\n\nconst playerModel = createPlayerModel({ bookModel });\ncreatePlayerRoutes(app, redis, {\n    playerModel,                                  // VBook boundary (book content reads)\n    outputRoot: config.OUTPUT_DIR,                // artifact root (no config reads inside)\n    playerPorts: {                                // host-owned implementations\n        assertBookAccess,                         //   auth middleware\n        computeVideoStartMs,                      //   ffprobe + workflows alignment tax\n        computeWaveform,                          //   ffmpeg\n    },\n    computeIuReady,                               // pure IU-progress math (host)\n    bookProjections: { findSceneRuntimeData, collectSceneUnits }, // pure VBook reads\n    redis, getChunk, getAllChunks, getBookWindowStatus,\n    iuRepo, sceneAssetsRepo, layerConfig,\n    image, state, activeScenes, placeholderAudio,\n    utils: { log },\n});\n```\n\n## Frozen HTTP surface (17 endpoints)\n\n```\nGET  /api/v1/chunk/:id                     GET  /api/v1/chunk/:id/audio\nGET  /api/v1/chunk/:id/image               GET  /api/v1/chunk/:id/video\nGET  /api/v1/chunk/:id/storyboard          GET  /api/v1/scene/:b/:ch/:sc/audio\nGET  /api/v1/scene/:b/:ch/:sc/video        GET  /api/v1/scene/:b/:ch/:sc/image\nGET  /api/v1/scene/:b/:ch/:sc/status       GET  /api/v1/scene/:b/:ch/:sc/storyboard\nGET  /api/v1/scene/:b/:ch/:sc/waveform     GET  /api/v1/scene/:b/:ch/:sc/timings\nPUT  /api/v1/scene/:b/:ch/:sc/timings      GET  /api/v1/iu-image/:b/:ch/:sc/:iuId\nGET  /api/v1/preview/:b/:ch/:sc/:iuId      GET  /api/v1/book/:bookId/chunks\nGET  /api/v1/book/:bookId/assets-state\n```\n\nGuards: [`backend/tests/architecture/player-route-split.test.js`](https://github.com/Animastor/animastor/blob/main/backend/tests/architecture/player-route-split.test.js) (P1–P9) and\n[`backend/tests/architecture/phase6-editor-player.test.js`](https://github.com/Animastor/animastor/blob/main/backend/tests/architecture/phase6-editor-player.test.js) (T1–T7).\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-07ba818a780f85cee5586a458b9f37e7"}