Skip to main content
The table below contains a list of properties that can be configured in the widget.
string
The URL of the API that the widget should fetch its data from. This is only really useful if you’re a BeyondWords developer and want to use the internal staging environment to test something.Default: https://api.beyondwords.io/v1/projects/{id}/player
string
default:"undefined"
The base URL of the CDN that the widget should fetch media data from. This is only useful if you’ve configured a custom CDN domain to be used with BeyondWords.Example: "https://bw.example.com"
number
default:"undefined"
The numeric ID of your project. This can be retrieved from the BeyondWords dashboard by visiting a project and copying the numeric ID from within the URL.
string | number
default:"undefined"
The ID of content to load in the widget. This can be retrieved from the BeyondWords dashboard by clicking on the embed button next to a piece of a content and copying it from within the code snippet. Normally this will be a string UUID, but legacy numeric IDs are also supported.
The widget loads content from a projectId and one or more of the following identifiers: { contentId, playlistId, sourceId, sourceUrl, playlist }. If multiple identifiers are provided, the widget will load all of the published content into a playlist, which might include other playlists. The order that content is loaded into the widget will match the order of identifiers in this table. If you want to use a different order set the playlist property to an array of identifiers.
The widget will only load content that has been processed and published. If you want to preview audio before publishing, as part of a drafting workflow, refer to the previewToken setting.
number
default:"undefined"
The ID of a Standard or Smart playlist to load in the widget. Copy it from Audio → Playlists in your project dashboard. (See note above regarding identifiers.)
string
default:"undefined"
An alternative ID that can be used to load content in the widget. This ID is a string that can optionally be provided when creating content via the BeyondWords API. For example, it could be the ID your CMS system uses to identify content. (see note above regarding identifiers)
string
default:"undefined"
An alternative method for loading content into the widget. The source URL is optional and is the URL of where the content can be found on the web. This method of identifying content is discouraged in case the article moves to a different URL. (see note above regarding identifiers)If no other identifiers are set then the widget will set this property to window.location.href. This allows the client-side integration to be used without having to specify an identifier.
object[]
default:"undefined"
An array of identifiers to load into the widget. The four identifiers above are supported. The order that content is loaded into the widget will match the order of the array:
If other top-level identifiers are set on the widget such as contentId, these identifiers will be prepended to the playlist array and appear at the top. (see note above regarding identifiers)
boolean
default:false
Whether to load the AI-generated summary of the content item rather than the original. The summary must be generated beforehand in the BeyondWords dashboard.If a playlist is loaded, the summary of each playlist item will be loaded. If no summary is available, the widget will be hidden or those items won’t appear in the playlist.
string | node
default:"undefined"
The location in the DOM to use as the root node of the widget. It supports the following values:
  • this: When used in a script tag, the widget will be initialized in a new div after the script tag.
  • <string>: A query string to be passed to document.querySelector, e.g., “#some-id”.
  • <node>: A DOM node, e.g., returned from document.getElementById("some-id")
If no target is specified then the widget will be initialized in a new div at the end of the <body> and the user-interface won’t be shown. See Building your own UI for more information.
boolean
default:false
Whether to enable the BeyondWords client-side integration which can simplify the process of importing content into the BeyondWords platform. See the dedicated client-side integration documentation for a setup tutorial and a more detailed explanation of this feature.
boolean
default:true
Whether to show the user-interface. This can be set to false if you want to build your own user-interface on top of the core widget functionality (e.g., in our iOS and Android SDKs).If the playerStyle is video then the &lt;video&gt; element will show without any controls. You can call player.target.requestFullscreen() as usual to enter fullscreen. See Building your own UI.
boolean
default:false
Whether to show the sticky widget that slides up from the bottom of the screen once you scroll past the main widget. Normally this is toggled automatically and should not be set manually.If you are building your own UI, the sticky widget won’t automatically be shown/hidden when scrolling past the main widget so you will need to set this manually, e.g., using an Intersection Observer.If widgetTarget is set, then the widget will always appear inside the widgetTarget and no bottom widget will show, regardless of the value of this boolean. If showUserInterface is set to false then the bottom widget won’t appear either, unless the widgetStyle is video.
boolean
default:true
Whether to show the ‘X’ button that allows users to close the widget.When the widget is closed, playback will be paused and the widgetStyle will be changed to closed-by-user. The widget can be shown again using the Widget API by setting it back to a supported widgetStyle, e.g., “small” or “standard”.Due to space limitations, the close button won’t show during ads or for the “small” player style, regardless of this setting. The close button isn’t supported by the main (inline) widget.
string
default:"standard"
The style of player to display. There are six supported styles:
  • default: The recommended player. You need it to use your agent.
  • small (legacy): The smallest player that has the bare minimum of buttons.
  • standard (legacy): A player that offers a good mix of functionality.
  • large (legacy): A larger player that shows the playerTitle and an image.
  • screen: A full screen player designed to be linked to from social media.
  • video: A player that supports video ads and scrolling text content.
