Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.streampixel.io/llms.txt

Use this file to discover all available pages before exploring further.

This page covers the SDK’s built-in overlay components, how to hide them, and how to build your own UI driven by SDK events.

Built-in overlays

The SDK includes several overlay components inherited from the Epic Games Pixel Streaming UI library:
OverlayPurpose
ConnectOverlayShown during initial connection
DisconnectOverlayShown when the stream disconnects, with reconnect option
AFKOverlayShown during AFK warning countdown
PlayOverlayShown before the stream starts (click to play)
InfoOverlayGeneric information text display
ErrorOverlayError messages
These overlays are part of the Pixel Streaming UI library and can be imported directly:
import {
  ConnectOverlay,
  DisconnectOverlay,
  AFKOverlay,
  PlayOverlay,
  InfoOverlay,
  ErrorOverlay,
  OverlayBase,
  ActionOverlay,
  TextOverlay,
} from 'streampixelsdk';

Hiding default overlays

Most applications replace the default overlays with custom UI. The built-in overlays are useful for prototyping, but you will typically hide them and build your own for production.
Most applications replace the default overlays with custom UI. Hide them with CSS:
/* Hide all default Pixel Streaming UI */
#uiFeatures {
  display: none !important;
}

/* Hide specific overlays */
#afkOverlay {
  display: none !important;
}

#connectOverlay {
  display: none !important;
}

#infoOverlay {
  display: none !important;
}
Or programmatically:
// After initialization
const uiFeatures = appStream.uiFeaturesElement
  || appStream.rootElement?.querySelector('#uiFeatures');
if (uiFeatures) uiFeatures.style.display = 'none';

Showing overlays programmatically

The SDK provides methods to show overlays:
// Show the disconnect overlay with a custom message
appStream.showDisconnectOverlay('Connection lost. Click to reconnect.');

// Show a text overlay
appStream.showTextOverlay('Loading...');

Building custom UI

Instead of using the built-in overlays, build your own UI components and drive them with SDK events. This gives you full control over appearance and behavior.

Custom controls toolbar

<div id="controls" style="position: fixed; bottom: 20px; right: 20px; display: flex; gap: 8px;">
  <button id="mute-btn">Unmute</button>
  <button id="fullscreen-btn">Fullscreen</button>
  <button id="stats-btn">Stats</button>
</div>
// Mute/Unmute
let muted = true;
document.getElementById('mute-btn').addEventListener('click', () => {
  muted = !muted;

  const video = appStream.stream.videoElementParent.querySelector('video');
  const audio = appStream.stream._webRtcController?.streamController?.audioElement;

  if (video) video.muted = muted;
  if (audio) {
    audio.muted = muted;
    if (!muted && audio.paused) audio.play().catch(() => {});
  }

  document.getElementById('mute-btn').textContent = muted ? 'Unmute' : 'Mute';
});

// Fullscreen
document.getElementById('fullscreen-btn').addEventListener('click', () => {
  if (!document.fullscreenElement) {
    document.documentElement.requestFullscreen();
  } else {
    document.exitFullscreen();
  }
});

// Stats
document.getElementById('stats-btn').addEventListener('click', () => {
  const stats = UIControl.getStreamStats();
  console.log(stats);
});

Custom AFK warning

See AFK (idle timeout) for a complete custom AFK overlay example.

Custom loading screen

See Custom loading screen for building a loading screen driven by lifecycle events.

CSS class reference (from example app)

The example app uses these CSS classes that you can reference or adapt:

Loading screen

  • .loading-overlay — Full-screen loading container
  • .loading-spinner — CSS spinner animation
  • .loading-title — Main heading
  • .loading-subtitle — Description text
  • .loading-progress-track — Progress bar track
  • .loading-progress-fill — Progress bar fill (animated width)
  • .loading-status — Current status message
  • .loading-queue — Queue position container
  • .loading-queue-badge — Queue position number badge

Stream controls

  • .stream-controls — Controls container (fixed, bottom-right)
  • .control-btn — Individual control button
  • .control-btn-active — Active state for toggle buttons

Stats popup

  • .stats-popup — Stats panel container
  • .stats-row — Individual stat row
  • .stats-label — Stat name
  • .stats-value — Stat value

AFK warning

  • .afk-overlay — Full-screen AFK backdrop
  • .afk-card — Warning card
  • .afk-countdown — Countdown number
  • .afk-btn — Dismiss button

Settings

  • .settings-popup — Settings panel
  • .settings-option — Individual option
  • .settings-option-active — Currently selected option

Developer tools

  • .dev-tools-popup — Dev tools panel
  • .dev-tools-section — Grouped section
  • .dev-tools-input — Text input field
  • .dev-tools-btn — Action button

Next steps

Custom loading screen

Build a loading screen driven by lifecycle events.

Example app walkthrough

See custom overlays and toolbars in a working app.