Introduction
Embedded learning allows you to start an instance of your Docebo platform on any external web page, as long as you have access to its HTML and JavaScript code.
The Docebo platform instance opens as a pop-up activated either when the user clicks on a button or interacts with an element - such as a link, or a string - on the external web page. When the pop-up opens, the platform instance shows the training content you, as the Superadmin, have selected for the user on the basis of the action they are performing, in order to provide the best learning on the fly experience, enriching it with ad hoc training.
Embedded learning is available as a web-based application on desktop and mobile platforms.
The single asset player widget allows you to play specific assets from the Docebo platform as if you were using the Docebo platform itself. As such, all statistics that would be produced when using the Docebo platform are also reproduced by using the widget, allowing the platform to keep track of the learners in the usual manner.
If the training material you have selected is a downloadable file, you will be presented with a download button that you can press to save the file locally. In the event that you have already downloaded this file previously, you will be advised of this fact by the single asset player widget, while still being given the option to download it again.
The configuration of features like, closed captioning, playback speed controls and the ability to skip ahead or back are managed in the platform.
Activating embedded learning
To activate embedded learning, reach out to Docebo via the Help Center, or by contacting your Account Manager (if your plan includes this option).
HTML tag
The single asset player requires the following tag to be inserted into the web page to display:
<dcbo-asset-player
[LIST OF TAG ATTRIBUTES]
>
</dcbo-asset-player>
List of tag attributes
The dcbo-asset-player
tag can accept the following list of attributes, all values associated with the attributes should be encapsulated in double-quotation marks. All parameters are optional, unless stated otherwise in the description.
Tip: All boolean values in the tag attributes can accept the following values to denote false
:
-
false
(Example:showfullscreen="false"
) -
0
(Example:showfullscreen="0"
) - An empty value (Example:
showfullscreen=""
)
Any other provided value is interpreted as true
.
Parameter | Type | Description |
---|---|---|
id |
string |
The HTML ID of the given web component element. This attribute is required. Please note: If this attribute is not supplied then the widget becomes non-interactive via JavaScript or other widgets in the page. |
assetid |
string |
The asset’s ID number in the platform. If an incorrect value is provided the widget displays the following error: If the required permissions to view the asset are not present, the following error will be displayed to the learner: Please note: This attribute is required. |
showfullscreen |
boolean |
Shows the Show Fullscreen button in the viewer view if set to Default value: |
showtoc |
boolean |
Shows the Overview button in the preview and viewer view if set to Tip: If Default value: |
showthumbsintoc |
boolean |
If set to Default value: |
forcefullscreen |
boolean |
If set to true, forces the viewer view to display in fullscreen mode. Tip: If Default value: |
showpreview |
boolean |
If set to Default value: |
downloadmode |
string |
Sets the asset download mode. Possible values:
Tip: If the value is set to Default value: |
autoplay |
boolean |
If set to Default value: |
showpip |
boolean |
If set to Please note: This attribute does not change the behavior of YouTube, Vimeo and Wistia videos. Default value: |
showstatus |
boolean |
If set to Default value: |
Widget views
The asset player widget contains the usual three views as the course player: preview, overview, and viewer. These views are described in greater detail here.
Preview view
The initial view of the asset player widget is the preview view. The preview may be skipped by setting the show preview attribute to false. In this case, the initial view becomes the viewer:
<dcbo-asset-player
assetid="36"
id="apw_bc1572"
showpreview="false">
</dcbo-asset-player>
The preview view has three main areas:
-
The container:
Displays the asset thumbnail as a background if it has an assigned or the asset-type dependent default thumbnail. -
The general information area:
A subsection of the container, it provides the general information about the asset such as title, type, and whom it was shared by. It also shows if the learner has opened the asset, using the labels New or Watched. The View Content button navigates the user to the viewer. -
The navigation area:
A subsection of the container, it only contains the Overview button that navigates the user to the overview. This button is not displayed if the integrator sets theshowtoc
attribute tofalse
.
<dcbo-asset-player
assetid="36"
id="apw_bc1572"
showtoc="false">
</dcbo-asset-player>
Overview
The overview details various asset information.
-
The header section:
Contains the asset title and the back button to help the user navigate to the previous view. -
The main content section:
Displays the asset description, and by whom, when, and on which channels it was shared. -
The main action button:
Navigates the user to the viewer view.
A more detailed display is also available for this view if the integrator sets the showthumbsintoc
attribute to true
. In this display, the header also contains the asset type and the thumbnail as background.
<dcbo-asset-player
assetid="36"
id="apw_bc1572"
showthumbsintoc="true">
</dcbo-asset-player>
Viewer view
The main role of the viewer is to display the asset. It contains three main areas:
-
The Title of the header:
Displays the asset title and a back button to navigate to the previous view. -
The control buttons in the header:
Contains two buttons. The first one navigates the user to the overview and the second toggles between the fullscreen and normal view. -
The main content:
Holds the actual asset.
If the integrator sets the showtoc
attribute to false
, the overview button does not appear.
<dcbo-asset-player
assetid="36"
id="apw_bc1572"
showtoc="false">
</dcbo-asset-player>
If the showfullscreen
attribute is false
the fullscreen button is not displayed, this prevents the user from toggling between the view modes.
<dcbo-asset-player
assetid="36"
id="apw_bc1572"
showfullscreen="false">
</dcbo-asset-player>
Fullscreen
The view mode changes to fullscreen when the Fullscreen button is pressed. By default, the right-hand side overview tab is hidden but when pressing the Overview button it opens instead of navigating the user away from this view. By pressing the Fullscreen button again it returns to the widget view mode.
Commands accepted by the single asset player widget
The following JavaScript commands can be issued to interact with the widget embedded in your page. The commands are dependent on the ID of the player being stated as an attribute when embedding the widget. In the following list, replace the term ID OF WIDGET
with the actual ID of your widget.
Command | Description and response promise payload |
---|---|
DSDK.getCommandBus().send( |
This command changes the widget view. Possible values:
After the command is received, the promise is resolved with: {} |
DSDK.getCommandBus().send( |
Turns on fullscreen mode in the viewer. Tip: This command only works in the viewer view. When triggered the fullscreen mode activates. If the widget is in the viewer view, it returns: { Otherwise, it returns: { |
DSDK.getCommandBus().send( |
Turns off fullscreen mode in the viewer. Tip: This command only works in the viewer view. When triggered the fullscreen mode deactivates. After the command is received, the promise is resolved with: { |
DSDK.getCommandBus().send( |
If the learner is in the preview or viewer view, this command navigates the user to the overview view and returns: { If the initial view was already overview then no navigation happens and returns: { If the fullscreen mode is on, this command opens the overview on the right hand side. If it was originally closed it returns with: { Otherwise it returns with: { |
DSDK.getCommandBus().send( |
If the learner was in the overview, navigates the user back and returns: { Otherwise it returns: { If the fullscreen mode is active, and if the overview was already closed it returns: { Otherwise, the promise is resolved with: { |
DSDK.getCommandBus().send( |
Sets the volume level of a video player. The level value must be between If the level value is between { Otherwise, if the command payload level is outside of the limits or there is no video present it returns: { |
DSDK.getCommandBus().send( |
Mutes the video player if present and returns: { If no video is present returns: { |
DSDK.getCommandBus().send( |
Unmutes the video player, if present. In every case returns: { |
DSDK.getCommandBus().send( |
Starts playing the video asset, if present, and returns: { Otherwise returns: { |
DSDK.getCommandBus().send( |
Pauses playing the video asset, if present, and returns: { Otherwise returns: { |
Events generated by the asset player widget
Events are generated by the asset player widget usage, allowing you to listen to and monitor the behavior of the user during the navigation of the widget and the consumption of the asset with JavaScript to add extra functionality to your page.
To listen the to the events, embedded learning provides the proper listener, which is used as follows:
DSDK.getEventManager().on(
'event_name',
(e, p) => {console.log('Event Name => ', p)}
);
Tip: In the event listener, the following variables are used:
-
event_name
is the name of the event -
e
is a string that indicates the emitter ID -
p
is the payload which is an object that depends on the events
Event name | Description and payload |
---|---|
view_changed |
The View Changed event is triggered, when the widget changes view. Possible values for
Payload: { |
playback_started |
The Playback Started event is triggered when a video-typed asset stops playing. Payload: { |
playback_paused |
The Playback Paused event is triggered when a video-typed asset stops to play. Payload: { |
volume_level_changed |
The Volume Level Changed event is triggered when the video volume changes. Possible values for level: Payload: { |
asset_loaded |
The Asset Loaded event is triggered when an asset is loaded from the Docebo platform. Payload: { |
warning_shown |
The Warning Shown event is triggered when the asset has an error, either the user is authorized or the asset is not found. Possible values for
Payload: { |
widget_fullscreen |
The Fullscreen event is triggered when the fullscreen mode changes and the payload sends Payload: { |