If playerStyle is set to anything else (e.g., “none”) then the player will be hidden.
boolean
default:false
An alias for playerStyle: "video", added for convenience. When set to true, this setting will take precedence over any existing playerStyle setting. Not available through the Widget API.
string[]
default:[]
An array of strings that specify video sizes to load into the widget. When there are multiple videos available for a content item (e.g., vertical or horizontal) this setting lets you choose which to load.Video sizes can be specified in three possible ways:
  • name: The name of the video size, which by default is the same as the aspect ratio (e.g., “16:9”).
  • dimensions: The exact dimensions of the video size (e.g., “1280x720” or “1920x1080”).
  • aspect ratio: The aspect ratio of the video size (e.g., “16:9” or “9:16”).
Multiple video sizes can be specified and videos will be loaded in the order in which they match. For example, if videoSizes is set to [“720x1280”, “9:16”, “portrait”] then videos are loaded as follows:
  • First, it attempts to load a video with exact dimension “720x1280”.
  • Then, it attempts to load a video with aspect ratio “9:16”.
  • Finally, it attempts to load a video with name “portrait”.
If multiple videos match a string then one of the videos will be selected arbitrarily. If none of the strings match any videos then no video will be loaded and audio will load instead (if available).If video sizes is an empty array (its default) then an arbitrary video will be loaded for the content item.When a vertical video is loaded into the widget (aspect ratio is less than one), the widget will switch to a “minimal UI” mode due to the limited space typically available for vertical video:
  • A large play/pause button shows in the middle.
  • The progress bar, time indicator, and BeyondWords logo show.
  • All other buttons are omitted (e.g., maximize, playlist toggle).
string
default:"undefined"
The title to show at the top of the large, screen, and video players. Normally this is automatically set to the name of your project but can be specified in the BeyondWords dashboard. It can also be overridden when initializing the widget if you want to use a different title for the widget.
string
default:"undefined"
The prompt to show on the small and standard players when it is stopped. If the value is falsy, it translates ‘Listen to this article’ into the language set by playerLanguage, or the user’s browser preference if that isn’t set, assuming that language is supported by the widget. An explicitly set callToAction is never translated.
boolean
default:true
Whether to show the title during playback.
string
default:"undefined"
The disclosure line shown below the Default widget.
A URL for your disclosure text to link to.
string
default:"undefined"
The text shown when users tap the info icon.
string
default:"undefined"
The name of your agent.
string
default:"undefined"
The text in the agent’s input box before the user starts typing.
string
default:"undefined"
The URL of an image to use as your agent’s avatar instead of the color orb.
boolean
default:true
Whether users can talk to your agent by voice. Set it to false for text only.
boolean
default:false
Whether to show your agent on pages with no content.
string
default:"undefined"
The language code used for the widget’s built-in UI strings, including the default call-to-action, duration labels, widget messages, and aria-labels. When set, the widget uses this language instead of the user’s browser preference.Example: "de" or "zh-TW"If omitted (undefined), the widget falls back to navigator.languages, then English. If the value isn’t a supported language code, the widget logs a console warning and falls back to the browser preference.This property can be changed at runtime via the Widget API.
string
default:"auto"
The style of the skip buttons. There are four supported styles:
  • auto: Skip by ‘tracks’ for a playlist and ‘segments’ for a single item.
  • segments: Skip backwards and forwards by one paragraph.
  • seconds: Seek backwards and forwards by 10 seconds.
  • tracks: Skip backwards and forwards by one playlist track.
By default, the ‘seconds’ style skips 10 seconds in both directions but you can control this with ‘seconds-15’ or ‘seconds-15-30’ to set a different number of seconds for backwards/forwards.
string
default:"auto-5-4"
Whether to show the playlist. There are three supported styles:
  • auto: Show the playlist when there is more than one content item.
  • show: Show the playlist by default (can still by toggled by the user).
  • hide: Hide the playlist by default (can still be toggled by the user).
