Skip to main content
Use headless mode when you need full control over the widget interface (custom layouts, branded controls, or deep integration into your app), while the BeyondWords SDK still handles playback, streaming, analytics, and ads.
For most sites, widget settings in the project dashboard are enough. Only build a custom UI if you need a fundamentally different experience. For minor style tweaks, see style overrides below, but prefer dashboard settings where possible.

When to use headless mode

How it works

  1. Initialize the widget with showUserInterface: false (or omit target to mount headlessly at the end of <body>).
  2. The SDK still loads content, manages the media element, and fires events.
  3. Your code reads widget state (currentTime, playbackState, content, etc.) and renders your own UI.
  4. Your UI writes back to widget properties (playbackState = 'playing', currentTime = 30, etc.).
The widget always mounts in the DOM because playback uses a native media element (<video>). With playerStyle: "video" and showUserInterface: false, the video element renders without built-in controls.

Enable headless mode

Option 1: Hide the built-in UI:
Option 2: Omit target: If you don’t pass target, the widget mounts at the end of <body> with the UI disabled automatically. On iOS and Android, set showUserInterface: false in PlayerSettings and build native controls that call the SDK setters. See the iOS and Android example apps.

Build a custom UI

The simplest pattern is event-driven re-rendering. Listen for widget events, then read state and update your UI:
Use the <any> event type to re-render on every state change. See widget events for specific event types and listener cleanup. For playback control, see programmatic control.

React example

WordPress

The WordPress plugin injects the widget script on published posts. Use the beyondwords_player_script_onload filter to call your custom UI initialization after the widget loads:
The plugin injects the widget script, so do not add it manually. Then follow the plain JavaScript pattern above, using BeyondWords.Player.instances()[0] to get the widget instance.

Plain JavaScript example

Style overrides

If you only need minor tweaks to the built-in widget UI, rather than a full custom interface, you can override CSS. Widget styles are highly specific, so use the intentional override selector:
Widget styles may change between releases. Monitor overrides after widget updates, or prefer dashboard settings instead.

Segment highlight colors

Override segment detection highlight colors without the .bwp selector:

Direct API calls

You can call the player API directly and build a UI from the JSON response. This works, but you lose built-in features: We recommend headless mode over direct API calls unless you have a specific reason to bypass the SDK entirely. Currently, all player data comes from the player endpoints, which are public and cached for 5 minutes. You could call these yourself and build your own user interface on top of this data.

FAQs

Yes. Set showUserInterface: false in PlayerSettings on iOS or Android, then build native controls. The example apps in the iOS and Android repositories demonstrate this pattern.
No. Analytics events still fire when using the SDK in headless mode, as long as you use the widget instance rather than calling the API directly.
Enable highlighting on the Widget page in your project dashboard, then use segment detection markers in your article HTML. Your custom UI can listen for segment events and apply highlight styles, or use the segment CSS overrides with the built-in highlight classes.
Magic Embed installs the standard widget automatically. Use headless mode when you need a bespoke interface that the dashboard widget can’t provide.

Get help

If you encounter issues or have questions, contact support. Include your initialization code and a description of the custom UI you’re building.