CallStage
Props, styling and a live CallStage example.
Customize
Label for a remote video tile; see {@link ParticipantVideoGridProps}.
Replace the media region without forking state. `remote` is the merged call audio; `videos` holds one stream per remote participant.
React only: @polymorfa/elements has no element for CallStage.
npm install @polymorfa/react@dev @polymorfa/browser@devimport { PolymorfaProvider, CallStage } from "@polymorfa/react";
const appearance = { theme: "light", variables: { colorPrimary: "#635bff" } };
export function CallStageExample({ calls }) {
return (
<PolymorfaProvider tokenEndpoint="/api/polymorfa/token" appearance={appearance}>
<CallStage
controller={calls}
displayName="Avery Morgan"
/>
</PolymorfaProvider>
);
}CallStage from @polymorfa/react. Choose props and styles above; the preview stays visible in every code view.
Props#
displayNamestringAs for
IncomingCallCard.avatarUrlstringAs for
IncomingCallCard.resolveAvatarAvatarResolverAs for
IncomingCallCard.classNamestringlabelVideoParticipantVideoGridProps["labelVideo"]Label for a remote video tile; see
ParticipantVideoGridProps.renderMedia(streams: { readonly local?: MediaStream; readonly remote?: MediaStream; readonly videos: readonly { readonly key: string; readonly info: RemoteVideoInfo; readonly stream: MediaStream; }[]; }) => ReactNodeReplace the media region without forking state.
remoteis the merged call audio;videosholds one stream per remote participant.controllerCallsControllercreateController() => CallsController
Types#
Named types used in the props above.
type AvatarResolver = (peer: string) => string | undefined | Promise<string | undefined>;Styling#
Use className, classNames (a class for any slot, typed SlotClassNames), appearance variables and element styles. The Style panel applies changes to the live component. See Appearance.
Setup#
Use the provider and server route for your application. The preview above uses local sample data and controllers. Chat controllers and inbox data sources keep your data separate from the UI.