By default, the ‘auto’ and ‘show’ styles display 5 items on desktop and 4 on mobile before a scrollbar appears but you can set a different number.For example, ‘auto-3’ will show 3 items and ‘show-10-8’ will show a different number on desktop and mobile. This can be set to a very large number, e.g., ‘show-99999’ to never show a scrollbar.
string
default:"auto"
Whether to show the playlist toggle button in the widget. There are three supported styles:
  • auto: Show the toggle when there is more than one content item.
  • show: Show the toggle.
  • hide: Hide the toggle.
string
default:"auto"
Controls whether the widget follows the continuous playback mode configured in the project dashboard. There are two supported values:
  • auto: Uses the continuous playback mode configured in the project dashboard.
  • none: Disables continuous playback in the widget, even if it is turned on in the project dashboard.
Note: If continuous playback is enabled in the dashboard, the widget will play the most recently published items after the current item ends. If disabled, the widget will stop once the current item ends.
string
default:"after-all"
Controls when the outro plays in a playlist. There are two supported values:
  • after-each: The outro plays after each item in a playlist.
  • after-all: The outro plays after the last item in a playlist only.
Note: For new projects, the default is after-each.
string[]
default:[]
An ordered list of file extensions, e.g., ["mp3", "mp4"], that is used to determine whether to show the download button next to playlist items. The first extension that matches one of the content item’s audio/video URLs will be downloadable with a filename of &lt;content title&gt;.&lt;extension&gt;.
function
default:"undefined"
A function that controls how the duration of content is displayed in the widget. By default, the duration will be shown as “n min” but it can be overridden by setting your own function:
By default, the widget will attempt to translate “n min” into the language set by playerLanguage, or the language of the user’s browser if that isn’t set. You can use the same translate function in your formatting function if you would like:
The available translation for each language can be found in the source. Make sure your durationFormat function doesn’t throw an error, so the widget loads correctly. It isn’t currently possible to customize the presentation of other time/duration formats in the widget.
string
default:"auto"
Whether to use the Media Session API. When enabled, the player will appear on your phone’s lock screen and can be controlled using your native device buttons. There are three supported types:
  • auto: Use the Media Session API if it isn’t already being used by your website.
  • override: Use the Media Session API and override your website’s existing media session.
  • none: Do not use the Media Session API.
If there are multiple widgets on the page, the media session will be set to the widget that is currently playing or that was most recently playing. Otherwise, the first widget initialized is chosen. The media session is set whenever playback begins (when the PlaybackPlaying event is emitted).The media session makes use of many widget settings. For example:
  • It shows the title from the content that is currently playing or will play after the ad.
  • It shows the image from the active ad or content item.
  • It falls back to a speaker icon that uses iconColor and backgroundColor.
  • It disables the skip buttons and prevents scrubbing when an ad is playing.
  • It respects the skipButton style, e.g., it can skip between segments (depending on the device).
If any widget is set to ‘override’ then the media session may be overridden, including by widgets that are set to ‘auto’. If there is no existing media session, ‘auto’ and ‘override’ behave the same.
object[]
default:[]
The array of content to play in the widget. Normally this is automatically set based on the identifiers but it can be overridden if you wish to set the content manually without making API requests. A playlist will be shown in the widget if the array contains multiple items.
Each content item can contain both audio and video media files. If the playerStyle or widgetStyle is ‘video’ and the HTML video element is visible when the track changes, the widget will prefer video media and fall back to audio. Otherwise, it will prefer audio and fall back to video. The widget will attempt to load media in array order until a file format that it is able to play is found.
All fields are optional and the widget will work with what it is given, rather than raise an error.
  • id will be included in events sent to analyticsCustomUrl and Google Analytics.
  • title will be shown for the content item in the widget.
  • imageUrl will be shown in the large, screen, and video players.
  • sourceUrl will be used as the href of a link in the screen player.
  • sourceId will be included in BeyondWords/custom/Google analytics events.
  • adsEnabled will determine whether ads play before/during/after this content item.
  • duration is only used for display in the playlist and is normally fetched from the media.
  • audio is an array of media sources for the content item (see note above).
  • video is an array of media sources for the content item (see note above).
  • segments is an array of timestamps used for skipping between paragraphs.
