Skip to main content

Installation

Usage

<bw-player-provider> creates a BeyondWords.Player and exposes it to descendant elements. Extend BwPlayerConsumer to read it.

API

  • <bw-player-provider> creates the player from its data-* attributes (data-project-id, data-content-id, data-source-id, data-playlist-id, data-player-style, data-show-user-interface, plus inline data-content, data-adverts, data-advert-index and data-analytics-consent) and destroys it on disconnect.
  • BwPlayerConsumer is the base class. It walks up the DOM to find its provider and exposes the player via the _player getter and the widget mode via _mode. Throws if no <bw-player-provider> ancestor exists.