chaperone.player.open ()

Opens the player when called.

chaperone.player.open()

chaperone.player.close ()

Closes the player when called.

chaperone.player.close()

chaperone.player.toggle ()

Opens the player if it is closed or closes it is opened.

chaperone.player.toggle()

chaperone.player.destroy ()

Completely removes the player from the Document Object Model. The method stops any active guide, removes any DOM element and listener added to the document.

chaperone.player.destroy()

chaperone.player.play ()

Launches the guide whose ID is specified as first parameter. It can also help you jump to an item whose ID is specified as second parameter.

chaperone.player.play(guide_id, item_id)

chaperone.player.stop ()

Stops a guide that is playing.

chaperone.player.stop()

chaperone.player.current ()

Returns an object including the playing guide ID and its item ID values.

chaperone.player.current() 

Return value

{guide_id: 12345,item_id: 6789}

chaperone.player.callback ()

Callback is set to run when there is specific event in the player. If the callback returns promise, execution flow will be interrupted until the promise is resolved.

chaperone.player.callback(‘onStepShow’, function (player, guide_id, item_id) {
// do something
})

Available callbacks are the following:

  • onInit (arguments: player): called right before the player is initialised.
  • onDestroy (arguments: player): called right before the player is destroyed.
  • onGuidePlay (arguments: player, guide_id): called right before a guide is played.
  • onGuideStop (arguments: player, guide_id): called right before a guide is stopped.
  • onItemShow (arguments: player, guide_id, item_id): called right before an item is shown.
  • onItemShown (arguments: player, guide_id, item_id): called right after an item is shown.
  • onItemHide (arguments: player, guide_id, item_id): called right before an item is hidden.
  • onItemHidden (arguments: player, guide_id, item_id): called right after an item is hidden.
  • onItemNext (arguments: player, guide_id, item_id): called right before the next item is shown.
  • onItemPrevious (arguments: player, guide_id, item_id): called right before the previous item is shown.
Did this answer your question?