Adobe Learning Manager provides a library, which can be integrated into an app. This library provides various APIs to listen to events and trigger actions in the embedded player.
Using the APIs provided, you can play, pause, and perform other actions on the player.
Load the library
The library is available at this location.
To load the library, follow the steps below:
- Load the js file in the consumer application.
- On loading the library, window.cpPlayerLib will be populated.
Note: If you are not using prod US, set the params cpPlayerLib.env and cpPlayerLib.sourceOrigin based on your env.
The default values are:
- window.cpPlayerLib.env = https://learningmanager.adobe.com/app/player;
- window.cpPlayerLib.sourceOrigin = "https://cpcontents.adobe.com";
Methods available
The cpPlayerLib library consists of the following functions:
startPlayer
| Method name | startPlayer |
| Description | Loads a player in the app. |
| Parameters |
|
| Returns | Returns a promise. On resolution of the promise, a playerObj will be passed. |
| Exception | The promise will result in an exception. |
| Sample code | cpPlayerLib.startPlayer(loId, accountId, userId, accessToken, domRefId, onModuleLoaded).then((playerObj) => { //playerObj has the apis to interact with the player }) > |
getAllPlayers
| Method name | getAllPlayers |
| Description | Returns all player objects on the current page. |
| Parameters | None |
| Sample Code | cpPlayerLib.getAllPlayers() |
getPlayer
| Method name | getPlayer |
| Description | Returns a player object with the specified Learning Object id. |
| Parameters |
|
| Sample Code | cpPlayerLib.getPlayer(loId) |
navigateToModule
| Method name | navigateToModule |
| Description | Navigate to the next module. |
| Parameters |
|
| Sample Code | playerObj.navigateToModule (moduleID) |
next
| Method name | next |
| Description | Navigate to the next module. |
| Parameters | None |
| Sample Code | playerObj.next() |
previous
| Method name | previous |
| Description | Navigate to the previous module. |
| Parameters | None |
| Sample Code | playerObj.previous() |
toggleTOC
| Method name | toggleTOC |
| Description | Toggle the TOC panel on the player. |
| Parameters | None |
| Sample Code | playerObj.toggleTOC() |
toggleNotes
| Method name | toggleNotes |
| Description | Toggle the notes panel on the player. |
| Parameters | None |
| Sample Code | playerObj.toggleNotes() |
toggleClosedCaption
| Method name | toggleClosedCaption |
| Description | Toggle the display of closed captions on the player. |
| Parameters | None |
| Sample Code | playerObj.toggleClosedCaption() |
changeLanguage
| Method name | changeLanguage |
| Description | Change the content language on the player. |
| Parameters |
|
| Sample Code | playerObj.changeLanguage("es") |
closePlayer
| Method name | closePlayer |
| Description | Close the player and remove the player from the page. |
| Parameters | None |
| Sample Code | playerObj.closePlayer() |
togglePlayPause
| Method name | togglePlayPause |
| Description | Toggle between playing and pausing the content on the player. |
| Parameters | None |
| Sample Code | playerObj.togglePlayPause() |
setVolume
| Method name | setVolume |
| Description | Set the volume of the player. The value must be between 0 to 1. |
| Parameters |
|
| Sample Code | playerObj.setVolume(0.5) |
setPlayBackSpeed
| Method name | setPlayBackSpeed |
| Description | Set the speed of the playback in the player. |
| Parameters |
|
| Sample Code | playerObj.setPlayBackSpeed(1.25) |
seek
| Method name | seek |
| Description | Jump to any time on the video. |
| Parameters |
|
| Sample Code | playerObj.seek(50) |
forward
| Method name | forward |
| Description | Jump forward in the video by 10 seconds. |
| Parameters | None |
| Sample Code | playerObj.forward() |
backward
| Method name | backward |
| Description | Jump backward in the video by 10 seconds. |
| Parameters | None |
| Sample Code | playerObj.backward() |
navigateToPage
| Method name | navigateToPage |
| Description | Jump to the specified page on the PPT/PDF. |
| Parameters |
|
| Sample Code | playerObj.navigateToPage (5) |
nextPage
| Method name | nextPage |
| Description | Jump to the next page on the PPT/PDF. |
| Parameters | None |
| Sample Code | playerObj.nextPage() |
previousPage
| Method name | previousPage |
| Description | Jump to the previous page on the PPT/PDF. |
| Parameters | None |
| Sample Code | playerObj.previousPage() |
zoomIn
| Method name | zoomIn |
| Description | Zoom in on the content on a PPT/PDF. |
| Parameters | None |
| Sample Code | playerObj.zoomIn() |
zoomOut
| Method name | zoomOut |
| Description | Zoom out on the content on a PPT/PDF. |
| Parameters | None |
| Sample Code | playerObj.zoomOut() |
downloadJobAid
| Method name | downloadJobAid |
| Description | Download a Job Aid from a course. |
| Parameters | None |
| Sample Code | playerObj.downloadJobAid() |
toggleJobAidPullout
| Method name | toggleJobAidPullout |
| Description | Whether or not you want to download a job aid. |
| Parameters | None |
| Sample Code | playerObj.toggleJobAidPullout() |
fullScreen
| Method name | fullScreen |
| Description | Set player to full screen Mode. |
| Parameters | None |
| Sample Code | playerObj.fullScreen() |
List of events
onPlayerEvents(callBack)
On registering the callback function will be invoked on all player events. The event names are as follows:
PLAY (Video/ Audio/ CP)
PAUSE (Video/ Audio/ CP)
TIMEUPDATE (Video/ Audio/ CP)
PAGECHANGE (PPT/ PDF)
NOTEADDED (All contents)
LAUNCHED (All contents)
STARTED (All contents)
COMPLETED (All contents)
PASSED (All contents)
FAILED (All contents)
onStreamingEvents(callBack)
On registering the callback function will be invoked on all player statements that are sent for tracking user activity.