Instatic icon indicating copy to clipboard operation
Instatic copied to clipboard

Site Import: `<video>` sources are uploaded but `videoUrl` is never rewritten, and `poster` is dropped

Open ehnruiz opened this issue 1 month ago • 1 comments

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

  1. Import a static site with pages/index.html, media/clip.mp4 and media/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="">
    
  2. 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, both base.video nodes still have videoUrl: "../media/clip.mp4" and poster: "". The <img> gets /uploads/…poster.png.

The cause appears to be:

  • URL_BEARING_PROPS is src, href and srcset in both src/core/siteImport/assetPlan.ts:47 (normalization) and src/core/siteImport/applyAssetRewrites.ts:29 (rewrite). So base.video's videoUrl is neither resolved to a FileMap key nor rewritten.
  • The <video> rules in src/core/htmlImport/rules.ts (around lines 590 and 607) set videoUrl but don't read poster.

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

ehnruiz avatar Oct 11 '26 10:10 ehnruiz

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.

anonymousknight07 avatar Oct 12 '26 10:10 anonymousknight07