Skip to main content

Installation

Usage

Import the modules (each calls customElements.define), then use the elements. Nest the link inside a <bw-player-provider>.
<bw-advert-link> finds its nearest <bw-player-provider> ancestor, reads the current advert (adverts[advertIndex]) from it, and renders a link to its clickThroughUrl (showing the hostname as the label), updating on every player event. On click it emits a PressedAdvertLink event (built with newEvent). It renders nothing when there’s no active advert, so it’s safe to include unconditionally.
These components expect the BeyondWords player to be available as a global BeyondWords (the player UMD script). Load it before the provider connects.

Reference