How to get metadata by Clipstream Player API

You can acquire the player's current duration or position for purposes of reporting or other interactivity by using the following API methods.

Get the name of a video

Return the name(s) of videos on the page. The name is the same as the title of the video. 

Syntax:

window.clipstream.players[0].getName()

Example:

<a href="#" onClick="alert(player.getName());">Return name of video</a>

Get total duration

This returns the total duration of the video in seconds.

Syntax:

window.clipstream.players[0].getDuration()

Example:

<a href=""#" onClick="window.clipstream.players[0].getDuration();">Return duration of the third video on this page in seconds</a>

Get current position 

This returns the current position in the video in floating seconds.

Syntax:

window.clipstream.players[0].getPosition()

Example:

<a href=""#" onClick="window.clipstream.players[0].getPosition();">Return position of the first video in seconds</a>

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk