/* @jsxImportSource @diffusionstudio/jsx */ /* The everyday composition: sequenced A-roll, an image overlay, data-driven * titles via , and a music bed under everything. * * cp examples/01-basics.tsx ~/Projects/basics/index.tsx * dapi open ~/Projects/basics * * Sources are remote URLs so the example mounts anywhere; `src` equally takes * local paths ("/Movies/clip.mp4"), library paths ("b-roll/drone.mp4") and * asset ids. * A does not place its children: each clip gets an explicit * `start`, the next clip starts where the previous one ends, and the * dissolve declared on the outgoing clip is centered on that cut. */ import { For } from "solid-js"; import type { Time } from "@diffusionstudio/jsx"; const VIDEOS = "https://mdn.github.io/shared-assets/videos"; const MUSIC = "https://mdn.github.io/webaudio-examples/audio-basics/outfoxing.mp3"; const STILL = "https://upload.wikimedia.org/wikipedia/commons/a/a9/Example.jpg"; const TITLES: { text: string; start: Time; end: Time }[] = [ { text: "Chapter One", start: 1, end: 5 }, { text: "Chapter Two", start: 7, end: 11 }, ]; function Title(props: { text: string; start: Time; end: Time }) { return ( {props.text} ); } export default function Basics() { return ( {/* picture-in-picture overlay; media covers its box by default */} {(t) => }</For> <audio name="Music bed" src={MUSIC} start={0} end={12} volume={-16} /> </scene> </stage> ); }