number
default:0
The index of the active content item in the widget. This can be set to change the track in a playlist.
object[]
default:[]
An array of intros and outros to play before and after all of the content and ads. Normally intros and outros are automatically set from your project but can be overridden if you wish to set the intros and outros manually. There are two different placements:
  • pre-roll: The element is an intro that plays before all content and ads.
  • post-roll: The element is an outro that plays after all content and ads.
See the note above about content media which also applies to intro and outro media.If the array contains multiple intros or outros, the widget will choose one of each at random which then will be used for all widgets currently loaded on the page to keep the experience consistent.If skipButtonStyle is set to ‘segments’, the user can skip past the intro to the content and they can skip back from the outro to the last segment of the content.If skipButtonStyle is set to ‘tracks’, the intro/outro will be considered part of the first/last content item and the user can skip past them in a single click.If content is replayed by the user, the intro and outro will play again. The intro will be skipped if the user begins playback from currentTime > 0, e.g., when clicking on a segment in the article.
number
default:-1
The index of the active intro or outro in the widget. This can be set to play an intro or outro, but it is recommended not to do this manually because pre/mid/post-roll placement won’t apply.
object[]
default:[]
An array of ads to play in the widget. Normally ads are automatically set from your project but can be overridden if you wish to set the ads manually. There are two types of ad:
  • custom: An ad that specifies its own media sources and clickThroughUrl.
  • vast: An ad that is fetched from the vastUrl, e.g., from Google Ads.
In the case of a ‘custom’ ad, the vastUrl field will be ignored. In the case of a ‘vast’ ad, the clickThroughUrl and media fields will be ignored. There are three different placements:
  • pre-roll: The ad plays before the content or between playlist items.
  • mid-roll: The ad plays mid-way through a content item or between playlist items.
  • post-roll: The ad plays after the content or between playlist items.
See the note above about content media which also applies to ad media.While an ad is playing it can ‘take over’ the user interface to show an image and different color theme or it will fall back to the default widget colors for those that aren’t specified in the ad.
number
default:-1
The index of the active ad. This can be set to play an ad, but it is recommended not to do this manually because pre/mid/post-roll placement won’t apply.
number
default:120
The minimum duration that a content item must have for a mid-roll ad to play. If a content item’s duration is less than this time in seconds then a mid-roll ad won’t play.Additionally, mid-roll ads won’t play during content items in playlists and will instead play in-between playlist items. Pre-roll and post-roll ads will also play in-between items.Mid-roll ads play after playback reaches 50% of the content item’s duration at the next boundary between segments (paragraphs) to make the listening experience less jarring.
number
default:10
When seeking, this setting controls the minimum amount of time before the end of playback that the user must seek for mid-roll ads to play. In other words, this prevents mid-roll ads from playing within the last N seconds if the user seeks near to the end of the progress bar.When seeking past 50% of the duration and before the number of seconds specified by this setting, mid-roll ads will play immediately and interrupt playback. Mid-roll ads won’t be aligned to the boundaries between segments (paragraphs) in this case (as per setting above).
boolean
default:false
Whether to show an ad image in the ‘large’ and ‘screen’ playerStyle during regular content playback. The image will be clickable if a clickThroughUrl is set on the ad.The persistent ad will change to whichever ad played most recently. If the content has started but no ad has played yet, the image will be set to the first pre-, mid-, or post-roll ad in the ads array in that order of precedence, i.e., pre-roll will take precedence.This setting only applies to ‘custom’ ads. Ads with type ‘vast’ won’t be persistent.
number
default:-1
The index of the persistent ad in the widget. The can be set to show an ad, but it is recommended not to do this manually because the selection process above won’t apply.
number
default:0
The duration of the active content item in the widget. The duration is fetched from the loaded media, rather than the duration field in the content item which is only used for the playlist display.This property is intended to be read-only and should not be set manually, otherwise the duration shown in the user-interface will be incorrect until the media is changed, e.g., by changing track.
number
default:0
The current playback time of the media. The currentTime automatically updates while the media is playing and can be retrieved using the Widget API or set to a value to seek to the given time.If this setting is provided when initializing the widget, the first track will begin from the given time. There is a brief period in which the currentTime will be 0 while the media loads and it will then revert back to the specified time after the MediaLoaded event has been emitted.
string
default:"stopped"
The current playback state of the media. The can be set to start or stop playback, provided the programmatic call is on behalf of a user action such as clicking a button. There are three states:
  • stopped: Playback hasn’t yet started or it has finished.
  • playing: The media for the content item is playing.
  • paused: The media for the content item is paused.
