/
Quick Start

Quick Start

TouchCast Player API is a JavaScript library aimed to make it easier for 3rd-party developers to:

  • embed TouchCast players in a webpage programmatically and control them,
  • communicate with already embedded TouchCast players. 

Basic Setup

The TouchCast Player API for JavaScript doesn't have any standalone files that need to be downloaded or installed, instead you simply need to include a short piece of regular JavaScript in your HTML that will asynchronously load. The async load means that it does not block loading other elements of your webpage. The following snippet of code will give you the basic initialization of the Player API . You should insert it directly after the opening <body> tag on the webpage you want to load it:

window.tcPlayerApiAsyncInit = function() {
    // here the Player API is fully initialized, so it's safe to make any calls to it
};
(function (d, s, id) {
    var js, tjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) {
        return;
    }
    js = d.createElement(s);
    js.id = id;
    js.src = "//static.touchcast.com/master/player-api/player_api.js";
    tjs.parentNode.insertBefore(js, tjs);
}(document, 'script', 'touchcast-player-api'));



Related content

Tutorial 01 - Programmatically Embed a TouchCast Player and Control it
Tutorial 01 - Programmatically Embed a TouchCast Player and Control it
More like this
Player API
Player API
More like this
.embed()
.embed()
More like this
Tutorials
Tutorials
More like this
Tutorial 02 - Connect to an Embedded TouchCast Player
Tutorial 02 - Connect to an Embedded TouchCast Player
More like this
Home Developers
Home Developers
More like this