Skip to content

Widgets ​

Playout Widgets are embeddable web components that let you integrate live streaming and replay functionality directly into your own website — no framework required. Drop a script tag on your page and you have a live video player, streaming status banner, program display, and replay archive, all connected to your Playout tenant in real time.

INFO

Widgets connect to the same Playout backend as the operator interface. To embed live stream or replay content, your tenant must have Streaming enabled. Contact contact@playout.studio to get access.

Quick Start ​

1. Include the widget scripts ​

Add the scripts for the widgets you want to use. Each widget is a self-contained ES module served from the Playout CDN.

html
<!-- Required for all widgets -->
<script type="module" src="https://widgets.playout.studio/playout-login.js"></script>

<!-- Add only the widgets you need -->
<script type="module" src="https://widgets.playout.studio/playout-streaming-status.js"></script>
<script type="module" src="https://widgets.playout.studio/playout-live-video-player.js"></script>
<script type="module" src="https://widgets.playout.studio/playout-replay-list.js"></script>
<script type="module" src="https://widgets.playout.studio/playout-replay.js"></script>

2. Add playout-login ​

Every page that uses Playout Widgets must include exactly one <playout-login> element. It handles authentication silently in the background — it renders nothing visible.

Option A — inline token (simplest, when the token is already available in the page):

html
<playout-login
  tenant="your-tenant-id"
  token="SSO_TOKEN_HERE"
></playout-login>

Option B — server-fetched token (recommended for production, keeps the token out of the HTML source):

html
<playout-login
  tenant="your-tenant-id"
  token_location="/api/playout-token"
></playout-login>

Replace your-tenant-id with your Playout tenant identifier.

3. Add a widget ​

Place any widget element anywhere on the page. It will activate automatically once playout-login has authenticated.

html
<playout-streaming-status live_location="/live"></playout-streaming-status>

Complete example ​

html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>My website</title>
  <script type="module" src="https://widgets.playout.studio/playout-login.js"></script>
  <script type="module" src="https://widgets.playout.studio/playout-streaming-status.js"></script>
  <script type="module" src="https://widgets.playout.studio/playout-live-video-player.js"></script>
</head>
<body>

  <playout-login tenant="your-tenant-id" token="SSO_TOKEN_HERE"></playout-login>

  <!-- Shows a "Live now" banner when a stream is active -->
  <playout-streaming-status live_location="/live"></playout-streaming-status>

  <!-- On your /live page: the video player -->
  <playout-live-video-player lang="en"></playout-live-video-player>

</body>
</html>

How Authentication Works ​

Playout Widgets use a two-step authentication flow:

  1. SSO token exchange — playout-login sends your SSO token to the Playout API and receives a short-lived Firebase token in return.
  2. Firebase sign-in — The widget signs into Firebase with that token, gaining access to your tenant's real-time data.

Once signed in, playout-login broadcasts a playout-logged-in event. All other widgets on the page listen for this event and start up automatically. This means:

  • playout-login must be present on every page that uses widgets.
  • Other widgets can be placed anywhere in the document — they will wait for the login event.
  • You only need one playout-login per page, regardless of how many widgets you use.

When the visitor cannot be signed in — no token reached playout-login within about ten seconds, token_location failed, or the API rejected the token — playout-login broadcasts playout-login-failed instead. The video and replay widgets then show Sign in to watch; playout-streaming-status stays empty. Listen for the event if your page should react too, for example by showing your own sign-in link.

Providing the token ​

There are two ways to supply the SSO token:

token — inline

Pass the token directly as an attribute. Straightforward, but exposes the token in the HTML source. Suitable when the token is short-lived and already present in a server-rendered page.

html
<playout-login tenant="your-tenant-id" token="SSO_TOKEN_HERE"></playout-login>

token_location — server endpoint (recommended)

Pass a URL instead. playout-login fetches the token from that endpoint at runtime using a credentialed request, so the token is never embedded in your HTML.

html
<playout-login tenant="your-tenant-id" token_location="/api/playout-token"></playout-login>

Your endpoint must:

  • Return the raw SSO token string as the response body (plain text, not JSON).
  • Accept credentialed requests — set Access-Control-Allow-Credentials: true and an appropriate Access-Control-Allow-Origin header if the endpoint is on a different origin.
  • Authenticate the caller via session cookie or similar server-side mechanism.

BCC Signon WordPress plugin

If your site uses the BCC Signon WordPress plugin, the token endpoint is already provided for you. Set token_location to /?bcc-login=access-token:

html
<playout-login
  tenant="your-tenant-id"
  token_location="/?bcc-login=access-token"