number
default:1
The current playback rate of the media. This can be set to speed up or slow down playback. The playbackRate will persist across tracks but temporarily resets to 1 during ads.
number[]
The visible playback rates that can be cycled through in the user interface. It isn’t a requirement that the playbackRate setting above be set to one of these values when using the Widget API.Default value: [0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 2, 2.5, 3]
string
default:"standard"
The style of the sticky widget, which shows at the bottom of the page once the user scrolls past the main widget. All six styles are supported (see playerStyle). Set it to “auto” to use the same style as playerStyle, or “none” to hide the sticky widget. If playerStyle is “default”, the widget always uses the default style unless widgetStyle is “none”.
string
default:"auto"
The horizontal position of the sticky widget when it is showing. There are four supported options:
  • auto: Show the widget in the center for the standard player, otherwise right.
  • left: Show the widget on the bottom-left corner of the screen.
  • center: Show the widget at the bottom of the screen in the middle.
  • right: Show the widget in the bottom-right corner of the screen.
This setting has no effect when widgetTarget is set. Instead, you can position the widgetTarget as needed using your own css styles that are applied to the root element of the widget.
string
default:"auto"
The width of the sticky widget. Can be set to any CSS unit, including 500px, 50rem, 50%, and fit-content. This property can be set to 0 to make the widget use its smallest possible width.By default, the small playerStyle expands and collapses. You can force it to always be collapsed by setting this property to 0, or to always be expanded by setting this property to initial.
string
default:"16px"
The margin of the sticky widget. Can be set to any CSS unit, including 50px, 5rem, and 5%.The margin for each side of the widget can be set separately, e.g., “10px 20px 30px 40px” will set the top, right, bottom, and left margins, respectively. You may also use shorthands to set multiple margins at once, e.g., “10px 5px” to set top/bottom and left/right margins, respectively. If the widgetPosition is center, the left/right margins will be averaged.
string | node
default:"undefined"
The location in the DOM to render the sticky widget, instead of fixing it to the bottom of the screen. It supports the following values:
  • <string>: A query string to be passed to document.querySelector, e.g., “#some-id”.
  • <node>: A DOM node, e.g., returned from document.getElementById(“some-id”).
If widgetTarget undefined then the widget will show as a fixed element at the bottom of the screen once the user has scrolled past the main widget. When widgetTarget is set, the widget will always show, regardless of the value of showUserInterface and the scroll position of the user.The singular <video> element can only show behind one user interface at a time. It will be relocated to/from the widget while active and a message will show in the other interface. Additionally, the widgetPosition setting will have no effect when widgetTarget is used.
number
default:8
How rounded the corners of the Default widget are.
string
default:"undefined"
The color theme of the Default widget: "light", "dark", or "auto" to match the user’s device. If not set, the widget uses your project’s theme. Set it to null or undefined to switch back to the project theme.
object
The colors of the Default widget in light mode. Fields you leave out use your project’s colors. Each field accepts any CSS color:
  • backgroundColor
  • textColor
  • secondaryTextColor
  • iconColor
  • subtleColor
  • linkColor
  • highlightColor
  • wordHighlightColor
  • agentColor
  • accentColor
  • accentTextColor
object
The colors of the Default widget in dark mode. It has the same fields as lightTheme.
object
The colors of the video widget in all modes. Each field accepts any CSS color:
  • backgroundColor
  • textColor
  • iconColor
  • subtleColor
