Using the Player API (legacy)

Advanced player control is available via our Javascript API

Note: this documentation is for the legacy Viostream Player. For the current version, see the current documentation.

For more control, you can place the Player Embed API on the page and programmatically control embedding. First, you will need to obtain your Account Key by navigating to account management. Then place the following script in the <head> of your HTML document:

<script src="//"></script>

Replace VC-ACCOUNTKEY with your key. It is important you provide this, as many features will not work, or behave unpredictably without it.

This will add the $v.player.embed(publicKey [,target][,options]) function to your page.

Parameter Description
publicKey The public key of the Media Asset or Channel you wish to embed.
(optional if called from within body)
The id of the container (e.g. <div>) into which you wish to place the player. If you don’t provide an id, the embed code will attempt to add the player to page in place of the calling script. For example:

<br><div id="somebox"><br> <script> $v.player.embed('s0m3m3d14'); </script><br></div><br>
The player will render in <div id="somebox">. However, this will not work if the calling script is in the <head>, thus a target must be supplied in this case.
Player settings object. This can be used to specify the player key, and to override any of the supported player settings.

<br>{playerKey: 's-0m3p14y3r'}<br>

If the target is omitted, this can be the second argument. For example:

<br>$v.player.embed('s0m3m3d14', { playerKey:'s-0m3p14y3r' });<br>

<br>$v.player.embed('s0m3m3d14', 'myplayer', { playerKey:'s-0m3p14y3r' });<br>