The Clipstream Player API: Introduction

The Clipstream Player API is a way for you to integrate the Clipstream player and Clipstream encoded content into your own web application or website. The Player API defines methods for you to customize, control and serve videos using Clipstream's underlying technology with minimal use of the Clipstream admin website or UI. 

Who this is for

The Player API is best employed by web developers who are seeking ways to control the player and content programmatically. The Player API is available for all plans. 

What you can control with the API

By consulting the methods documented in this section you'll be able to control playback, audio, access content, launch functions, show or hide UI and get detailed information on play status. 

How to get started

Read the articles in this section or browse the list of API methods below to find the function that meets your needs.

Player 3.82 API

Utilization

All functions can be called from the Clipstream player object.  The clipstream player object is accessed via an array at window.clipstream.players[].  The array is indexed by the position of the player within the page.  An event is available to notify you when the player objects are ready for use, more details are available on the Events documentation page.

Playback

Method Description
player.play(); Play or resume playing a video
player.play('40'); Play at the defined point in seconds ex. 40 seconds
player.play('50%'); Play at a percentage of total length ex 50% mark
player.pause(); Pause a currently playing video
player.enterFullscreen(); Toggle player full screen mode (true / false)

 

 

 

Audio

Method Description
player.setMute(true); Mute video
player.getMute(); Return mute state (true or false)
player.setVolume(40); Set volume by percentage ex. 40 per cent
player.getVolume(); Return volume level (0-100%)

 

 

 

Presentation

Method Description
player.hideall(); Hide all buttons
player.showonly('PRMZBb'); Show only defined buttons: (P = play, R = progress bar, M = audio, Z = full screen, B = center play button, b = buffering icon)
   

 

 

 

Metadata

Method Description
player.getName(); Return video name
player.getDuration(); Return current video duration in floating seconds
player.getPosition(); Return current video position

 

 

 

Events

Method Description
window.clipstream.onready = myfunc defines function to launch as soon as the player is completely loaded
player.setCallbackOnPlay( function() { } ); Set a defined function to be called back when the video begins playing
player.setCallbackOnStop(function() { } ); Set a defined function to be called back once the video stops
player.setCallback( play|pause|stop|mute|{sec}[/{sec_interval],  function () { ... } );   Set callback on defined events: play, pause, stop, mute, on second mark or seconds interval
player.setCallback( '15.000/10.000',(function() { } ); Set at defined second marks

 

 

 

 

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk