Files
openmotion/web/inline-video.js
MasonJJ 0f0e8a7210 Show chat video only after final MP4 delivery (#384)
* Show chat video only after final MP4 delivery

* test(distribution): accept blob origin in packaged inline player CSP

The final-video player decodes component-private MP4 data into a browser-owned
Blob URL for seeking and replay, so the packaged inline player resource declares
both `data:` and `blob:` origins. tests/inline-video.test.ts and
docs/inline-video.md were updated with that contract, but the packaged
distribution smoke test still required `data:` only and failed the
Distribution regression lane before exercising any Tool.

Align the packaged assertion with the shipped resource metadata.

Generated-By: looper 0.16.2 (runner=fixer, agent=pi)

---------

Co-authored-by: bone3deep1962-collab <bone3deep1962@gmail.com>
Co-authored-by: open-design-crew[bot] <299007234+open-design-crew[bot]@users.noreply.github.com>
2026-11-15 00:42:41 +08:00

13 lines
685 B
JavaScript

import { App } from '@modelcontextprotocol/ext-apps';
import { mountFinalVideo } from './final-video-component.js';
const app = new App({ name: 'OpenMotion final video', version: '1.0.0' }, {});
document.documentElement.dataset.motionUi = '';
const root = document.createElement('main'); document.body.append(root);
const ui = mountFinalVideo(root, app);
app.ontoolresult = ui.update;
app.onteardown = async () => { ui.destroy(); return {}; };
app.onhostcontextchanged = context => { if (context.theme) document.documentElement.dataset.theme = context.theme; };
await app.connect();
const theme = app.getHostContext()?.theme;
if (theme) document.documentElement.dataset.theme = theme;