Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
src/ui/video-player.js decodes H.264 access units with WebCodecs into a canvas and reports when it cannot - module and test only #271
This adds Software/so101/src/ui/video-player.js, taken unchanged from pull #207's branch, along with its test. It decodes H.264 access units arriving over a WebSocket with VideoDecoder and draws them into a canvas.
stopped parked by the crew deploy e87acfe
This adds Software/so101/src/ui/video-player.js, taken unchanged from pull #207's branch, along with its test. It decodes H.264 access units arriving over a WebSocket with VideoDecoder and draws them into a canvas. It works out its own codec string (avc1.PPCCLL) from the first SPS, and it reports "none" to the page in three cases: WebCodecs is missing (canDecode() is false), no picture arrives within waitMs, or the socket closes before any picture.
Nothing loads it yet. viewer.html is unchanged, so the first-visit gzip budget is too.
What to look at:
- The test fixture. On #207's branch the test imports
src/h264-clip.ts, which isn't on main and isn't part of #257.video-player.test.tsnow builds the same small Annex-B clip itself (SPS, PPS, IDR, then P pictures), so this pull doesn't depend on any other piece of #70. - New tests. On top of #207's tests I added:
- no support when VideoDecoder is missing;
- no picture within waitMs, and no "none" once a picture has arrived;
- a keyframe with no SPS, or no decoder at all, is never configured or decoded;
- a P picture or a truncated SPS gives no codec, without reading past the end.
- A one-line fix in
src/lobby.ts. On main,bun x tsc --noEmitfailed: #253 leftspanpossiblyundefinedatsrc/lobby.ts:356. It is nowMUTE_FOR[m.for ?? "forever"] ?? null. The key was already checked two lines up, so behaviour is unchanged. It is a separate commit and can be dropped if another pull fixes it first.
Checks:
bun x tsc --noEmitis clean.bun test src/ui/video-player.test.ts: 7 pass.- The lobby, chat and player suites pass after the lobby fix.
- The whole package ran before the fix: 501 passed and 1 failed. The failure was in
server.test.ts("serves the model, its meshes and the vendored libraries"); that file then passed on its own (54/54), so it looks flaky rather than related to this change.
🤖 Generated with Claude Code
Closes #258
Parked by the crew: the preview's deploy failed and the decider saw no point in another try
This adds
Software/so101/src/ui/video-player.js, taken unchanged from pull #207's branch, along with its test. It decodes H.264 access units arriving over a WebSocket withVideoDecoderand draws them into a canvas. It works out its own codec string (avc1.PPCCLL) from the first SPS, and it reports"none"to the page in three cases: WebCodecs is missing (canDecode()is false), no picture arrives withinwaitMs, or the socket closes before any picture.Nothing loads it yet.
viewer.htmlis unchanged, so the first-visit gzip budget is too.What to look at:
src/h264-clip.ts, which isn't on main and isn't part of #257.video-player.test.tsnow builds the same small Annex-B clip itself (SPS, PPS, IDR, then P pictures), so this pull doesn't depend on any other piece of #70.- no support when
VideoDecoderis missing; - no picture withinwaitMs, and no"none"once a picture has arrived; - a keyframe with no SPS, or no decoder at all, is never configured or decoded; - a P picture or a truncated SPS gives no codec, without reading past the end.src/lobby.ts. On main,bun x tsc --noEmitfailed: #253 leftspanpossiblyundefinedatsrc/lobby.ts:356. It is nowMUTE_FOR[m.for ?? "forever"] ?? null. The key was already checked two lines up, so behaviour is unchanged. It is a separate commit and can be dropped if another pull fixes it first.Checks:
bun x tsc --noEmitis clean.bun test src/ui/video-player.test.ts: 7 pass.server.test.ts("serves the model, its meshes and the vendored libraries"); that file then passed on its own (54/54), so it looks flaky rather than related to this change.🤖 Generated with Claude Code
Closes #258
Closes #258