string
default:"#111"
Deprecated. Use lightTheme, darkTheme, or videoTheme instead. The text color. Can be set to any CSS color, including red, #f00, #ff0000, and rgba(255, 0, 0, 0.8). This color can be overridden when an ad is playing by specifying it in the ad object.
string
default:"#f5f5f5"
Deprecated. Use lightTheme, darkTheme, or videoTheme instead. The background color. Can be set to any CSS color, including red, #f00, and rgba(255, 0, 0, 0.8). This property can also be set to a linear gradient: linear-gradient(to right, #fcf, #fcc). This color can be overridden when an ad is playing by specifying it in the ad object.
string
default:"rgba(0, 0, 0, 0.8)"
Deprecated. Use lightTheme, darkTheme, or videoTheme instead. The icon color. Can be set to any CSS color, including red, #f00, #ff0000, and rgba(255, 0, 0, 0.8). This color can be overridden when an ad is playing by setting it in the ad object.
string
default:"#eee"
Deprecated. Use lightTheme, darkTheme, or videoTheme instead. The highlight color for the current and hovered segments. Can be set to any CSS color, including red, #f00, #ff0000, and rgba(255, 0, 0, 0.8). This color isn’t overridden when an ad is playing.
boolean
default:false
Whether to highlight the current word being spoken. Default is true for new projects.
string
default:"undefined"
Deprecated. Use lightTheme, darkTheme, or videoTheme instead. The highlight color for the current word if wordHighlightsEnabled is set to true. Can be set to any CSS color, including red, #f00, #ff0000, and rgba(255, 0, 0, 0.8).
string
default:"white"
Deprecated. Use lightTheme, darkTheme, or videoTheme instead. The text color of the surrounding user interface when playerStyle is video. Can be set to any CSS color, including red, #f00, #ff0000, and rgba(255, 0, 0, 0.8). This color can be overridden when an ad is playing by specifying it in the ad object. This setting doesn’t affect the video itself.
string
default:"black"
Deprecated. Use lightTheme, darkTheme, or videoTheme instead. The background color of the surrounding user interface when playerStyle is video.
string
default:"white"
Deprecated. Use lightTheme, darkTheme, or videoTheme instead. The icon color of the surrounding user interface when playerStyle is video. Can be set to any CSS color, including red, #f00, #ff0000, and rgba(255, 0, 0, 0.8). This color can be overridden when an ad is playing by setting it in the ad object. This setting doesn’t affect the video itself.
string
default:"undefined"
Deprecated. Use lightTheme, darkTheme, or videoTheme instead. The color of the agent orb.
string
default:"undefined"
Deprecated. Use lightTheme, darkTheme, or videoTheme instead. The accent color of the Default widget.
string
default:"undefined"
Deprecated. Use lightTheme, darkTheme, or videoTheme instead. The color of text on the accent color.
boolean
default:true
Whether to show the BeyondWords logo icon.
string
default:"all"
The sections to enable when highlighting segments in the article. This helps readers follow along by highlighting the currentSegment as the currentTime of the widget changes. It also helps users understand they can click on a segment in the article to begin playback. It supports the following:
  • all: Allow all segments in the article to be highlighted.
  • body: Allow segments that have a section of ‘body’ to be highlighted.
  • summary: Allow segments that have a section of ‘summary’ to be highlighted.
  • none: Don’t allow any segments to be highlighted.
Additionally, you can use a double-barreled string to set the behavior for the currentSegment and hoveredSegment separately. For example, ‘all-none’ will enable highlighting for the currentSegment and disable it for the hoveredSegment. Alternatively, ‘none-body’ will disable highlighting for the currentSegment and enable it for hovered segments in the ‘body’ section.This feature will only work for elements that have been correctly marked up on your page with a ‘data-beyondwords-marker’ attribute. See Segments Playback for more information.
string
default:"all"
The sections to enable for playback from paragraphs. This allows users to click on a segment in the article to begin playback from that segment. It supports the following values:
  • all: Allow playback by clicking on any of the segments in the article.
  • body: Allow playback by clicking on segments that have a section of ‘body’.
  • summary: Allow playback by clicking on segments that have a section of ‘summary’.
  • none: Don’t allow playback by clicking on segments.
If the currentSegment is clicked, it will pause and resume playback from the current position. Otherwise, it will skip to the hoveredSegment’s startTime and begin playback.If the segment contains links or other elements that have ‘onclick’ or ‘onmousedown’ handlers, this feature won’t interfere and the user can click those elements without affecting playback. If event listeners are used, you can call event.preventDefault() to prevent triggering playback.This feature will only work for elements that have been correctly marked up on your page with a ‘data-beyondwords-marker’ attribute. See Segments Playback for more information.
string
default:"body"
The sections to enable for showing the segment widget. This is a small user-interface that appears next to segments in the article. This allows users to click on a play/pause button next to the segment to begin playback from that segment. It supports the following values:
  • all: Allow the segment widget to be shown next to all segments in the article.
  • body: Allow the segment widget to be shown next to segments that have a section of ‘body’.
  • summary: Allow the segment widget to be shown next to segments that have a section of ‘summary’.
  • none: Don’t allow the segment widget to be shown next to any segments.