></playout-login>

Which production unit is used? ​

Each Playout tenant can have multiple production units — independent stream endpoints, each of which can be assigned to an event. Widgets derive which event to display by reading the currentEvent assigned to their production unit.

By default playout-login targets the production unit named default. If your tenant uses a different unit, or you run multiple streams simultaneously on separate pages, specify the unit explicitly:

html
<playout-login
  tenant="your-tenant-id"
  token_location="/api/playout-token"
  production_unit="main-stage"
></playout-login>

All widgets on the same page follow the production unit set on playout-login. To display two independent streams on the same page, you would need two separate pages — one per production unit.

Previewing as a viewer ​

Tenant administrators can check what a viewer will see before (and after) going live: Widget simulator in the sidebar, next to Assets, wherever streaming is on.

Pick a viewer — a person from the persons register, or a signed-in viewer with no profile — then the widget, and for playout-replay the replay. The widget renders exactly as it does on your website, signed in as that person:

  • The stream's access rules (church, country, age) apply, read from that person's profile. Your own administrator access does not leak into the preview.
  • Draft and archived replays stay hidden, as they are for every viewer.
  • Links inside the widget stay in the simulator: a replay in the list opens it in playout-replay, Join the live stream opens the live player.

Nothing done in the preview goes in under the person you chose: it never counts as a view, and a removal request sent from it is refused. The preview's sign-in only works for your own tenant.

Widget Reference ​

playout-login ​

Handles authentication and bootstraps all other widgets on the page. Renders nothing visible.

AttributeTypeRequiredDescription
tenantstringYesYour Playout tenant identifier
tokenstringOne of token or token_locationSSO token from your identity provider, provided inline
token_locationstringOne of token or token_locationURL of an endpoint that returns the SSO token as plain text. Fetched with withCredentials
production_unitstringNoID of the production unit whose current event the widgets will display. Defaults to default
html
<!-- Inline token -->
<playout-login
  tenant="your-tenant-id"
  token="SSO_TOKEN_HERE"
></playout-login>

<!-- Server-fetched token, non-default production unit -->
<playout-login
  tenant="your-tenant-id"
  token_location="/api/playout-token"
  production_unit="main-stage"
></playout-login>

playout-streaming-status ​

Displays a compact "Live now" banner when a stream is active on the current event. Renders nothing when there is no active stream, or when the stream has been hidden from the site with Hide on site on the Streaming page. The banner and playout-live-video-player follow the same rule, so the banner never points to a live page that has nothing to show.

AttributeTypeRequiredDescription
live_locationstringYesURL the banner links to (e.g. your live page)
langstringNoLocale code for translated labels. See Localization
html
<playout-streaming-status
  live_location="/live"
  lang="en"
></playout-streaming-status>

playout-live-video-player ​

Embeds the live video player for the current event. Shows a loading state while the event is resolving, a "no stream available" message when the event is not live, and the Mux video player with the stream title and description when a broadcast is active.

While a broadcast is on air the player offers a seek bar back to the start of the current recording and a "live" button to return to the edge, so viewers who join late can catch up. The player appears once the recording is available, normally a few seconds after the encoder connects; if the encoder reconnects mid-broadcast, a new recording starts and the seekable range restarts with it.

AttributeTypeRequiredDescription
langstringNoLocale code for translated labels. See Localization
html
<playout-live-video-player lang="en"></playout-live-video-player>

INFO

This widget registers a viewer connection with Playout while it is on the page. The operator interface shows the number of active connections in real time. Connections are refreshed every 30 seconds and cleaned up when the widget is unmounted.


playout-replay-list ​

Shows the replays your organization has published, newest first, with the date and length of each and a Watch replay link. Five are shown at a time; Show more reveals the next five. The list hides itself automatically when the current URL already contains an eventId query parameter (i.e. when a replay is already selected).

The top of the list follows what is happening on your channel:

  • On air — while a broadcast is live, a banner shows its title, when it started and the time on air so far, with a Join the live stream button pointing at live_location. Like the "Live now" banner, it is not shown while the stream is hidden with Hide on site.
  • Next broadcast — otherwise, when an event is scheduled, a card shows its date, a countdown in days, hours and minutes, and an Add to calendar button that downloads a calendar entry. The countdown reads the event's date and start time in your organization's timezone, set under Settings → General; without one, viewers see the start time in their own zone.
  • Replay on its way — right after a broadcast ends, and until its replay is published, a row at the top says the replay is coming.

