Integration guide
Introduction
Embed Bambuser On Demand on your website effortlessly using standard HTML Web Components.
The <bam-playlist> web component renders a series of shoppable videos on any website with plenty of flexibility that allows you to style them to match your brand. Each <bam-playlist> will be populated with videos either selected automatically or handpicked by you or your staff.
<bam-playlist org-id="your-org-id"></bam-playlist>
Integration
1. Load the Bambuser script on your website
- Global workspaces
- EU workspaces
For Bambuser workspaces on the Global dashboard, put the following script tag either in the <head> or <body> tags of your website.
<script async src="https://lcx-embed.bambuser.com/default/embed.js"></script>
For Bambuser workspaces on the EU dashboard, put the following script tag either in the <head> or <body> tags of your website.
<script async src="https://lcx-embed-eu.bambuser.com/default/embed.js"></script>
If you log in to your workspace on lcx.bambuser.com, use the Global script.
If you log in to your workspace on lcx-eu.bambuser.com, use the EU script.
If you have Bambuser Live shopping shows on your webpage, you already have the script on your site!
2. Position the playlist on your page(s)
Place the web component where the playlist should be by adding a <bam-playlist> in the HTML of your page. Once playlists has been successfully added to your page(s), you can populate the playlists with videos via your workspace.
<bam-playlist org-id="your-org-id"></bam-playlist>
You'll find your org-id in the URL of your workspace:
3. Configuring playlist layout and behavior
Below is the options available for configuration of the <bam-playlist> HTML element. Multiple options can be enabled by adding them one after the other to the <bam-playlist> element.
<bam-playlist org-id="your-or-gid" autoplay="hover" mode="grid"></bam-playlist>
Note that only org-id
is required, the rest are optional.
You can also configure playlists from the "Pages" section in your workspace.
Name | Options | Description |
org-id (required) | Your workspaces | |
autoplay (optional) |
| Autoplay videos in the playlist. |
mode (optional) |
| Display mode. |
player-fit (optional) |
| This is useful when having combination of videos with different aspect ratios within the playlist.
|
focus-mode (optional) |
| Select what happens when a user clicks on a video. |
zoom-on-hover (optional) |
| Controls if a player should "zoom" when hovered by a mouse cursor. |
player-settings (optional) | See Player settings below for options. | Specific settings for how players in the playlist should be presented and behave. |
Player settings
Below are additional settings that can be used to toggle or configure various elements inside the individual players.
These are enabled by adding name-of-setting:value
in the player-settings
attribute of the <bam-playlist>.
<bam-playlist org-id="your-org-id" player-settings="products:true"></bam-playlist>
Multiple settings can be added by stringing them together separated by a semicolon (;
).
<bam-playlist org-id="your-org-id" player-settings="products:true;title:false"></bam-playlist>
Name | Options | Description |
products (optional) |
| Controls whether products associated with the video should be shown on top of the players in the playlist. |
productCardMode (optional) |
| Controls the layout of product cards in the player. |
title (optional) |
| Controls the visibility of the video title. |
overlayTextWrap (optional) |
| Controls whether the text in the overlay should wrap or overflow. |
4. Styling the playlist with CSS variables
The playlist appearance can be easily styled to match your brand using CSS variables.
Here's how to style the playlist:
- Define CSS Variables: CSS variables can be defined within a <style> block in your HTML file. These variables will control the appearance of the playlist
2 Apply CSS Variables: The playlist will automatically use these variables to adjust its styling. Change sizes, fonts and other styles by updating the values of the CSS variables.
Example:
:root {
--bam-playlist-gap: 10px;
--bam-player-overlay-font-family: Courier;
}
CSS variable name | Description | Type | Default value |
--bam-player-corner-radius | Set the corner radius of players. | pixel | 0px |
--bam-player-width | Control the width of players (default is the original size of the video). | pixel | auto |
--bam-player-height | Control the height of players (default is the original size of the video). | pixel | auto |
--bam-player-overlay-font-family | Choose which font to use for the title overlay. | string | sans-serif |
--bam-player-overlay-font-weight | Control the weight of the text in the title overlay. | number | 400 |
--bam-player-thumbnail-size | Set the size of the product thumbnail. | pixel | 68px |
--bam-player-placeholder-color | Set the color of the placeholder (shown before the video or poster image has loaded). | color | #EEE |
--bam-playlist-gap | Control the horizontal and vertical space between players in a row/grid. | pixel | 25px |
--bam-playlist-carousel-corner-radius | Set the corner radius of players rendered in the carousel mode. | pixel | 0px |