Follow

Basic API Functionality: How do I integrate a call to the player?

A standard getEmbed call to the Liveclicker servers will instantiate a player on the current page, and cause the onLCPlayerLoaded function to be called. For example, the following very simple HTML adds a player to a page and calls the onLCPlayerLoaded function when it's ready:

<script type="text/javascript">
function onLCPlayerLoaded(player) {
alert("The player is loaded.");
}
</script>
 
<script type="text/javascript"
src="http://sv.liveclicker.net/service/getEmbed?client_id=19&widget_id=2051"></script>

The above example executes as the page on which it appears is being loaded. You can ensure that Liveclicker code will not affect page load times by using getEmbedOnload.js, to defer this execution until after the rest of the page has been loaded. This is the same example with using getEmbedOnload.js:

<script type="text/javascript">
function onLCPlayerLoaded(player) {
alert("The player is loaded.");
}
</script>
 
<script type="text/javascript"
src="http://edge.liveclicker.net/scripts/getEmbedOnload.js?client_id=19&widget_id=2051"></script>
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.