How to control playback via Clipstream Player API (play, pause, fullscreen)

You can directly control a Clipstream media object through Javascript.

Play (or resume playing if paused)

Start playing the video if stopped or paused.

Syntax:

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

example:

<a href="#" onClick="window.clipstream.players[0].play();">Click to play the first video</a>

Pause the video

Pause the video if it is playing.

Syntax:

window.clipstream.players[0].pause();" 

Example:

<a href="#" onClick="window.clipstream.players[0].pause();">Click to pause the first video</a>

Play from a specific time 

Play the video at a defined time in seconds.

Syntax: 

window.clipstream.players[0].play('sec')

Example:

<a href="#" onClick="window.clipstream.players[0].play('40');">Click to play from 40 second mark</a>

Play from a certain percentage of the total video

Start playing from a certain percentage point in the video. 

Syntax:

window.clipstream.players[0].play('percentage%');  

example:

<a href="#" onClick="window.clipstream.players[0].play('50%');">Click to play first video from halfway point</a>

Toggle fullscreen mode

Toggle the video to full screen and out of full screen (true / false).

Syntax:

window.clipstream.players[0].enterFullscreen(true);

Example:

<a href="#" onClick="window.clipstream.players[0].enterFullscreen(true);">Click to expand player to full screen</a>

<a href="#" onClick="window.clipstream.players[0].enterFullscreen(false);">Click to return player from full screen to normal</a>

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk