/** * Media Event object * @class econda.proxy.MediaEvent * @private */ econda.proxy.MediaEvent = function(cfg) { var cfg = cfg || {}; /** * Private properties collection * @property {Object} __p * @private */ var __p = { /** * @cfg {String} eventName Name of event */ eventName: null, /** * @cfg {String} contentLabel * Content label string */ contentLabel: null, /** * @cfg {String} [mediaType="video"] Type of media ("audio" or "video"} */ mediaType: 'video', /** * @cfg {Number} position Current position in media playback */ position: 0, /** * @cfg {Number} duration duration of media file */ duration: 0, /** * @cfg {Number} trackerId Id of tracker (unique per page) */ trackerId: 0, /** * @cfg {String} previewUri https uri to media file preview */ previewUri: null }; /** * Set eventName property * @method */ this.setEventName = function(eventName) { __p["eventName"] = eventName; return this; }; /** * Get eventName property * @method */ this.getEventName = function() { return __p["eventName"]; }; /** * Setter for content label * @method * @param {String} contentLabel */ this.setContentLabel = function(contentLabel) { __p["contentLabel"] = contentLabel; return this; }; /** * Getter for contentLabel * @method * @return {String} content label */ this.getContentLabel = function() { return __p["contentLabel"]; }; /** * Setter for mediaType * @method * @param {String} type */ this.setMediaType = function(type) { __p["mediaType"] = type; return this; }; /** * Getter for mediaType * @method * @return {String} */ this.getMediaType = function() { return __p["mediaType"]; }; /** * Setter for position * @method * @param {Number} currentPosition */ this.setPosition = function(currentPosition) { __p["position"] = currentPosition; return this; }; /** * Getter for current position * @method * @return {Number} */ this.getPosition = function(currentPosition) { return __p["position"]; }; /** * Setter for duration (length of video) * @method * @param {Number} duration */ this.setDuration = function(duration) { __p["duration"] = duration; return this; }; /** * Getter for duration * @method * @return {Number} media duration */ this.getDuration = function() { return __p["duration"]; }; /** * Setter for trackerId * @method * @param {Number} id */ this.setTrackerId = function(id) { __p["trackerId"] = id; return this; }; /** * Getter for trackerId * @return {Number} Id of tracker */ this.getTrackerId = function() { return __p["trackerId"]; }; /** * Setter for previewUri * @method * @param {String} uri HTTPS uri to video preview */ this.setPreviewUri = function(uri) { __p["previewUri"] = uri; return this; }; /** * Getter for previewUri * @method * @return {String} uri for preview */ this.getPreviewUri = function() { return __p["previewUri"]; }; /** * Returns a copy of this event * @method * @return {econda.proxy.MediaEvent} */ this.copy = function() { return obj = new econda.proxy.MediaEvent(__p); }; // Constructor return this.setup(cfg, __p); }; econda.proxy.MediaEvent.prototype = new econda.base.Object();