onMetaData
Description
 
This event occurs at time zero and provides general FLV information.
 
Note: Other software may also add this event. Captionate will add the event if it doesn't exist. If it is present, Captionate will preserve it and update the values it knows about and calculates.
 
Parameters
 
metadata (Object)
The metadata object has the following properties: Example AS1/AS2/AS3
client.onMetaData = function(metadata){

	trace('onMetaData event at '+ns.time);

	trace(' duration: '+metadata.duration+"\n"+
	      ' lasttimestamp: '+metadata.lasttimestamp+"\n"+
	      ' lastkeyframetimestamp: '+metadata.lastkeyframetimestamp+"\n"+
	      ' width: '+metadata.width+"\n"+
	      ' height: '+metadata.height+"\n"+
	      ' videodatarate: '+metadata.videodatarate+"\n"+
	      ' audiodatarate: '+metadata.audiodatarate+"\n"+
	      ' framerate: '+metadata.framerate+"\n"+
	      ' creationdate: '+metadata.creationdate+"\n"+
	      ' filesize: '+metadata.filesize+"\n"+
	      ' videosize: '+metadata.videosize+"\n"+
	      ' audiosize: '+metadata.audiosize+"\n"+
	      ' datasize: '+metadata.datasize+"\n"+
	      ' metadatacreator: '+metadata.metadatacreator+"\n"+
	      ' metadatadate: '+metadata.metadatadate
              );

	trace(' audiocodecid: '+metadata.audiocodecid+"\n"+
	      ' videocodecid: '+metadata.videocodecid+"\n"+
	      ' audiodelay: '+metadata.audiodelay+"\n"+
	      ' canseektoend: '+metadata.canSeekToEnd);
		  
		  
	if (metadata.cuePoints != undefined){
		trace(' cuePoints:');
		for (var n=0; n<metadata.cuePoints.length; n++) {
			var cp = metadata.cuePoints[n];
			trace('  '+cp.time+' "'+cp.name+'" ('+cp.type+')');
			if (cp.parameters != undefined) {
				trace('   parameters: ');
				for (paramName in cp.parameters) {
					trace('    "'+paramName+'" = "'+cp.parameters[paramName]+'"');
				}
			}
		}
	}
	

	if (metadata.custommetadata != undefined){
		trace(' custommetadata:');
		for (var paramName in metadata.custommetadata) {
			trace('  "'+paramName+'" = "'+metadata.custommetadata[paramName]+'"');
		}
	}
	
	if (metadata.keyframes != undefined){
		trace(' keyframes:');
		var fp=metadata.keyframes.filepositions;
		var ti=metadata.keyframes.times;
		for (n=0; n<fp.length; n++){
			trace('  fileposition: '+fp[n]+' time: '+ti[n]);
		}	
	}
}
Example 2 AS1/AS2/AS3
client.onMetaData = function(metadata){
	var level;	
	
	function levelStr(level){
		var s='';
		for (var n=0;n<level;n++){s=s+'  '};
		return(s);
	}
	
	function traceObject(x){
		level++;
		for (var y in x){
			var t=typeof(x[y]);
			switch (t) {
				case 'object':
					trace(levelStr(level)+y+'('+t+'): '+x[y]);
					traceObject(x[y]);
					break;
				default:
				    trace(levelStr(level)+y+'('+t+') = '+x[y]);					
					break;
			}
		}
		level--;
	}
	
	level=0;
	trace('onMetaData event at '+ns.time);	
	traceObject(metadata);
}
See also
 
Events Overview, onLastSecond, onCuePoint
 
Online URL for this page is http://www.buraks.com/captionate/help/en/index.html?p=e5.html