Site Import: `<video>` sources are uploaded but `videoUrl` is never rewritten, and `poster` is dropped
Summary
Site Import turns <video src> and <video><source src></video> into base.video nodes and uploads the video file. But videoUrl keeps the authored relative path, so the published video points at a file that doesn't exist. The poster attribute is not carried over at all. An <img> on the same page is rewritten to its uploaded URL as expected.
Steps to reproduce
- Import a static site with
pages/index.html,media/clip.mp4andmedia/poster.png:<video src="../media/clip.mp4" poster="../media/poster.png" controls></video> <video controls><source src="../media/clip.mp4" type="video/mp4"></video> <img src="../media/poster.png" alt=""> - Publish and open the page.
Expected behavior
Both videos play from the uploaded clip.mp4, and the first shows the uploaded poster.
Actual behavior
- Both files are in the plan's assets and are uploaded.
- After
applyAssetRewrites, bothbase.videonodes still havevideoUrl: "../media/clip.mp4"andposter: "". The<img>gets/uploads/…poster.png.
The cause appears to be:
URL_BEARING_PROPSissrc,hrefandsrcsetin bothsrc/core/siteImport/assetPlan.ts:47(normalization) andsrc/core/siteImport/applyAssetRewrites.ts:29(rewrite). Sobase.video'svideoUrlis neither resolved to a FileMap key nor rewritten.- The
<video>rules insrc/core/htmlImport/rules.ts(around lines 590 and 607) setvideoUrlbut don't readposter.
A possible fix: add videoUrl (and poster, once the rule carries it) to both prop lists, or give modules a way to declare their URL-bearing props.
Scale, on a real 7-page Webflow site: all 4 hero and background videos were uploaded and 404 on the published pages.
Version or commit
0.0.20 (f92e8dc, current main)
Deployment mode
Local, bun run start (SQLite), Bun 1.4.2, macOS
I would like to work on this. My initial assumption is that video url and poster are not participating in the asset rewrite pipeline, which is why the published page still references the original relative paths. I would start by validating how these properties are mapped during import and then update the rewrite logic so they are resolved through the asset map in the same way as image URLs. This should address both the broken video source and missing poster issue.