Additionally, you can use a double-barreled string to set the behavior for the currentSegment and hoveredSegment separately. For example, ‘all-none’ will show the segment widget to next to the currentSegment and won’t change when segments are hovered. Alternatively, ‘none-body’ will only show the segment widget next to segments that are hovered and have a section of ‘body’.If the segment widget appears next to the current segment, it will show the play/pause button as usual. Otherwise, the segment widget will always show a play button and its circular progress bar will show the segment’s startTime relative to the duration of the audio. The segment widget is ‘sticky’ which means that it continues to show when the user stops hovering over a segment.This feature will only work for elements that have been correctly marked up on your page with a ‘data-beyondwords-marker’ attribute. See Segments Playback for more information.
string
default:"7-oclock"
The position of the segment widget relative to the segment text’s rectangle. For convenience, hours of a clock are used for specifying the position. It supports the following values:
  • 1-oclock: Above the text, on the right.
  • 2-oclock: Right of the text, at the top.
  • 3-oclock: Right of the text, vertically centered.
  • 4-oclock: Right of the text, at the bottom.
  • 5-oclock: Below the text, on the right.
  • 6-oclock: Below the text, horizontally centered.
  • 7-oclock: Below the text, on the left.
  • 8-oclock: Left of the text, at the bottom.
  • 9-oclock: Left of the text, vertically centered.
  • 10-oclock: Left of the text, at the top.
  • 11-oclock: Above the text, on the left.
  • 12-oclock: Above the text, horizontally centered.
The widget will be positioned approximately 50% of the widget’s width away from the text. If the position is 7-oclock or 11-oclock the segment widget will be indented slightly to align with the play/pause button of the player, taking into account the current playerStyle.If the segment widget appears left or right of the text, a ‘position: relative’ style will be added to the data-beyondwords-marker element and the segment widget will be positioned absolutely.
object
default:"undefined"
The segment that aligns with the currentTime of the widget. The currentSegment will be unaffected while an ad is playing and the audio will resume from the segment when the ad ends.The currentSegment additionally contains contentIndex and segmentIndex which refers to its position in the content array. The currentSegment is set and the CurrentSegmentUpdated event is emitted regardless of the segmentPlayback and highlightCurrent widget settings (see above).This property will only be set for elements that have been correctly marked up on your page with a ‘data-beyondwords-marker’ attribute. See Segments Playback for more information.This property is intended to be read-only and should not be set manually.
object
default:"undefined"
The segment that is currently being hovered over by the user. This will be set to null if the user hovers over a link or an element with ‘onclick’ or ‘onmousedown’ listeners so that highlighting doesn’t apply to the segment from the highlightHovered setting. This helps explain to the user that playback will be unaffected if they click on a link or other elements within the segment.The hoveredSegment additionally contains contentIndex and segmentIndex which refers to its position in the content array. The hoveredSegment is set and the HoveredSegmentUpdated event is emitted regardless of the segmentPlayback and highlightHovered widget settings (see above).This property will only be set for elements that have been correctly marked up on your page with a ‘data-beyondwords-marker’ attribute. See Segments Playback for more information.This property is intended to be read-only and should not be set manually.
object
default:"undefined"
The media source that is currently loaded into the widget. This is set to an element from the audio or video arrays within content, ads, or introsOutros.
This property is intended to be read-only and should not be set manually. This property is set by either the MetadataLoaded or the MediaLoaded event (both of them set this property).On iOS Safari, this event might not be emitted until the user presses play. It is recommended to use the ContentAvailable and NoContentAvailable events for deciding when to show the widget.
string
default:"undefined"
The preview token that should be used to load pre-published content into the widget. This is useful if you want to preview the generated audio before publishing it as part of a draft workflow. For example, this setting is used in ourto initialize the widget for draft posts.Preview tokens are generated automatically by BeyondWords when content is first created. You can retrieve the preview token for a content item from the Get content endpoint. For the previewToken setting to work, its value must match the preview token assigned to the content item.There will still be a short delay while media is generated before the widget will load.
string
default:"undefined"
The access tier of the current listener. Determines which tier settings the widget applies, including intro/outro audio, ads, and content access limits. Accepts the slug of any access tier in your project, such as 'anonymous', 'registered', 'subscribed', or a tier you create. If omitted or set to an invalid value, the widget uses the anonymous tier settings.On shareable URLs, you can also pass this as the accessTier query parameter.If the widget is Private, it ignores accessTier.See the access tiers doc for setup instructions.
string
default:"undefined"
The sign-in provider the widget uses to get the reader’s access tier when the widget is Private. Accepts 'ghost' or 'piano'. Without it, every reader gets the Default tier.See widget access for setup instructions.
string
default:"undefined"
The text of the call to action for the user’s access tier.
string
default:"undefined"
The URL of the call to action for the user’s access tier.
string
default:"undefined"
The text of the call to action shown when your agent is locked or the user’s allowance is used up. Falls back to accessCtaText.
string
default:"undefined"
The URL of the call to action shown when your agent is locked or the user’s allowance is used up. Falls back to accessCtaUrl.
The level of consent provided by the user of your website for whether personalized ads are allowed. This only applies to ads of type ‘vast’ and maps onto the parameters documented here. You are responsible for requesting consent from your users. There are three levels:
  • personalized: Adds the npa=0 parameter to vastUrl so that personalized ads will play.
  • non-personalized: Adds the npa=1 parameter to vastUrl which switches off personalized ads.
  • under-the-age-of-consent: Adds the tfua=1 parameter which disables many forms of tracking.
