Getting StartedDemo App

Demo App

The PanelWave Player demo — try bundled works or your own manifest, preview phone/tablet/desktop frames, and inspect variables, events and performance in the dev-tools drawer.

The player repository ships a small Angular application, projects/demo, that embeds pw-player-shell. It is the reference integration, the host of the end-to-end test suite, and a handy tool for checking a manifest before you publish it.

Open the live demo

Rebuilt and redeployed from the repository on every push, so it always runs the latest player.

To run it locally, see Development & Contributing.

Loading a work

The header offers three ways to pick what to read:

  • Bundled demos — Sample Comic (panel and page view, hotspots, extras), Video Sequencing (video panels that play one after another in page view), Infinite Canvas (a format 1.4 canvas chapter), Content Widgets (download, audio player, video window, scroll text and embedded page, format 1.10), Framed Placements (artwork enlarged and moved behind fixed page frames, format 1.13) and Panel Borders (every border style, format 1.14). Their manifests live in projects/demo/src/assets and make good starting points for your own.
  • Manifest URL or path — type any URL and press Load. Cross-origin URLs need CORS headers on the server. The manifest of a published work sends them: https://read.panelwave.org/api/public/read/{team}/{work}/manifest (the public, anonymous view — paid panels arrive as x-locked stubs) or https://read.panelwave.org/api/public/review/{token}/manifest for a review link.
  • Open file… — pick a local panelwave.json. It is read in the browser and never uploaded; a file that isn't valid JSON shows an error banner.

The player is re-created on every switch, so each work starts cleanly.

Responsive preview frames

The Preview selector renders the player inside a fixed-size frame, so you can check layouts and lettering without resizing the window:

FrameSize (CSS px)?device=
Fill windowthe whole windowfill
Phone390 × 844phone
Phone landscape844 × 390phone-landscape
Tablet820 × 1180tablet
Desktop1440 × 900desktop

The frame contains everything the player renders — its toolbar and dialogs position themselves inside it, just as they would in a host app's container of that size.

Dev tools

Dev tools (or ?devtools=1) opens a drawer next to the player with three tabs:

  • Variables — a live inspector over all five variable scopes (global, chapter, page, session, persistent). Watch hotspots, edge actions and branch choices change story state as you read.
  • Events — a log of the shell's outputs (ready, panelChange, chapterChange, variableChange, localeChange, navigationAttempt, error) with their payloads, newest first. Each navigation logs exactly one panelChange.
  • Performance — frames per second, JS heap size (Chromium browsers), manifest load time, and the number of panel changes.

The dev tools are not available in embed mode. The Debug overlay switch outlines every layer, hotspot and speech bubble the player renders — useful for spotting a hotspot that sits in the wrong place or a layer that doesn't cover its panel.

URL parameters

Everything the header does can be preset in the URL, which makes demo links easy to share:

