Overview

We love our own APIs and make them available throughout our product - check them out here!

Our player “object” is available within our main annotations and can be used to perform a set of player methods. 

Cut to the Chase

To see this in action let’s take a look at a linked annotation.

Many of our annotations have a Link option within their individual annotation menu.  The Link configurations will execute when a viewer clicks that specific annotation.

Here, you can see that we have selected a “Custom time”, and inserted player.play()  into the Javascript text box.  Now, on-click of this annotation, the player will jump to 10 seconds, and resume (or start) playing.

To reproduce this action:

  1. Create a text annotation
  2. Click Edit
  3. Click Link
  4. Select Custom time
  5. Insert custom time into textbox (Ex.  00:05.0)
  6. Insert player.play() into the JavaScript text box
  7. Click Submit

Player Methods

player.play()                                        Play video

player.pause()                                     Pause video

player.paused                                     Get whether video is paused or not

player.currentTime                              Get current video time (unit: seconds)

player.currentTime = seconds            Jump to video time

player.duration                                    Get video duration (unit: seconds)

Our docs can be found here: http://www.hapyak.com/docs

Did this answer your question?