A `<pacem-media-timeline mode="live">` is a session instead of a clip: its clock runs on the wall clock, it lasts
until `stop()`, and its tracks are live sources. A screen share filling the stage, the camera in a round bubble, a
microphone, an animated lower third: the stage composes them as they come, and with `recording` on every source
records its own take. Stopping the session turns it into an edit, ready to be sought and exported.
```html
<pacem-media-timeline id="studio" mode="live" recording="true">
<pacem-media-screen-track id="screen" size="100%,100%" fit="contain"></pacem-media-screen-track>
<pacem-media-camera-track id="cam" size="240,240" position="100%,100%" anchor="100%,100%" fit="cover">
<pacem-media-track-mask from="circle()"></pacem-media-track-mask>
</pacem-media-camera-track>
<pacem-media-microphone-track id="mic"></pacem-media-microphone-track>
</pacem-media-timeline>
```
## Usage
**Capture.** Camera, microphone and screen tracks acquire their own stream: `capture()` asks for the device (the
browser's prompt the first time; the screen's picker must open from a click), `stop()` turns it off, as does removing
the element; `capturing` tells whether it's on. Any other `MediaStream` (a remote participant) goes in a
`<pacem-media-stream-track stream="{{ … }}">`.
**The session.** `play()` starts it (from a click: audio needs a user gesture), `pause()` / `play()` hold and resume it,
`stop()` ends it. While it runs it can't be sought, its length is `Infinity`, and live tracks are stamped with the time
their stream shows up (`start`) and goes away (`end`), so sources can join and leave. The clock keeps running in a
hidden tab, so the stage keeps drawing while the presenter shares another window.
**Takes.** With `recording` on, every live track records its own MP4 while active; the timeline fires `take`
(`{ track, blob, start, end }`) as each one is finished. Upload them, keep them, or simply stop:
**From live to edit.** `stop()` on a session that recorded takes switches the timeline to `mode="edit"`, with
`duration` = the time reached. Each live track then plays its takes in place of its stream, with the same layout,
masks and effects: seek, play, and export the session with a `<pacem-media-exporter>`. `mode="live"` starts over.
> Microphones aren't heard on the speakers by default (`monitor`), so they don't echo; set `monitor="true"` on a
> remote participant's track. `level` reports any audio track's input level, for meters.
**HTML on the stage.** A `<pacem-media-html-track source="#lowerThird">` draws a page element, its CSS and its
animations included: here the lower third slides in with plain `@keyframes`. Its animations follow the session's clock,
and it keeps moving when the tab is hidden.
## Customization
The bubble is a layout and a mask: `size` on the stage, `position` + `anchor` to pin its corner, `fit="cover"` to crop
the camera's 16:9 to a square, and a `circle()` mask (any CSS basic shape: `inset(0 round 24px)`,
`ellipse()`, `polygon()`…, animated with `from` / `to`).
```html
<pacem-media-camera-track size="320,320" position="40,680" anchor="0%,100%" fit="cover">
<pacem-media-track-mask from="inset(0 round 32px)"></pacem-media-track-mask>
</pacem-media-camera-track>
```
The html track's element is laid out in a `width` × `height` box (CSS px) and moved out of the page while the track
is in the document: style it by its own class, not by its original ancestors.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.