Each example holds the license's text as LICENSE (wai/LICENSE, byte for byte) and says so in its README; wai create writes it with the rest of the template, from one copy in the binary. Co-Authored-By: Claude Opus 5.5 <[email protected]>
31 lines
1.4 KiB
Markdown
31 lines
1.4 KiB
Markdown
# Watch together
|
|
|
|
**What it shows.** A room in which everyone watches one file in sync. The room service names
|
|
the file by its content hash in the room's signed policy; each page fetches it, checks it,
|
|
and keeps it at the room's position. Play, pause, seek and speed are controls each page
|
|
signs; each applies at one instant on the room's clock, for everyone. Every few seconds the
|
|
room's clock states how far each viewer is from the room.
|
|
|
|
**Run it.**
|
|
|
|
```sh
|
|
wai create my-watch --template watch-together
|
|
cd my-watch
|
|
wai dev
|
|
```
|
|
|
|
Open `http://127.0.0.1:8080/` in two tabs, press **Watch** in each, then **Play** in one.
|
|
|
|
**What you see.** Both tabs play the sample tone (`tone.wav`, made by `wai create`, a pitch
|
|
that steps up each second), pause together and jump together. Below the player, each page
|
|
shows its own offset from the room and whether everyone is in sync.
|
|
|
|
**Make it yours.** Put a `.webm`, `.mp4`, `.ogg`, `.mp3` or `.wav` file in the project and name
|
|
it in `wai.json` (`"watch"`), with its length in milliseconds (`"watch_ms"`) for anything
|
|
but a WAV file. Or run `wai dev --watch film.webm --watch-ms 90000`.
|
|
|
|
**With a coding assistant.** Run `wai setup-agent` in this directory: it writes the
|
|
instructions an assistant reads and connects it to WAI's tools.
|
|
|
|
**License.** Apache-2.0: the text is in `LICENSE`, and a project `wai create` makes from this
|
|
example carries it.
|