The widget copies the approach taken by Google which is to enable personalized ads by default and place the burden on the integrator to ensure they have requested consent from their users.
The level of consent provided by the user of your website for whether usage analytics are allowed to be sent by the widget to the BeyondWords dashboard and to the analyticsCustomUrl if it is set. You are responsible for requesting consent from your users. There are three supported levels:
  • allowed: Analytics will be sent to BeyondWords and analyticsCustomUrl.
  • without-local-storage: Analytics will be sent but without local_storage_id.
  • none: Analytics won’t be sent to BeyondWords or analyticsCustomUrl.
The widget allows analytics by default because they don’t contain any personally identifiable information and only contain random UUIDs to identify the same user across sessions. This UUID is persisted in local storage in the browser under the ‘beyondwords’ key.
string
default:"undefined"
A custom URL that analytics events should be sent to, in addition to BeyondWords. These events are exactly the same as those sent to BeyondWords. See Custom Analytics for more information.
string
default:"auto"
The device_type that should be sent in analytics events. There are six supported options:
  • auto: Automatically detect the type of device (see below).
  • desktop: Set the device_type to ‘desktop’.
  • tablet: Set the device_type to ‘tablet’.
  • phone: Set the device_type to ‘phone’ (intended for mobile web rather than native apps).
  • ios: Set the device_type to ‘ios’ (intended for native iOS apps).
  • android: Set the device_type to ‘android’ (intended for native Android apps).
If device_type is set to auto then the widget will use window width as a simple heuristic:
  • A value of ‘desktop’ will be sent if the width is >= 1000x.
  • Otherwise, value of ‘tablet’ will be sent if the width is >= 500px.
  • Otherwise, a value of ‘mobile’ will be sent.
This setting will apply to all analytics events emitted by the widget, which includes those sent to the BeyondWords dashboard, the analyticsCustomUrl, and Google Analytics if analyticsTag is set.
string
default:"undefined"
The Google Measurement ID to use when sending events to Google Analytics. When analyticsTag is set, events will always be sent to Google Analytics, regardless of analyticsConsent.
string | node
default:"undefined"
The location in the DOM to use as a control panel for the widget. It supports the following values:
  • <string>: A query string to be passed to document.querySelector, e.g., “#some-id”.
  • <node>: A DOM node, e.g., returned from document.getElementById(“some-id”).
The control panel allows you to change most of the widget settings via dropdowns or text input fields. It automatically updates to show the current state of the widget. The control panel appears on the right-hand side of the player demo page and the playback from paragraphs prototype.
function
default:"() => {}"
The function to call when an unhandled JavaScript error or promise rejection occurs. If this function returns true then the error will stop propagating. This can be useful, for example, to suppress error output from the widget appearing in the JavaScript console.This function receives the error object as its only argument. In the case of a rejected promise, the function will receive event.reason which is usually the error object associated with the promise.If any widget sets an onError function then all widget instances on the page will use the function set first. This setting can only be used during initialization in new BeyondWords.Player(…). If the function is changed later through the Widget API, these changes will be ignored.

Compatibility across SDKs

Here’s a summary of the widget settings available across the SDKs: