Skip to content
Merged
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,9 @@ machine's fonts, so it looks the same on every machine.
An overlay's own images and fonts, such as a logo or a brand face, come from
`data:` URLs or from files in the scene file's directory, named relative to
it (`url(brand/logo.png)`), never from the web or anywhere else on disk. The
studio reads them all as the overlay starts, so its first frame has them, and
a file changed on disk changes nothing on air until the overlay starts again,
as when it is edited. Images are PNG or JPEG, at most 4096 pixels a side;
studio reads them all as the overlay opens, so its first frame has them, and
a file changed on disk changes nothing on air until the overlay opens again,
as when it is edited; a restart on program reuses what it read. Images are PNG or JPEG, at most 4096 pixels a side;
fonts are TrueType, OpenType, WOFF, or WOFF2, loaded with `@font-face`:

```css
Expand Down Expand Up @@ -318,8 +318,15 @@ element, attribute, rule, property, or asset it refused:
draws more.

An overlay's animation starts when the overlay does: when the studio opens
it, and again whenever it is edited. One that no preview or program shows
costs nothing until it is shown again, where its animation has carried on.
it, and again whenever it is edited. It also starts over each time a scene
showing it goes on program, as an item's keyframes do, so a lower third plays
its entrance at every cut, and when a scene showing it goes into preview while
program does not show it, so the preview shows the entrance too. Preview and
program share its timeline, so a preview never restarts one program shows.
Set `restart = false` (**Restart on program**, off, in the add form) for one
that runs on across cuts, such as a clock or a ticker. One that no preview or
program shows costs nothing until it is shown again, where its animation has
carried on unless it restarts.
Overlays publish no track of their own, so viewers see them only in the
program.

Expand Down Expand Up @@ -512,6 +519,7 @@ height = 600
kind = "overlay"
width = 1920 # the overlay's own size, like a page's
height = 1080
restart = true # start over each time it goes on program, the default
html = '''
<style>
.third { position: absolute; left: 80px; bottom: 120px; padding: 16px 32px;
Expand Down Expand Up @@ -583,7 +591,7 @@ Source kinds are `camera`, `display`, and `microphone` (each with an optional
(macOS), `image` (PNG or JPEG), `media` (a video or audio file; see
[Media files](#media-files)), `color` (`#rrggbb` or `#rrggbbaa`),
`broadcast`, `browser` (a `url`, and a `width` and `height` up to 4096),
`overlay` (its `html`, and a `width` and `height` up to 4096), `clone` (with the `source` it shows), `lut` (a 3D Adobe or Resolve `.cube`
`overlay` (its `html`, a `width` and `height` up to 4096, and whether it `restart`s, true by default), `clone` (with the `source` it shows), `lut` (a 3D Adobe or Resolve `.cube`
file, which no item places, but which grades what a `lut` filter names it in),
and `replay`, where the Replay panel plays replays. The Devices panel fills in
ids. `[[top]]` items make up the top layer.
Expand Down
1 change: 0 additions & 1 deletion quest/m1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ than opening an m2 for them.
## Required

- [Viewer-side composition](/quest/m1/compose/README.md) - sources as their own tracks plus a layout track, composed by viewers and by a server
- [Overlays restart on air](/quest/m1/overlay-restart.md) - an overlay's CSS timeline restarts at each cut unless set to keep running
- [Hotkeys and editor preferences](/quest/m1/hotkeys.md) - system-wide hotkeys, arrow nudge, aspect lock, and persisted editor settings
- [Isolated guest recordings](/quest/m1/guest-recording.md) - record-each-source also writes each guest's tracks to its own file
- [Scene graph view](/quest/m1/scene-graph.md) - a node view of picture and audio scenes, their routing, volume, pan, and waveforms
27 changes: 0 additions & 27 deletions quest/m1/overlay-restart.md

This file was deleted.

26 changes: 24 additions & 2 deletions rs/moq-scene/src/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ pub struct Item {
/// Where on the canvas, stretched to fill it.
pub rect: Rect,
/// Whether the item is drawn. A hidden item keeps its place.
#[serde(default = "visible")]
#[serde(default = "yes")]
pub visible: bool,
/// Trimmed from what its source's crop leaves, before every filter.
#[serde(default, skip_serializing_if = "Crop::is_none")]
Expand Down Expand Up @@ -924,10 +924,14 @@ fn is_zero(value: &f32) -> bool {
*value == 0.0
}

fn visible() -> bool {
fn yes() -> bool {
true
}

fn is_true(value: &bool) -> bool {
*value
}

/// What a source or item is drawn through, in order.
///
/// Every filter is a pure function of the picture, so every host that composes
Expand Down Expand Up @@ -1497,6 +1501,12 @@ pub enum Source {
width: u32,
/// The overlay's viewport height in pixels.
height: u32,
/// Whether its CSS timeline starts over each time a scene showing it
/// goes on program, or into preview while program does not show it,
/// as keyframes do, rather than running on from when it opened, as a
/// clock should.
#[serde(default = "yes", skip_serializing_if = "is_true")]
restart: bool,
},
/// Another source's picture, captured once, with [`Collection::video`]
/// filters of its own. Its sound is not mixed a second time.
Expand Down Expand Up @@ -1769,6 +1779,18 @@ mod tests {
height: 800,
},
);
// Restarting is the default, written by leaving it out.
for (name, restart) in [("title", true), ("clock", false)] {
collection.sources.insert(
name.into(),
Source::Overlay {
html: "<h1>Live</h1>".into(),
width: 1920,
height: 1080,
restart,
},
);
}
collection.mixes = Mixes {
names: vec!["Stream".into(), "Recording".into()],
program: "Stream".into(),
Expand Down
Loading