Skip to main content

Guides

A call window

The call components together, with made-up people and placeholder pictures: a tile grid that grows as people join, speaking, muted and camera-off tiles, captions, the control bar, your own camera picture in a corner (it tucks into a small camera button when it would cover someone, and the button brings it back), a timer, and the lobby, joining and waiting states. The State and Others in the call switchers above the window, the moving speaker, captions and microphone level, the Design review header, the made-up half-hour timer and the invite link are the demo's own script; an app supplies the real ones. The tiles, captions, control bar, level meter, picture-in-picture, reactions and timer are Ouro components. Try the keyboard, a narrow window and dark mode.

State
Others in the call
Design review

Captions

Waiting for someone to speak…

Bottom right. Option-arrow keys to move it

The timer is the app's to set: here it counts down a made-up half-hour limit, apart from the window.

Meeting ends in · 30 min

30:00

A short assembly

Call window
import { useRef } from "react";
import { MediaTile } from "@/components/ouro/media-tile/media-tile";
import { LiveCaptions } from "@/components/ouro/live-captions/live-captions";
import { Toolbar } from "@/components/ouro/toolbar/toolbar";
import { SnapPiP } from "@/components/ouro/snap-pip/snap-pip";

export function CallWindow({ people, lines, controls }) {
  const gridRef = useRef(null);
  const controlsRef = useRef(null);
  return (
    <>
      <div ref={gridRef}>
        {people.map((person) => (
          <MediaTile key={person.id} name={person.name} speaking={person.speaking} muted={person.muted} cameraOn={person.cameraOn}>
            <video ref={person.videoRef} />
          </MediaTile>
        ))}
      </div>
      <div ref={controlsRef}>
        <LiveCaptions label="Captions" hideLabel lines={lines} />
        <Toolbar label="Call controls" items={controls} />
      </div>
      <SnapPiP label="Your camera" keepOut={[gridRef, controlsRef]}>
        <video />
      </SnapPiP>
    </>
  );
}