/** * An event can be used to add information to media session like bandwidth changes, buffer * underruns, technical errors,... * @ignore * @markdown Example: // send an event of type "buffering" without additional information // ad playback position 43 sec. tracker.sendEvent("buffering", 43); // send an error event, something went wrong... tracker.sendEvent({ type: "error", value: "Could not initialize something..." }, 58); * @class econda.media.Event * @extends econda.base.Object */ econda.media.Event = function(cfg) { cfg = cfg || {}; /** * Private properties * @private * @property {Object} __p */ var __p = { /** * Type of event. Might be any string. * @cfg {String} [type="error"] */ type: 'error', /** * Additional information (message,...) * @cfg {String} value */ value: '' }; /** * Handle cfg as value for property with name * @property {String} __defaultProperty * @private */ this.__defaultProperty = "type"; /** * Set event Type * @method * @param {String} type */ this.setType = function(type) { __p["type"] = type; return this; }; /** * Get event type * @method * @return {String} */ this.getType = function() { return __p["type"]; }; /** * Add additional information * @method * @param {String} value new value */ this.setValue = function(value) { __p["value"] = value; return this; }; /** * Get current value * @method * @return {String} */ this.getValue = function() { return __p["value"]; }; // Constructor this.setup(cfg, __p); }; econda.media.Event.prototype = new econda.base.Object();