Asset Media
Asset media connects /upload/[surveyId] files to HTML Mode, GUI Mode, Template Expressions, and Survey Link without turning media gates into response variables.
Uploaded asset boundary
Media helpers and media questions are intentionally survey-asset-only. Use the Upload entrypoint to add public image, video, and GLB files, then reference their relative asset path in HTML DSL.
<question type="video" name="INTRO_VIDEO" required source="media/intro.mp4" require-full-watch="true">
<description>Watch the introduction.</description>
</question>
<question type="glb" name="PRODUCT_MODEL" required source="models/product.glb">
<description>Review the product model.</description>
</question>
Rules:
sourcemust resolve to an uploaded public survey asset or an allowed/assets/[surveyId]/...route for the same survey.sourcecan be a Template Expression, but dynamicsource="{{ ... }}"locks the GUI source selector asEXP; edit the expression in HTML Mode.videoandglbare non-answer media gate question types. They do not create normal response values or CSV/XLSX export columns.video require-full-watch="true"uses a custom video player and keeps page navigation disabled until playback reaches the end. Survey Link does not add visible helper copy such as “watch the full video to continue.”- GLB questions render with
model-viewer; the runtime loads@google/model-vieweronly when needed.
$asset Template Expression helper
Use $asset inside rich text or other Template Expression-enabled text when media is content, not a gate.
<question type="info" name="MEDIA_CARD">
<description>
{{ $asset.img("images/hero.png", { width: "100%", borderRadius: "16px" }) }}
{{ $asset.video("media/intro.mp4", { width: "100%", controls: true }) }}
{{ $asset.glb("models/product.glb", { height: "360px", autoRotate: true }) }}
</description>
</question>
Helper methods:
| Helper | Emits | Notes |
|---|---|---|
$asset.img(path, config) | Sanitized <img> | Image files only. Supports lazy loading and safe sizing config. |
$asset.video(path, config) | Sanitized <video> | Video files only. Supports controls, muted, loop, and playsInline. |
$asset.glb(path, config) | Sanitized <model-viewer> | GLB files only. Supports cameraControls, autoRotate, shadowIntensity, and exposure. |
Shared config accepts safe sizing and presentation fields: width, height, maxWidth, maxHeight, borderRadius, and objectFit.
Response and export policy
Media helpers produce sanitized HTML fragments. Media gate questions produce gate state only. Neither surface writes a respondent answer column. If a survey needs to record acknowledgement, add a separate explicit question or hidden run-code answer after the media gate instead of relying on video or glb fields.