ParameterEffect
?manifest=<url>Load this manifest instead of the sample (e.g. a published work's manifest URL, see above)
?device=<id>Start in a preview frame (see the table above)
?devtools=1Open the dev-tools drawer on load
?vars=<url-encoded JSON>Seed story variables, e.g. ?vars={"user.age":12} — passed as initialVariables, so read-only variables can be set too
?byUrl=1Hand the player the manifest URL (its manifestUrl input) instead of the parsed object, so the shell loads the work itself — use it to check the manifestUrl path, e.g. ?manifest=<url>&byUrl=1
?entitlements=<tokens>Read as a reader who owns something, e.g. ?entitlements=premium,purchased:ch-3,age-verified — passed as the shell's entitlementSnapshot, see Simulated entitlements
?deny=<panelId>[,<panelId>…]Install an entitlement adapter that refuses these panels, to try the paywall path without a backend (an adapter gates navigation only — refused panels still render, see Custom access checks)
?chapter=<id or uuid>Play only this chapter (the shell's chapterScope, from 1.9.0) — a chapter's manifest id or its chapterId
?embed=1Embed mode (see below)
?origin=<url-encoded origin>Embed mode only (from 1.7.0): the host page's origin, the only origin the demo posts to and accepts messages from

Example: https://panelwave.github.io/player/?device=phone&devtools=1&vars={"user.age":16}

Simulated entitlements

?entitlements= takes a comma-separated list of tokens — the syntax of the CMS preview's entitlement simulator — and turns it into the entitlementSnapshot the demo passes to the shell, so you can read your own paid and age-gated panels without a backend:

TokenSnapshot
basic, premium, prosubscriptionTier set to that tier (with several, the highest wins)
purchased:<productId><productId> added to purchasedProductIds
age-verifiedageVerified: true with an age that passes any minimum
free, anything elseNothing

Without the parameter the shell keeps its anonymous reader: paid and age-gated panels show the locked placeholder and the gate. The same tokens can arrive as the entitlements array of an embed config.

Embed mode

With ?embed=1, or automatically when the demo runs inside an iframe, the header is hidden and the demo waits for its host to send the work via postMessage. From player 1.7.0 the bridge is two-way: the host drives the player live and hears what the reader does. Player 1.9.0 moves the bridge into the library (PlayerEmbedBridge) and speaks protocol v2, which adds chapter scopes for chapter embeds; v1 hosts keep working unchanged. This is how the PanelWave CMS runs its preview — the preview is the real player, not a copy of it.

Load the iframe with your page's origin, so the demo knows where it may post:

<iframe src="https://panelwave.github.io/player/?embed=1&origin=https%3A%2F%2Fyour-site.example"></iframe>

The demo posts only to that origin and ignores messages from any other. Without origin it falls back to its own origin, which suits a same-origin host; a host on another origin must pass it, or nothing comes back.

Send the work with a config message:

iframe.contentWindow.postMessage({
  type: 'config',
  data: {
    manifest,                 // PanelWaveManifest object
    locale: 'de-DE',          // optional
    autoplay: false,          // optional
    muted: false,             // optional
    viewMode: 'canvas',       // optional: 'auto' | 'panel' | 'canvas'
    pageFormat: 'auto',       // optional: a page format id or 'auto'
    variables: { 'user.age': 21 },  // optional initial variables
    entitlements: ['premium', 'purchased:ch-3', 'age-verified'],  // optional, see Simulated entitlements
    initialPanelId: 'p-12',   // optional, read when the player (re)starts
    chapterScope: 'ch-2',     // optional (v2): play only this chapter (id or chapterId)
    showToolbar: true,        // optional (v2)
  },
}, playerOrigin);

The player is created on the first config and re-created only when the manifest changes or the message sets restart: true. Any other config — a new locale, variables, entitlements or options — is applied live, so the reader keeps their place.

From the host you can also send navigate ({ type: 'navigate', panelId }), setVariable ({ type: 'setVariable', key, value }), setLocale, setEntitlements, setOptions (autoplay, muted, view mode, page format, seconds per panel, reduced motion, cover; the toolbar from v2), getState, restart and — from v2 — hostGesture ({ type: 'hostGesture' }: the reader clicked or typed on the host page, so the player may start sound).

From the player you receive:

MessageWhen
{ type: 'pw:hello', protocol: 4, capabilities: [] }On load — the protocol version the bridge speaks (1 before player 1.9.0, 2 before 1.10.0, 3 before 2.4.0). The demo app lists no protocol 4 capabilities: it speaks the protocol 3 set, which is all the CMS preview needs
{ type: 'pw:ready' }The work is loaded and positioned
{ type: 'pw:event', name, data }Every shell output: panelChange, chapterChange, chapterComplete and autoplayChange (v2), locationChange, variableChange, localeChange, navigationAttempt, paywallAction, ageVerified, likeChange, bookmarkChange, error, …
{ type: 'pw:state', data }In reply to getState, and shortly after every change: current chapter, page and panel, view mode, locale, live variables, the last 50 panels visited, the panels reachable next, the paywall gate, preload status, errors and load time

Hosts written for older players that send only config keep working; they now also receive the pw:* messages and may ignore them. The full message reference, including which options apply live and which need a restart, is on the Embed protocol page and in docs/EMBED_PROTOCOL.md in the player repository. To show a work from read.panelwave.org or a package on your own page, use the host SDK rather than the demo app.