While it loads, the widget shows placeholder rows in the list's shape, so nothing on your page moves when the replays arrive. If they could not be loaded it says so, with a button to try again.

AttributeTypeRequiredDescription
replay_locationstringYesBase URL for replay pages. The widget appends ?eventId=<id> to build each link
live_locationstringNoURL of your live page, for the Join the live stream button and the calendar entry. Omit it to hide the button
langstringNoLocale code for translated labels. See Localization
html
<playout-replay-list
  replay_location="/replay"
  live_location="/live"
  lang="en"
></playout-replay-list>

A visitor clicking "Watch replay" is sent to /replay?eventId=abc123. Place playout-replay on that destination page to play back the recording.

INFO

A replay's length is recorded when it is published. Replays published before this was the case show their date only.


playout-replay ​

Plays back a recorded event. Reads the eventId query parameter from the current URL to determine which recording to load, then shows the Mux video player in on-demand mode.

When the replay has chapters, a program is shown beside the player: each chapter with its start time and length, and the one playing marked. Viewers click an item to jump to it. Where there is not room beside the player — the widget measures its own width, not the screen's — the program moves underneath.

When your organization has switched on the replay privacy notice, a short notice is shown under the player, with a form viewers can use to ask to be removed.

While it loads, the widget shows a placeholder in the replay's shape, so nothing on your page moves when the video arrives. If the event has no published replay — not published yet, or archived — it says the replay is unavailable instead.

AttributeTypeRequiredDescription
replay_locationstringNoURL of your replay-list page. When set, a "Back to replays" link is shown above the player, pointing here. Omit it to hide the link
langstringNoLocale code for the widget's labels, the program and the privacy notice. See Localization

The eventId is always read from the current URL automatically — only the optional back-link needs configuring.

html
<playout-replay
  replay_location="/replays"
  lang="en"
></playout-replay>

Typical setup across two pages:

PageWidget(s)
/replaysplayout-replay-list
/replay?eventId=abc123playout-replay

To show visitors what is coming up next, use playout-replay-list: its Next broadcast card shows the next scheduled event.

Localization ​

Widgets that display text to visitors accept a lang attribute. Set it to the locale code that matches your website's language.

html
<playout-live-video-player lang="fr"></playout-live-video-player>

Supported locales:

CodeLanguage
enEnglish (default)
frFrench
deGerman
esSpanish
nlDutch
itItalian

Region subtags are accepted and resolved to the base language — fr-CA and fr_CA both render French.

Automatic detection. If you omit lang, widgets detect the locale from the host page instead of always defaulting to English: first the page's <html lang="…">, then the visitor's browser languages. The explicit lang attribute always wins when present. Detection (and any unsupported value) falls back to English.

Styling ​

Widgets expose their internal elements via predictable CSS class names using the playout- prefix. You can override these classes from your own stylesheet.

WidgetKey CSS classes
playout-streaming-status.playout-streaming-status__container, .playout-streaming-status__title, .playout-streaming-status__subtitle
playout-live-video-player.playout-live-player__loading, .playout-live-player__title, .playout-live-player__description, .playout-live-player__text
playout-live-program.playout-program__container, .playout-program__item, .playout-program__item-current
playout-replay-listShadow DOM — style it through parts: ::part(card), ::part(heading), ::part(rows), ::part(row), ::part(title), ::part(date), ::part(link), ::part(footer), ::part(live), ::part(live-link), ::part(upcoming), ::part(calendar-link)
playout-replay.playout-replay__title, .playout-replay__date, .playout-replay-program, .playout-replay-program__item, .playout-replay-privacy

WARNING

playout-live-video-player and playout-replay render in the light DOM, so their classes are directly accessible from your stylesheet. The other widgets render in the shadow DOM — use ::part() or CSS custom properties if you need deeper customisation, or contact the Playout team for guidance.

The video widgets and the replay list also read a few CSS custom properties, which you can set on the widget element or any ancestor:

PropertyDefaultEffect
--playout-player-radius0.375remCorner radius of the player, and of the replay's program and privacy form. 0 for square corners
--playout-accentrgb(37 99 235)Accent colour of the replay's program (the item playing) and privacy form, and of the replay list's buttons, links and date tile
--playout-replay-program-width20remWidth of the replay's program when it sits beside the player
--playout-card-radius0.875remCorner radius of the replay list's card
--playout-card-background#fffBackground of the replay list's card
--playout-card-shadowa soft shadowShadow under the replay list's card; none when your page already frames it
css
playout-replay,
playout-replay-list {
  --playout-player-radius: 0;
  --playout-accent: #004e48;
}

All rights reserved.