var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
/// <reference path="../../base/BaseClass.ts" />
/// <reference path="../../net/Uri.ts" />
var econda;
(function (econda) {
    var media;
    (function (media) {
        var transport;
        (function (transport) {
            var Uri = econda.net.Uri;
            /**
             * Media Event object. An econda.media.MediaTracker object creates MediaEvents that will be transfered by a transport implementation.
             * There's no reason to use this class directly.
             *
             * @class econda.media.transport.MediaEvent
             */
            var MediaEvent = (function (_super) {
                __extends(MediaEvent, _super);
                function MediaEvent(cfg) {
                    _super.call(this);
                    /**
                     * @cfg {String} eventName Name of event
                     * @accessor
                     */
                    this.eventName = null;
                    /**
                     * Content label string
                     * @cfg {String} contentLabel
                     * @accessor
                     */
                    this.contentLabel = null;
                    /**
                     * @cfg {String} [mediaType="video"] Type of media ("audio" or "video"}
                     * @accessor
                     */
                    this.mediaType = 'video';
                    /**
                     * @cfg {Number} position Current position in media playback
                     * @accessor
                     */
                    this.position = 0;
                    /**
                     * @cfg {Number} duration duration of media file
                     */
                    this.duration = 0;
                    /**
                     * @cfg {Number} trackerId Id of tracker (unique per page)
                     * @accessor
                     */
                    this.trackerId = 0;
                    /**
                     * @cfg {econda.net.Uri|String} previewUri https uri to media file preview
                     * @accessor
                     */
                    this.previewUri = null;
                    if (cfg instanceof MediaEvent) {
                        return cfg;
                    }
                    this.initConfig(cfg);
                }
                MediaEvent.prototype.getEventName = function () {
                    return this.eventName;
                };
                MediaEvent.prototype.setEventName = function (eventName) {
                    this.eventName = eventName;
                    return this;
                };
                MediaEvent.prototype.getContentLabel = function () {
                    return this.contentLabel;
                };
                MediaEvent.prototype.setContentLabel = function (contentLabel) {
                    this.contentLabel = contentLabel;
                    return this;
                };
                MediaEvent.prototype.getMediaType = function () {
                    return this.mediaType;
                };
                MediaEvent.prototype.setMediaType = function (type) {
                    this.mediaType = type;
                    return this;
                };
                MediaEvent.prototype.getPosition = function () {
                    return this.position;
                };
                MediaEvent.prototype.setPosition = function (currentPosition) {
                    this.position = currentPosition;
                    return this;
                };
                MediaEvent.prototype.getDuration = function () {
                    return this.duration;
                };
                MediaEvent.prototype.setDuration = function (duration) {
                    this.duration = duration;
                    return this;
                };
                MediaEvent.prototype.getTrackerId = function () {
                    return this.trackerId;
                };
                MediaEvent.prototype.setTrackerId = function (id) {
                    this.trackerId = id;
                    return this;
                };
                MediaEvent.prototype.getPreviewUri = function () {
                    return this.previewUri;
                };
                MediaEvent.prototype.setPreviewUri = function (uri) {
                    this.previewUri = new Uri(uri);
                };
                return MediaEvent;
            }(econda.base.BaseClass));
            transport.MediaEvent = MediaEvent;
        })(transport = media.transport || (media.transport = {}));
    })(media = econda.media || (econda.media = {}));
})(econda || (econda = {}));