
$f.addPlugin("captions", function(captions) {
	
	// first we generate cuepoint Array from captions
	var cuepoints = [];
	
	for (time in captions) {
	  cuepoints.push(parseInt(time));
	}
	
	// get handle to the content plugin. this plugin is required
	var content = this.getPlugin("content"); 
	
	// plugin was found
	if (content) {
		
		// register cuepoints and it's handler function
		this.onCuepoint(cuepoints, function(clip, time) {
				
			// this function simply updates content with given captions
			content.setHtml(captions[time]); 
		}); 
	}
	
	// return Player instance for fellow developers
	return this;
		
});

