Video

The flower fades in at full color and takes on a copper tint as it shrinks. The insect slides in with a teal tint. Both rounded panels use cover to crop their clips. The insect regains its original colors as its panel expands, squares off its corners, and fades out. Drag the timeline to inspect the transition or edit Playback speed to change the speed of both clips.

Loading Ebi…
let flowers = "https://cdn.jsdelivr.net/gh/mdn/shared-assets@bce59dcddb61940e27bb690b1298b1b311a4a7cf/videos/flower.mp4"
let insect = "https://upload.wikimedia.org/wikipedia/commons/0/04/Bumblebee_on_flowers.webm"
let speed: Number<0.25, 3, 0.05> = reflect(1, label="Playback speed")
mut intro = 0.0
mut split = 0.0
mut expand = 0.0
mut outro = 0.0

fn monochrome(amount: Number, red: Number, green: Number, blue: Number): List<Effect> {
    let luma = [0.2126, 0.7152, 0.0722] * amount
    let color = 1.0 - amount
    return amount == 0.0 ? [] : [Effect.channel_mixer(red=[color, 0, 0] + red * luma,
        green=[0, color, 0] + green * luma, blue=[0, 0, color] + blue * luma)]
}

let left = <Video src={flowers} width={100% - 52% * split} height={100% - 18% * split}
    position={[-25% * split, 0%]} radius={18pt * split} opacity={intro * (1.0 - expand)}
    effects={monochrome(split, 0.98, 0.67, 0.36)} fit="cover" offset={500ms} rate={speed} loop={true}/>
let right = <Video src={insect} width={48% + 52% * expand} height={82% + 18% * expand}
    position={[(76% - 51% * split) * (1.0 - expand), 0%]} radius={18pt * (1.0 - expand)} opacity={1.0 - outro}
    effects={monochrome(1.0 - expand, 0.35, 0.85, 0.98)} fit="cover" rate={speed} loop={true}/>

left
animate(intro, to=1.0, duration=650ms, ease="smootherstep")
wait(450ms)
right
animate(split, to=1.0, duration=1.2s, ease="spring")
wait(900ms)
animate(expand, to=1.0, duration=1.3s, ease="spring")
wait(700ms)
animate(outro, to=1.0, duration=650ms, ease="smootherstep")
wait(300ms)

Flower clip from MDN and bumblebee clip by Роман Рябенко, CC0.

Timing and sources

The clip starts when its layer appears. offset selects the starting point in the source. A rate of 1 plays at the source speed and 0.5 plays at half speed. Use loop=true to repeat the clip. With looping off, the last frame holds for the rest of the layer. Video contributes the clip's pictures to the scene. Add audio separately in Shrimply.

Use a path relative to the scene for a local file. For a remote clip in the browser, use a seekable HTTPS URL that allows cross-origin requests and exposes the Content-Range response header.

Style a clip

Set fit="cover" for a centered crop and use the same border and opacity controls as Image. Add effects to adjust the rendered clip.

<Video src="clips/water.mp4" width={60%} height={50%} fit="cover" rounded-lg
    effects={[Effect.color_correction(exposure=0.3, saturation=0.8)]}/>
wait(4s)