Advanced player setting: Post message bridge


About

The Post Message Bridge plugin lets you forward Kaltura HTML5 player events from the player iframe to the embedding page via window.postMessage so host applications can enrich and route them to analytics or backends.  

You can enable this plugin through the player’s Advanced settings. This configuration is not exposed in the standard Player Studio interface.

Access the Advanced settings

VOD Audio Reels

  1. Log in to your KMC and click the Studio tab. 
  2. The Player Studio page displays. 

  3. Click the player you want to edit from the list (or use the search bar in the top right). 
  4. If you haven't created a player yet, check out our article Create a player for guidance.

  5. The player settings display.

  6. Scroll to the bottom of the player settings and click Advanced settings.
  7. The Advanced settings editor displays.

Configure Post Message Bridge 

You may configure the Post Message Bridge plugin in the player configuration (uiconf) by adding/enabling the plugin block and its options.

Enable the plugin

  1. In the Advanced Settings tab, hover over "plugins" then click the green + icon. 
  2. In the Key Name box, enter postMessageBridge then click the green checkmark or press 'Enter' on your keyboard.
    You’ll see the new plugin listed and enabled.
  3. Click Save at the top right before exiting.

Configure which events to send

To send all events: 

  1. Hover over "postMessageBridge" then click the green + icon. 
  2. In the Key Name box, enter sendAllEvents, then click the green checkmark or press 'Enter' on your keyboard. You’ll see the new setting listed and labeled as "null".
  3. Hover over "sendAllEvents" and click the green edit icon.
     A box containing a "null" value displays.
  4. Replace "null" with "true" then click the small green checkmark.
    The item is now labeled as "true".
    When sendAllEvents is true, the plugin listens to all supported PlayKit HTML5 events (including custom and ad events) and forwards them to the host page via window.postMessage.
  5. Click Save at the top right before exiting.

To select which events are forwarded (optional):

  1. If "sendAllEvents" has been added, set it to "false".
    1. Hover over "sendAllEvents" and click the green edit icon.
       A box containing a "true" value displays.
    2. Replace "true" with "false" then click the small green checkmark.
      The item is now labeled as "false".
    3. Click Save at the top right before exiting.
  2. Add "eventsToSend" and select events.
    1. Hover over "postMessageBridge" then click the green + icon. 
    2. In the Key Name box, enter eventsToSend, then click the green checkmark or press 'Enter' on your keyboard.
      You’ll see the new setting listed and labeled as "null".
    3. Hover over "eventsToSend" and click the green edit icon.
       A box containing a "null" value displays.
    4. Enter groups, event names, or a mix, as a comma-separated string then click the green checkmark or press 'Enter' on your keyboard. In the following example, we are adding one event group - playbackMilestones.
      The Events are listed. 
    5. Click Save at the top right before exiting.

Supported event groups:

  • core – Core playback events such as media_loaded, play, pause, resume, seek, ended

  • playbackMilestones – Milestone events such as play_reached_25, play_reached_50, play_reached_75, play_reached_90, play_reached_100

  • errorEvents – Error events such as error

  • adEvents – Ad plugin events mapped to ad_start, ad_complete, ad_click (and any other ad events supported by the player)

You can also list explicit event names, for example:

"plugins": {
  "hostPageEventBridge": {
    "sendAllEvents": false,
    "eventsToSend": "play,pause,timeupdate"
  }
}

Add optional context fields (optional)

You can include additional identifiers in every message using the optional contextId and channel fields. These values are passed through as‑is in the event payload and can be used by the host page to route or filter events.

"plugins": {
  "hostPageEventBridge": {
    "sendAllEvents": true,
    "contextId": "my-company-site-or-page-context",
    "channel": "company"
  }
}

  • contextId – optional string that identifies the context of the player (for example, a site, page, or template identifier).

  • channel – optional string that identifies the “channel” or namespace for this bridge (for example, "company" if you use it in multiple integrations).

Event payload

Example payload:

{
  "source": "kaltura-player",
  "version": "1.0",
  "event": "play",
  "timestamp": "2026-02-26T12:34:56.789Z",
  "entryId": "1_abcd1234",
  "playerId": "1234567",
  "partnerId": 123456,
  "sessionId": "sess_01",
  "isLive": false,
  "positionSeconds": 12.34,
  "durationSeconds": 300,
  "playbackRate": 1.0,
  "contextId": "prod:/content/site/page-x",
  "channel": "aem"
}

Notes:

  • source and version are always sent

  • Other fields are sent only when available (if a value is missing, that field is omitted)

  • event matches the logical event name selected by  sendAllEvents / eventsToSend

Was this article helpful?
Thank you for your feedback!
User Icon

Thank you! Your comment has been submitted.

In this article
Related articles