Controlling the Player using Javascript

The following example code demonstrates how to stop/pause, play and seek players using Javascript. Certain functions do not work in all browser/player combinations.

Embed Code

<script type="text/javascript" src="http://embed.player.cdn.vioapi.com/v6/Embed.axd?playerid=e19481ee-3af4-487a-a38d-4406f88b0b24&mediaId=8b5585f8-1be2-4aca-b990-d0c455434396"> options = { ShowChooser: false, PlayerFormat: "Flash", PlayerWidth: 336, PlayerHeight: 189 } </script> <script type="text/javascript" src="http://embed.player.cdn.vioapi.com/v6/Embed.axd?playerid=e19481ee-3af4-487a-a38d-4406f88b0b24&mediaId=8b5585f8-1be2-4aca-b990-d0c455434396"> options = { ShowChooser: false, PlayerFormat: "Html5", PlayerWidth: 336, PlayerHeight: 189 } </script> <script type="text/javascript" src="http://embed.player.cdn.vioapi.com/v6/Embed.axd?playerid=e19481ee-3af4-487a-a38d-4406f88b0b24&mediaId=8b5585f8-1be2-4aca-b990-d0c455434396"> options = { ShowChooser: false, PlayerFormat: "Quicktime", PlayerWidth: 336, PlayerHeight: 189 } </script> <script type="text/javascript" src="http://embed.player.cdn.vioapi.com/v6/Embed.axd?playerid=e19481ee-3af4-487a-a38d-4406f88b0b24&mediaId=8b5585f8-1be2-4aca-b990-d0c455434396"> options = { ShowChooser: false, PlayerFormat: "WindowsMedia", PlayerWidth: 336, PlayerHeight: 189 } </script>

Control Code

<script type="text/javascript"> function pauseAll() { var players = $(Vio.Player.GetTargets()); players.each(function () { this.Pause() }); } function playAll() { var players = $(Vio.Player.GetTargets()); players.each(function () { this.Play() }); } function seekAll(time) { var players = $(Vio.Player.GetTargets()); players.each(function () { this.Seek(time) }); } </script>