GET STARTED

Media Platform Runtime API (rtAPI) Documentation

rtAPI is a simple set of Javascript APIs that offers access to manipulate and track a gallery on client side.

Use the following set of rtAPI to preform :



Register to receive events

Register events :

Scenario 1 : when Cincopa's main lib - libasync.js already loaded


cincopa.registerEvent("cp_evt_mediaplay", "runtime.*");

function cp_evt_mediaplay(name, data, gallery) {
	if (name == "runtime.on-load-html") // make sure this event is runtime.on-load-html
		gallery.args.allow_search = "yes";
}


Scenarion 2 : If libasync.js is not loaded yet
var cincopa = cincopa || {};

cincopa.registeredFunctions = cincopa.registeredFunctions || [];
cincopa.registeredFunctions.push({
	func: function (name, data, gallery) {
		gallery.args.allow_search = "yes";
	}, filter: "runtime.on-load-html"
});

Debug mode


Enable debug mode from the console to see every event and debug data during libasync lifetime. Note that this mode is saved to a domain cookie so no need to do it every time.


cincopa.set_debug(true)

How to add lead generation form to a video

See the Pen How to add lead generation form to a video by oren (@cincopa) on CodePen.

How to add company logo to video control panel

See the Pen How to add company logo to video control panel by oren (@cincopa) on CodePen.

How to get video duration

See the Pen How to get video duration by oren (@cincopa) on CodePen.

How to add watermark to video

See the Pen How to add watermark to video by oren (@cincopa) on CodePen.

How to get progress while video is playing and video heatmap

See the Pen How to get progress while video is playing and video heatmap by oren (@cincopa) on CodePen.

How to add a pre roll and post roll to a video

See the Pen How to add a pre roll and post roll to a video by oren (@cincopa) on CodePen.

How to add sharing option to a video

See the Pen How to add sharing option to a video by oren (@cincopa) on CodePen.

Following is a list of all events available :

Following is a list of video events - video.*
All events in this namespace will send in the data parameter (2nd arg of the event) the following structure {item: {...this is the item from the medai JSON...}, version: {...rendition info...}}

Register to receive hooks

Hooks can be used to manipulate gallery at any given stage. List of hooks :



For example
	_cp_go_hooks["before-building-upper-panel"] = function(go) {
			go.args.allow_search = "yes";
			return "[this is a link]";
		};