Embedded Player interaction API documentation

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:

  1. Load the js file in the consumer application. 
  2. 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: 

Methods available

The cpPlayerLib library consists of the following functions:

startPlayer

Method name startPlayer
Description Loads a player in the app.
Parameters
  • loId : The Learning Object ID.
  • accountId : The Account ID of the ALM account.
  • userId : The User ID.
  • accessToken : The access token.
  • domRefId: The ID of the div container in which the player must be rendered.
  • onModuleLoaded: This function will be invoked when the modules with the below details are loaded.
    • contentType
    • loId
    • moduleId
    • completed
    • currentLanguage
    • availableLanguages
    • isCCAvailable
    • ccEnabled
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
  • loId : The Learning Object ID.
Sample Code cpPlayerLib.getPlayer(loId)

navigateToModule

Method name navigateToModule
Description Navigate to the next module.
Parameters
  • moduleId: The module ID.
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
  • language: The language code to be specified.
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
  • volume: The value of the volume. The valid range is 0-1. 
Sample Code playerObj.setVolume(0.5)

setPlayBackSpeed

Method name setPlayBackSpeed
Description Set the speed of the playback in the player. 
Parameters
  • speed: The value of the speed to be specified. Valid values are .25, .5, .75, 1, 1.25, 1.5, 1.75, 2.
Sample Code playerObj.setPlayBackSpeed(1.25)

seek

Method name seek
Description Jump to any time on the video.
Parameters
  • time: The time to jump to. The time is in seconds.
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
  • pageNumber: The page number to jump to.
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()

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.

 Adobe

Kapjon segítséget gyorsabban és könnyebben!

Új felhasználó?