/*!
* MediaElement.js
* http://www.mediaelementjs.com/
*
* Wrapper that mimics native HTML5 MediaElement (audio and video)
* using a variety of technologies (pure JavaScript, Flash, iframe)
*
* Copyright 2010-2017, John Dyer (http://j.hn/)
* License: MIT
*
*/(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 1 && arguments[1] !== undefined ? arguments[1] : null;
if (typeof message === 'string' && message.length) {
var str = void 0,
pluralForm = void 0;
var language = i18n.language();
var _plural = function _plural(input, number, form) {
if ((typeof input === 'undefined' ? 'undefined' : _typeof(input)) !== 'object' || typeof number !== 'number' || typeof form !== 'number') {
return input;
}
var _pluralForms = function () {
return [function () {
return arguments.length <= 1 ? undefined : arguments[1];
}, function () {
return (arguments.length <= 0 ? undefined : arguments[0]) === 1 ? arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 2 ? undefined : arguments[2];
}, function () {
return (arguments.length <= 0 ? undefined : arguments[0]) === 0 || (arguments.length <= 0 ? undefined : arguments[0]) === 1 ? arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 2 ? undefined : arguments[2];
}, function () {
if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 !== 11) {
return arguments.length <= 1 ? undefined : arguments[1];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) !== 0) {
return arguments.length <= 2 ? undefined : arguments[2];
} else {
return arguments.length <= 3 ? undefined : arguments[3];
}
}, function () {
if ((arguments.length <= 0 ? undefined : arguments[0]) === 1 || (arguments.length <= 0 ? undefined : arguments[0]) === 11) {
return arguments.length <= 1 ? undefined : arguments[1];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2 || (arguments.length <= 0 ? undefined : arguments[0]) === 12) {
return arguments.length <= 2 ? undefined : arguments[2];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) > 2 && (arguments.length <= 0 ? undefined : arguments[0]) < 20) {
return arguments.length <= 3 ? undefined : arguments[3];
} else {
return arguments.length <= 4 ? undefined : arguments[4];
}
}, function () {
if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
return arguments.length <= 1 ? undefined : arguments[1];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) === 0 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 > 0 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 < 20) {
return arguments.length <= 2 ? undefined : arguments[2];
} else {
return arguments.length <= 3 ? undefined : arguments[3];
}
}, function () {
if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 !== 11) {
return arguments.length <= 1 ? undefined : arguments[1];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 >= 2 && ((arguments.length <= 0 ? undefined : arguments[0]) % 100 < 10 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 20)) {
return arguments.length <= 2 ? undefined : arguments[2];
} else {
return [3];
}
}, function () {
if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 !== 11) {
return arguments.length <= 1 ? undefined : arguments[1];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 >= 2 && (arguments.length <= 0 ? undefined : arguments[0]) % 10 <= 4 && ((arguments.length <= 0 ? undefined : arguments[0]) % 100 < 10 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 20)) {
return arguments.length <= 2 ? undefined : arguments[2];
} else {
return arguments.length <= 3 ? undefined : arguments[3];
}
}, function () {
if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
return arguments.length <= 1 ? undefined : arguments[1];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) >= 2 && (arguments.length <= 0 ? undefined : arguments[0]) <= 4) {
return arguments.length <= 2 ? undefined : arguments[2];
} else {
return arguments.length <= 3 ? undefined : arguments[3];
}
}, function () {
if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
return arguments.length <= 1 ? undefined : arguments[1];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 >= 2 && (arguments.length <= 0 ? undefined : arguments[0]) % 10 <= 4 && ((arguments.length <= 0 ? undefined : arguments[0]) % 100 < 10 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 20)) {
return arguments.length <= 2 ? undefined : arguments[2];
} else {
return arguments.length <= 3 ? undefined : arguments[3];
}
}, function () {
if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 === 1) {
return arguments.length <= 2 ? undefined : arguments[2];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 === 2) {
return arguments.length <= 3 ? undefined : arguments[3];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 === 3 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 === 4) {
return arguments.length <= 4 ? undefined : arguments[4];
} else {
return arguments.length <= 1 ? undefined : arguments[1];
}
}, function () {
if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
return arguments.length <= 1 ? undefined : arguments[1];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2) {
return arguments.length <= 2 ? undefined : arguments[2];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) > 2 && (arguments.length <= 0 ? undefined : arguments[0]) < 7) {
return arguments.length <= 3 ? undefined : arguments[3];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) > 6 && (arguments.length <= 0 ? undefined : arguments[0]) < 11) {
return arguments.length <= 4 ? undefined : arguments[4];
} else {
return arguments.length <= 5 ? undefined : arguments[5];
}
}, function () {
if ((arguments.length <= 0 ? undefined : arguments[0]) === 0) {
return arguments.length <= 1 ? undefined : arguments[1];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
return arguments.length <= 2 ? undefined : arguments[2];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2) {
return arguments.length <= 3 ? undefined : arguments[3];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 3 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 <= 10) {
return arguments.length <= 4 ? undefined : arguments[4];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 11) {
return arguments.length <= 5 ? undefined : arguments[5];
} else {
return arguments.length <= 6 ? undefined : arguments[6];
}
}, function () {
if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
return arguments.length <= 1 ? undefined : arguments[1];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) === 0 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 > 1 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 < 11) {
return arguments.length <= 2 ? undefined : arguments[2];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 > 10 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 < 20) {
return arguments.length <= 3 ? undefined : arguments[3];
} else {
return arguments.length <= 4 ? undefined : arguments[4];
}
}, function () {
if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1) {
return arguments.length <= 1 ? undefined : arguments[1];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 2) {
return arguments.length <= 2 ? undefined : arguments[2];
} else {
return arguments.length <= 3 ? undefined : arguments[3];
}
}, function () {
return (arguments.length <= 0 ? undefined : arguments[0]) !== 11 && (arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1 ? arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 2 ? undefined : arguments[2];
}, function () {
if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
return arguments.length <= 1 ? undefined : arguments[1];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 >= 2 && (arguments.length <= 0 ? undefined : arguments[0]) % 10 <= 4 && ((arguments.length <= 0 ? undefined : arguments[0]) % 100 < 10 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 20)) {
return arguments.length <= 2 ? undefined : arguments[2];
} else {
return arguments.length <= 3 ? undefined : arguments[3];
}
}, function () {
if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
return arguments.length <= 1 ? undefined : arguments[1];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2) {
return arguments.length <= 2 ? undefined : arguments[2];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) !== 8 && (arguments.length <= 0 ? undefined : arguments[0]) !== 11) {
return arguments.length <= 3 ? undefined : arguments[3];
} else {
return arguments.length <= 4 ? undefined : arguments[4];
}
}, function () {
return (arguments.length <= 0 ? undefined : arguments[0]) === 0 ? arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 2 ? undefined : arguments[2];
}, function () {
if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
return arguments.length <= 1 ? undefined : arguments[1];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2) {
return arguments.length <= 2 ? undefined : arguments[2];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) === 3) {
return arguments.length <= 3 ? undefined : arguments[3];
} else {
return arguments.length <= 4 ? undefined : arguments[4];
}
}, function () {
if ((arguments.length <= 0 ? undefined : arguments[0]) === 0) {
return arguments.length <= 1 ? undefined : arguments[1];
} else if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) {
return arguments.length <= 2 ? undefined : arguments[2];
} else {
return arguments.length <= 3 ? undefined : arguments[3];
}
}];
}();
return _pluralForms[form].apply(null, [number].concat(input));
};
if (i18n[language] !== undefined) {
str = i18n[language][message];
if (pluralParam !== null && typeof pluralParam === 'number') {
pluralForm = i18n[language]['mejs.plural-form'];
str = _plural.apply(null, [str, pluralParam, pluralForm]);
}
}
if (!str && i18n.en) {
str = i18n.en[message];
if (pluralParam !== null && typeof pluralParam === 'number') {
pluralForm = i18n.en['mejs.plural-form'];
str = _plural.apply(null, [str, pluralParam, pluralForm]);
}
}
str = str || message;
if (pluralParam !== null && typeof pluralParam === 'number') {
str = str.replace('%1', pluralParam);
}
return (0, _general.escapeHTML)(str);
}
return message;
};
_mejs2.default.i18n = i18n;
if (typeof mejsL10n !== 'undefined') {
_mejs2.default.i18n.language(mejsL10n.language, mejsL10n.strings);
}
exports.default = i18n;
},{"18":18,"7":7,"9":9}],6:[function(_dereq_,module,exports){
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _window = _dereq_(3);
var _window2 = _interopRequireDefault(_window);
var _document = _dereq_(2);
var _document2 = _interopRequireDefault(_document);
var _mejs = _dereq_(7);
var _mejs2 = _interopRequireDefault(_mejs);
var _general = _dereq_(18);
var _media2 = _dereq_(19);
var _renderer = _dereq_(8);
var _constants = _dereq_(16);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var MediaElement = function MediaElement(idOrNode, options, sources) {
var _this = this;
_classCallCheck(this, MediaElement);
var t = this;
sources = Array.isArray(sources) ? sources : null;
t.defaults = {
renderers: [],
fakeNodeName: 'mediaelementwrapper',
pluginPath: 'build/',
shimScriptAccess: 'sameDomain'
};
options = Object.assign(t.defaults, options);
t.mediaElement = _document2.default.createElement(options.fakeNodeName);
var id = idOrNode,
error = false;
if (typeof idOrNode === 'string') {
t.mediaElement.originalNode = _document2.default.getElementById(idOrNode);
} else {
t.mediaElement.originalNode = idOrNode;
id = idOrNode.id;
}
if (t.mediaElement.originalNode === undefined || t.mediaElement.originalNode === null) {
return null;
}
t.mediaElement.options = options;
id = id || 'mejs_' + Math.random().toString().slice(2);
t.mediaElement.originalNode.setAttribute('id', id + '_from_mejs');
var tagName = t.mediaElement.originalNode.tagName.toLowerCase();
if (['video', 'audio'].indexOf(tagName) > -1 && !t.mediaElement.originalNode.getAttribute('preload')) {
t.mediaElement.originalNode.setAttribute('preload', 'none');
}
t.mediaElement.originalNode.parentNode.insertBefore(t.mediaElement, t.mediaElement.originalNode);
t.mediaElement.appendChild(t.mediaElement.originalNode);
var processURL = function processURL(url, type) {
if (_window2.default.location.protocol === 'https:' && url.indexOf('http:') === 0 && _constants.IS_IOS && _mejs2.default.html5media.mediaTypes.indexOf(type) > -1) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (this.readyState === 4 && this.status === 200) {
var _url = _window2.default.URL || _window2.default.webkitURL,
blobUrl = _url.createObjectURL(this.response);
t.mediaElement.originalNode.setAttribute('src', blobUrl);
return blobUrl;
}
return url;
};
xhr.open('GET', url);
xhr.responseType = 'blob';
xhr.send();
}
return url;
};
var mediaFiles = void 0;
if (sources !== null) {
mediaFiles = sources;
} else if (t.mediaElement.originalNode !== null) {
mediaFiles = [];
switch (t.mediaElement.originalNode.nodeName.toLowerCase()) {
case 'iframe':
mediaFiles.push({
type: '',
src: t.mediaElement.originalNode.getAttribute('src')
});
break;
case 'audio':
case 'video':
var _sources = t.mediaElement.originalNode.children.length,
nodeSource = t.mediaElement.originalNode.getAttribute('src');
if (nodeSource) {
var node = t.mediaElement.originalNode,
type = (0, _media2.formatType)(nodeSource, node.getAttribute('type'));
mediaFiles.push({
type: type,
src: processURL(nodeSource, type)
});
}
for (var i = 0; i < _sources; i++) {
var n = t.mediaElement.originalNode.children[i];
if (n.tagName.toLowerCase() === 'source') {
var src = n.getAttribute('src'),
_type = (0, _media2.formatType)(src, n.getAttribute('type'));
mediaFiles.push({ type: _type, src: processURL(src, _type) });
}
}
break;
}
}
t.mediaElement.id = id;
t.mediaElement.renderers = {};
t.mediaElement.events = {};
t.mediaElement.promises = [];
t.mediaElement.renderer = null;
t.mediaElement.rendererName = null;
t.mediaElement.changeRenderer = function (rendererName, mediaFiles) {
var t = _this,
media = Object.keys(mediaFiles[0]).length > 2 ? mediaFiles[0] : mediaFiles[0].src;
if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null && t.mediaElement.renderer.name === rendererName) {
t.mediaElement.renderer.pause();
if (t.mediaElement.renderer.stop) {
t.mediaElement.renderer.stop();
}
t.mediaElement.renderer.show();
t.mediaElement.renderer.setSrc(media);
return true;
}
if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null) {
t.mediaElement.renderer.pause();
if (t.mediaElement.renderer.stop) {
t.mediaElement.renderer.stop();
}
t.mediaElement.renderer.hide();
}
var newRenderer = t.mediaElement.renderers[rendererName],
newRendererType = null;
if (newRenderer !== undefined && newRenderer !== null) {
newRenderer.show();
newRenderer.setSrc(media);
t.mediaElement.renderer = newRenderer;
t.mediaElement.rendererName = rendererName;
return true;
}
var rendererArray = t.mediaElement.options.renderers.length ? t.mediaElement.options.renderers : _renderer.renderer.order;
for (var _i = 0, total = rendererArray.length; _i < total; _i++) {
var index = rendererArray[_i];
if (index === rendererName) {
var rendererList = _renderer.renderer.renderers;
newRendererType = rendererList[index];
var renderOptions = Object.assign(newRendererType.options, t.mediaElement.options);
newRenderer = newRendererType.create(t.mediaElement, renderOptions, mediaFiles);
newRenderer.name = rendererName;
t.mediaElement.renderers[newRendererType.name] = newRenderer;
t.mediaElement.renderer = newRenderer;
t.mediaElement.rendererName = rendererName;
newRenderer.show();
return true;
}
}
return false;
};
t.mediaElement.setSize = function (width, height) {
if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null) {
t.mediaElement.renderer.setSize(width, height);
}
};
t.mediaElement.generateError = function (message, urlList) {
message = message || '';
urlList = Array.isArray(urlList) ? urlList : [];
var event = (0, _general.createEvent)('error', t.mediaElement);
event.message = message;
event.urls = urlList;
t.mediaElement.dispatchEvent(event);
error = true;
};
var props = _mejs2.default.html5media.properties,
methods = _mejs2.default.html5media.methods,
addProperty = function addProperty(obj, name, onGet, onSet) {
var oldValue = obj[name];
var getFn = function getFn() {
return onGet.apply(obj, [oldValue]);
},
setFn = function setFn(newValue) {
oldValue = onSet.apply(obj, [newValue]);
return oldValue;
};
Object.defineProperty(obj, name, {
get: getFn,
set: setFn
});
},
assignGettersSetters = function assignGettersSetters(propName) {
if (propName !== 'src') {
var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1),
getFn = function getFn() {
return t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null && typeof t.mediaElement.renderer['get' + capName] === 'function' ? t.mediaElement.renderer['get' + capName]() : null;
},
setFn = function setFn(value) {
if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null && typeof t.mediaElement.renderer['set' + capName] === 'function') {
t.mediaElement.renderer['set' + capName](value);
}
};
addProperty(t.mediaElement, propName, getFn, setFn);
t.mediaElement['get' + capName] = getFn;
t.mediaElement['set' + capName] = setFn;
}
},
getSrc = function getSrc() {
return t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null ? t.mediaElement.renderer.getSrc() : null;
},
setSrc = function setSrc(value) {
var mediaFiles = [];
if (typeof value === 'string') {
mediaFiles.push({
src: value,
type: value ? (0, _media2.getTypeFromFile)(value) : ''
});
} else if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src !== undefined) {
var _src = (0, _media2.absolutizeUrl)(value.src),
_type2 = value.type,
media = Object.assign(value, {
src: _src,
type: (_type2 === '' || _type2 === null || _type2 === undefined) && _src ? (0, _media2.getTypeFromFile)(_src) : _type2
});
mediaFiles.push(media);
} else if (Array.isArray(value)) {
for (var _i2 = 0, total = value.length; _i2 < total; _i2++) {
var _src2 = (0, _media2.absolutizeUrl)(value[_i2].src),
_type3 = value[_i2].type,
_media = Object.assign(value[_i2], {
src: _src2,
type: (_type3 === '' || _type3 === null || _type3 === undefined) && _src2 ? (0, _media2.getTypeFromFile)(_src2) : _type3
});
mediaFiles.push(_media);
}
}
var renderInfo = _renderer.renderer.select(mediaFiles, t.mediaElement.options.renderers.length ? t.mediaElement.options.renderers : []),
event = void 0;
if (!t.mediaElement.paused && !(t.mediaElement.src == null || t.mediaElement.src === '')) {
t.mediaElement.pause();
event = (0, _general.createEvent)('pause', t.mediaElement);
t.mediaElement.dispatchEvent(event);
}
t.mediaElement.originalNode.src = mediaFiles[0].src || '';
if (renderInfo === null && mediaFiles[0].src) {
t.mediaElement.generateError('No renderer found', mediaFiles);
return;
}
var shouldChangeRenderer = !(mediaFiles[0].src == null || mediaFiles[0].src === '');
return shouldChangeRenderer ? t.mediaElement.changeRenderer(renderInfo.rendererName, mediaFiles) : null;
},
triggerAction = function triggerAction(methodName, args) {
try {
if (methodName === 'play' && (t.mediaElement.rendererName === 'native_dash' || t.mediaElement.rendererName === 'native_hls' || t.mediaElement.rendererName === 'vimeo_iframe')) {
var response = t.mediaElement.renderer[methodName](args);
if (response && typeof response.then === 'function') {
response.catch(function () {
if (t.mediaElement.paused) {
setTimeout(function () {
var tmpResponse = t.mediaElement.renderer.play();
if (tmpResponse !== undefined) {
tmpResponse.catch(function () {
if (!t.mediaElement.renderer.paused) {
t.mediaElement.renderer.pause();
}
});
}
}, 150);
}
});
}
} else {
t.mediaElement.renderer[methodName](args);
}
} catch (e) {
t.mediaElement.generateError(e, mediaFiles);
}
},
assignMethods = function assignMethods(methodName) {
t.mediaElement[methodName] = function () {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null && typeof t.mediaElement.renderer[methodName] === 'function') {
if (t.mediaElement.promises.length) {
Promise.all(t.mediaElement.promises).then(function () {
triggerAction(methodName, args);
}).catch(function (e) {
t.mediaElement.generateError(e, mediaFiles);
});
} else {
triggerAction(methodName, args);
}
}
return null;
};
};
addProperty(t.mediaElement, 'src', getSrc, setSrc);
t.mediaElement.getSrc = getSrc;
t.mediaElement.setSrc = setSrc;
for (var _i3 = 0, total = props.length; _i3 < total; _i3++) {
assignGettersSetters(props[_i3]);
}
for (var _i4 = 0, _total = methods.length; _i4 < _total; _i4++) {
assignMethods(methods[_i4]);
}
t.mediaElement.addEventListener = function (eventName, callback) {
t.mediaElement.events[eventName] = t.mediaElement.events[eventName] || [];
t.mediaElement.events[eventName].push(callback);
};
t.mediaElement.removeEventListener = function (eventName, callback) {
if (!eventName) {
t.mediaElement.events = {};
return true;
}
var callbacks = t.mediaElement.events[eventName];
if (!callbacks) {
return true;
}
if (!callback) {
t.mediaElement.events[eventName] = [];
return true;
}
for (var _i5 = 0; _i5 < callbacks.length; _i5++) {
if (callbacks[_i5] === callback) {
t.mediaElement.events[eventName].splice(_i5, 1);
return true;
}
}
return false;
};
t.mediaElement.dispatchEvent = function (event) {
var callbacks = t.mediaElement.events[event.type];
if (callbacks) {
for (var _i6 = 0; _i6 < callbacks.length; _i6++) {
callbacks[_i6].apply(null, [event]);
}
}
};
t.mediaElement.destroy = function () {
var mediaElement = t.mediaElement.originalNode.cloneNode(true);
var wrapper = t.mediaElement.parentElement;
mediaElement.removeAttribute('id');
mediaElement.remove();
t.mediaElement.remove();
wrapper.appendChild(mediaElement);
};
if (mediaFiles.length) {
t.mediaElement.src = mediaFiles;
}
if (t.mediaElement.promises.length) {
Promise.all(t.mediaElement.promises).then(function () {
if (t.mediaElement.options.success) {
t.mediaElement.options.success(t.mediaElement, t.mediaElement.originalNode);
}
}).catch(function () {
if (error && t.mediaElement.options.error) {
t.mediaElement.options.error(t.mediaElement, t.mediaElement.originalNode);
}
});
} else {
if (t.mediaElement.options.success) {
t.mediaElement.options.success(t.mediaElement, t.mediaElement.originalNode);
}
if (error && t.mediaElement.options.error) {
t.mediaElement.options.error(t.mediaElement, t.mediaElement.originalNode);
}
}
return t.mediaElement;
};
_window2.default.MediaElement = MediaElement;
_mejs2.default.MediaElement = MediaElement;
exports.default = MediaElement;
},{"16":16,"18":18,"19":19,"2":2,"3":3,"7":7,"8":8}],7:[function(_dereq_,module,exports){
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _window = _dereq_(3);
var _window2 = _interopRequireDefault(_window);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var mejs = {};
mejs.version = '4.2.17';
mejs.html5media = {
properties: ['volume', 'src', 'currentTime', 'muted', 'duration', 'paused', 'ended', 'buffered', 'error', 'networkState', 'readyState', 'seeking', 'seekable', 'currentSrc', 'preload', 'bufferedBytes', 'bufferedTime', 'initialTime', 'startOffsetTime', 'defaultPlaybackRate', 'playbackRate', 'played', 'autoplay', 'loop', 'controls'],
readOnlyProperties: ['duration', 'paused', 'ended', 'buffered', 'error', 'networkState', 'readyState', 'seeking', 'seekable'],
methods: ['load', 'play', 'pause', 'canPlayType'],
events: ['loadstart', 'durationchange', 'loadedmetadata', 'loadeddata', 'progress', 'canplay', 'canplaythrough', 'suspend', 'abort', 'error', 'emptied', 'stalled', 'play', 'playing', 'pause', 'waiting', 'seeking', 'seeked', 'timeupdate', 'ended', 'ratechange', 'volumechange'],
mediaTypes: ['audio/mp3', 'audio/ogg', 'audio/oga', 'audio/wav', 'audio/x-wav', 'audio/wave', 'audio/x-pn-wav', 'audio/mpeg', 'audio/mp4', 'video/mp4', 'video/webm', 'video/ogg', 'video/ogv']
};
_window2.default.mejs = mejs;
exports.default = mejs;
},{"3":3}],8:[function(_dereq_,module,exports){
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.renderer = undefined;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _mejs = _dereq_(7);
var _mejs2 = _interopRequireDefault(_mejs);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Renderer = function () {
function Renderer() {
_classCallCheck(this, Renderer);
this.renderers = {};
this.order = [];
}
_createClass(Renderer, [{
key: 'add',
value: function add(renderer) {
if (renderer.name === undefined) {
throw new TypeError('renderer must contain at least `name` property');
}
this.renderers[renderer.name] = renderer;
this.order.push(renderer.name);
}
}, {
key: 'select',
value: function select(mediaFiles) {
var renderers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var renderersLength = renderers.length;
renderers = renderers.length ? renderers : this.order;
if (!renderersLength) {
var rendererIndicator = [/^(html5|native)/i, /^flash/i, /iframe$/i],
rendererRanking = function rendererRanking(renderer) {
for (var i = 0, total = rendererIndicator.length; i < total; i++) {
if (rendererIndicator[i].test(renderer)) {
return i;
}
}
return rendererIndicator.length;
};
renderers.sort(function (a, b) {
return rendererRanking(a) - rendererRanking(b);
});
}
for (var i = 0, total = renderers.length; i < total; i++) {
var key = renderers[i],
_renderer = this.renderers[key];
if (_renderer !== null && _renderer !== undefined) {
for (var j = 0, jl = mediaFiles.length; j < jl; j++) {
if (typeof _renderer.canPlayType === 'function' && typeof mediaFiles[j].type === 'string' && _renderer.canPlayType(mediaFiles[j].type)) {
return {
rendererName: _renderer.name,
src: mediaFiles[j].src
};
}
}
}
}
return null;
}
}, {
key: 'order',
set: function set(order) {
if (!Array.isArray(order)) {
throw new TypeError('order must be an array of strings.');
}
this._order = order;
},
get: function get() {
return this._order;
}
}, {
key: 'renderers',
set: function set(renderers) {
if (renderers !== null && (typeof renderers === 'undefined' ? 'undefined' : _typeof(renderers)) !== 'object') {
throw new TypeError('renderers must be an array of objects.');
}
this._renderers = renderers;
},
get: function get() {
return this._renderers;
}
}]);
return Renderer;
}();
var renderer = exports.renderer = new Renderer();
_mejs2.default.Renderers = renderer;
},{"7":7}],9:[function(_dereq_,module,exports){
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var EN = exports.EN = {
'mejs.plural-form': 1,
'mejs.download-file': 'Download File',
'mejs.install-flash': 'You are using a browser that does not have Flash player enabled or installed. Please turn on your Flash player plugin or download the latest version from https://get.adobe.com/flashplayer/',
'mejs.fullscreen': 'Fullscreen',
'mejs.play': 'Play',
'mejs.pause': 'Pause',
'mejs.time-slider': 'Time Slider',
'mejs.time-help-text': 'Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.',
'mejs.live-broadcast': 'Live Broadcast',
'mejs.volume-help-text': 'Use Up/Down Arrow keys to increase or decrease volume.',
'mejs.unmute': 'Unmute',
'mejs.mute': 'Mute',
'mejs.volume-slider': 'Volume Slider',
'mejs.video-player': 'Video Player',
'mejs.audio-player': 'Audio Player',
'mejs.captions-subtitles': 'Captions/Subtitles',
'mejs.captions-chapters': 'Chapters',
'mejs.none': 'None',
'mejs.afrikaans': 'Afrikaans',
'mejs.albanian': 'Albanian',
'mejs.arabic': 'Arabic',
'mejs.belarusian': 'Belarusian',
'mejs.bulgarian': 'Bulgarian',
'mejs.catalan': 'Catalan',
'mejs.chinese': 'Chinese',
'mejs.chinese-simplified': 'Chinese (Simplified)',
'mejs.chinese-traditional': 'Chinese (Traditional)',
'mejs.croatian': 'Croatian',
'mejs.czech': 'Czech',
'mejs.danish': 'Danish',
'mejs.dutch': 'Dutch',
'mejs.english': 'English',
'mejs.estonian': 'Estonian',
'mejs.filipino': 'Filipino',
'mejs.finnish': 'Finnish',
'mejs.french': 'French',
'mejs.galician': 'Galician',
'mejs.german': 'German',
'mejs.greek': 'Greek',
'mejs.haitian-creole': 'Haitian Creole',
'mejs.hebrew': 'Hebrew',
'mejs.hindi': 'Hindi',
'mejs.hungarian': 'Hungarian',
'mejs.icelandic': 'Icelandic',
'mejs.indonesian': 'Indonesian',
'mejs.irish': 'Irish',
'mejs.italian': 'Italian',
'mejs.japanese': 'Japanese',
'mejs.korean': 'Korean',
'mejs.latvian': 'Latvian',
'mejs.lithuanian': 'Lithuanian',
'mejs.macedonian': 'Macedonian',
'mejs.malay': 'Malay',
'mejs.maltese': 'Maltese',
'mejs.norwegian': 'Norwegian',
'mejs.persian': 'Persian',
'mejs.polish': 'Polish',
'mejs.portuguese': 'Portuguese',
'mejs.romanian': 'Romanian',
'mejs.russian': 'Russian',
'mejs.serbian': 'Serbian',
'mejs.slovak': 'Slovak',
'mejs.slovenian': 'Slovenian',
'mejs.spanish': 'Spanish',
'mejs.swahili': 'Swahili',
'mejs.swedish': 'Swedish',
'mejs.tagalog': 'Tagalog',
'mejs.thai': 'Thai',
'mejs.turkish': 'Turkish',
'mejs.ukrainian': 'Ukrainian',
'mejs.vietnamese': 'Vietnamese',
'mejs.welsh': 'Welsh',
'mejs.yiddish': 'Yiddish'
};
},{}],10:[function(_dereq_,module,exports){
'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _window = _dereq_(3);
var _window2 = _interopRequireDefault(_window);
var _mejs = _dereq_(7);
var _mejs2 = _interopRequireDefault(_mejs);
var _renderer = _dereq_(8);
var _general = _dereq_(18);
var _media = _dereq_(19);
var _constants = _dereq_(16);
var _dom = _dereq_(17);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var NativeDash = {
promise: null,
load: function load(settings) {
if (typeof dashjs !== 'undefined') {
NativeDash.promise = new Promise(function (resolve) {
resolve();
}).then(function () {
NativeDash._createPlayer(settings);
});
} else {
settings.options.path = typeof settings.options.path === 'string' ? settings.options.path : 'https://cdn.dashjs.org/latest/dash.all.min.js';
NativeDash.promise = NativeDash.promise || (0, _dom.loadScript)(settings.options.path);
NativeDash.promise.then(function () {
NativeDash._createPlayer(settings);
});
}
return NativeDash.promise;
},
_createPlayer: function _createPlayer(settings) {
var player = dashjs.MediaPlayer().create();
_window2.default['__ready__' + settings.id](player);
return player;
}
};
var DashNativeRenderer = {
name: 'native_dash',
options: {
prefix: 'native_dash',
dash: {
path: 'https://cdn.dashjs.org/latest/dash.all.min.js',
debug: false,
drm: {},
robustnessLevel: ''
}
},
canPlayType: function canPlayType(type) {
return _constants.HAS_MSE && ['application/dash+xml'].indexOf(type.toLowerCase()) > -1;
},
create: function create(mediaElement, options, mediaFiles) {
var originalNode = mediaElement.originalNode,
id = mediaElement.id + '_' + options.prefix,
autoplay = originalNode.autoplay,
children = originalNode.children;
var node = null,
dashPlayer = null;
originalNode.removeAttribute('type');
for (var i = 0, total = children.length; i < total; i++) {
children[i].removeAttribute('type');
}
node = originalNode.cloneNode(true);
options = Object.assign(options, mediaElement.options);
var props = _mejs2.default.html5media.properties,
events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']).filter(function (e) {
return e !== 'error';
}),
attachNativeEvents = function attachNativeEvents(e) {
var event = (0, _general.createEvent)(e.type, mediaElement);
mediaElement.dispatchEvent(event);
},
assignGettersSetters = function assignGettersSetters(propName) {
var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
node['get' + capName] = function () {
return dashPlayer !== null ? node[propName] : null;
};
node['set' + capName] = function (value) {
if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) {
if (propName === 'src') {
var source = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src ? value.src : value;
node[propName] = source;
if (dashPlayer !== null) {
dashPlayer.reset();
for (var _i = 0, _total = events.length; _i < _total; _i++) {
node.removeEventListener(events[_i], attachNativeEvents);
}
dashPlayer = NativeDash._createPlayer({
options: options.dash,
id: id
});
if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && _typeof(value.drm) === 'object') {
dashPlayer.setProtectionData(value.drm);
if ((0, _general.isString)(options.dash.robustnessLevel) && options.dash.robustnessLevel) {
dashPlayer.getProtectionController().setRobustnessLevel(options.dash.robustnessLevel);
}
}
dashPlayer.attachSource(source);
if (autoplay) {
dashPlayer.play();
}
}
} else {
node[propName] = value;
}
}
};
};
for (var _i2 = 0, _total2 = props.length; _i2 < _total2; _i2++) {
assignGettersSetters(props[_i2]);
}
_window2.default['__ready__' + id] = function (_dashPlayer) {
mediaElement.dashPlayer = dashPlayer = _dashPlayer;
var dashEvents = dashjs.MediaPlayer.events,
assignEvents = function assignEvents(eventName) {
if (eventName === 'loadedmetadata') {
dashPlayer.initialize();
dashPlayer.attachView(node);
dashPlayer.setAutoPlay(false);
if (_typeof(options.dash.drm) === 'object' && !_mejs2.default.Utils.isObjectEmpty(options.dash.drm)) {
dashPlayer.setProtectionData(options.dash.drm);
if ((0, _general.isString)(options.dash.robustnessLevel) && options.dash.robustnessLevel) {
dashPlayer.getProtectionController().setRobustnessLevel(options.dash.robustnessLevel);
}
}
dashPlayer.attachSource(node.getSrc());
}
node.addEventListener(eventName, attachNativeEvents);
};
for (var _i3 = 0, _total3 = events.length; _i3 < _total3; _i3++) {
assignEvents(events[_i3]);
}
var assignMdashEvents = function assignMdashEvents(e) {
if (e.type.toLowerCase() === 'error') {
mediaElement.generateError(e.message, node.src);
console.error(e);
} else {
var _event = (0, _general.createEvent)(e.type, mediaElement);
_event.data = e;
mediaElement.dispatchEvent(_event);
}
};
for (var eventType in dashEvents) {
if (dashEvents.hasOwnProperty(eventType)) {
dashPlayer.on(dashEvents[eventType], function (e) {
return assignMdashEvents(e);
});
}
}
};
if (mediaFiles && mediaFiles.length > 0) {
for (var _i4 = 0, _total4 = mediaFiles.length; _i4 < _total4; _i4++) {
if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[_i4].type)) {
node.setAttribute('src', mediaFiles[_i4].src);
if (typeof mediaFiles[_i4].drm !== 'undefined') {
options.dash.drm = mediaFiles[_i4].drm;
}
break;
}
}
}
node.setAttribute('id', id);
originalNode.parentNode.insertBefore(node, originalNode);
originalNode.autoplay = false;
originalNode.style.display = 'none';
node.setSize = function (width, height) {
node.style.width = width + 'px';
node.style.height = height + 'px';
return node;
};
node.hide = function () {
node.pause();
node.style.display = 'none';
return node;
};
node.show = function () {
node.style.display = '';
return node;
};
node.destroy = function () {
if (dashPlayer !== null) {
dashPlayer.reset();
}
};
var event = (0, _general.createEvent)('rendererready', node);
mediaElement.dispatchEvent(event);
mediaElement.promises.push(NativeDash.load({
options: options.dash,
id: id
}));
return node;
}
};
_media.typeChecks.push(function (url) {
return ~url.toLowerCase().indexOf('.mpd') ? 'application/dash+xml' : null;
});
_renderer.renderer.add(DashNativeRenderer);
},{"16":16,"17":17,"18":18,"19":19,"3":3,"7":7,"8":8}],11:[function(_dereq_,module,exports){
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PluginDetector = undefined;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _window = _dereq_(3);
var _window2 = _interopRequireDefault(_window);
var _document = _dereq_(2);
var _document2 = _interopRequireDefault(_document);
var _mejs = _dereq_(7);
var _mejs2 = _interopRequireDefault(_mejs);
var _i18n = _dereq_(5);
var _i18n2 = _interopRequireDefault(_i18n);
var _renderer = _dereq_(8);
var _general = _dereq_(18);
var _constants = _dereq_(16);
var _media = _dereq_(19);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var PluginDetector = exports.PluginDetector = {
plugins: [],
hasPluginVersion: function hasPluginVersion(plugin, v) {
var pv = PluginDetector.plugins[plugin];
v[1] = v[1] || 0;
v[2] = v[2] || 0;
return pv[0] > v[0] || pv[0] === v[0] && pv[1] > v[1] || pv[0] === v[0] && pv[1] === v[1] && pv[2] >= v[2];
},
addPlugin: function addPlugin(p, pluginName, mimeType, activeX, axDetect) {
PluginDetector.plugins[p] = PluginDetector.detectPlugin(pluginName, mimeType, activeX, axDetect);
},
detectPlugin: function detectPlugin(pluginName, mimeType, activeX, axDetect) {
var version = [0, 0, 0],
description = void 0,
ax = void 0;
if (_constants.NAV.plugins !== null && _constants.NAV.plugins !== undefined && _typeof(_constants.NAV.plugins[pluginName]) === 'object') {
description = _constants.NAV.plugins[pluginName].description;
if (description && !(typeof _constants.NAV.mimeTypes !== 'undefined' && _constants.NAV.mimeTypes[mimeType] && !_constants.NAV.mimeTypes[mimeType].enabledPlugin)) {
version = description.replace(pluginName, '').replace(/^\s+/, '').replace(/\sr/gi, '.').split('.');
for (var i = 0, total = version.length; i < total; i++) {
version[i] = parseInt(version[i].match(/\d+/), 10);
}
}
} else if (_window2.default.ActiveXObject !== undefined) {
try {
ax = new ActiveXObject(activeX);
if (ax) {
version = axDetect(ax);
}
} catch (e) {
}
}
return version;
}
};
PluginDetector.addPlugin('flash', 'Shockwave Flash', 'application/x-shockwave-flash', 'ShockwaveFlash.ShockwaveFlash', function (ax) {
var version = [],
d = ax.GetVariable("$version");
if (d) {
d = d.split(" ")[1].split(",");
version = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
}
return version;
});
var FlashMediaElementRenderer = {
create: function create(mediaElement, options, mediaFiles) {
var flash = {};
var isActive = false;
flash.options = options;
flash.id = mediaElement.id + '_' + flash.options.prefix;
flash.mediaElement = mediaElement;
flash.flashState = {};
flash.flashApi = null;
flash.flashApiStack = [];
var props = _mejs2.default.html5media.properties,
assignGettersSetters = function assignGettersSetters(propName) {
flash.flashState[propName] = null;
var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
flash['get' + capName] = function () {
if (flash.flashApi !== null) {
if (typeof flash.flashApi['get_' + propName] === 'function') {
var value = flash.flashApi['get_' + propName]();
if (propName === 'buffered') {
return {
start: function start() {
return 0;
},
end: function end() {
return value;
},
length: 1
};
}
return value;
} else {
return null;
}
} else {
return null;
}
};
flash['set' + capName] = function (value) {
if (propName === 'src') {
value = (0, _media.absolutizeUrl)(value);
}
if (flash.flashApi !== null && flash.flashApi['set_' + propName] !== undefined) {
try {
flash.flashApi['set_' + propName](value);
} catch (e) {
}
} else {
flash.flashApiStack.push({
type: 'set',
propName: propName,
value: value
});
}
};
};
for (var i = 0, total = props.length; i < total; i++) {
assignGettersSetters(props[i]);
}
var methods = _mejs2.default.html5media.methods,
assignMethods = function assignMethods(methodName) {
flash[methodName] = function () {
if (isActive) {
if (flash.flashApi !== null) {
if (flash.flashApi['fire_' + methodName]) {
try {
flash.flashApi['fire_' + methodName]();
} catch (e) {
}
} else {
}
} else {
flash.flashApiStack.push({
type: 'call',
methodName: methodName
});
}
}
};
};
methods.push('stop');
for (var _i = 0, _total = methods.length; _i < _total; _i++) {
assignMethods(methods[_i]);
}
var initEvents = ['rendererready'];
for (var _i2 = 0, _total2 = initEvents.length; _i2 < _total2; _i2++) {
var event = (0, _general.createEvent)(initEvents[_i2], flash);
mediaElement.dispatchEvent(event);
}
_window2.default['__ready__' + flash.id] = function () {
flash.flashReady = true;
flash.flashApi = _document2.default.getElementById('__' + flash.id);
if (flash.flashApiStack.length) {
for (var _i3 = 0, _total3 = flash.flashApiStack.length; _i3 < _total3; _i3++) {
var stackItem = flash.flashApiStack[_i3];
if (stackItem.type === 'set') {
var propName = stackItem.propName,
capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
flash['set' + capName](stackItem.value);
} else if (stackItem.type === 'call') {
flash[stackItem.methodName]();
}
}
}
};
_window2.default['__event__' + flash.id] = function (eventName, message) {
var event = (0, _general.createEvent)(eventName, flash);
if (message) {
try {
event.data = JSON.parse(message);
event.details.data = JSON.parse(message);
} catch (e) {
event.message = message;
}
}
flash.mediaElement.dispatchEvent(event);
};
flash.flashWrapper = _document2.default.createElement('div');
if (['always', 'sameDomain'].indexOf(flash.options.shimScriptAccess) === -1) {
flash.options.shimScriptAccess = 'sameDomain';
}
var autoplay = mediaElement.originalNode.autoplay,
flashVars = ['uid=' + flash.id, 'autoplay=' + autoplay, 'allowScriptAccess=' + flash.options.shimScriptAccess, 'preload=' + (mediaElement.originalNode.getAttribute('preload') || '')],
isVideo = mediaElement.originalNode !== null && mediaElement.originalNode.tagName.toLowerCase() === 'video',
flashHeight = isVideo ? mediaElement.originalNode.height : 1,
flashWidth = isVideo ? mediaElement.originalNode.width : 1;
if (mediaElement.originalNode.getAttribute('src')) {
flashVars.push('src=' + mediaElement.originalNode.getAttribute('src'));
}
if (flash.options.enablePseudoStreaming === true) {
flashVars.push('pseudostreamstart=' + flash.options.pseudoStreamingStartQueryParam);
flashVars.push('pseudostreamtype=' + flash.options.pseudoStreamingType);
}
if (flash.options.streamDelimiter) {
flashVars.push('streamdelimiter=' + encodeURIComponent(flash.options.streamDelimiter));
}
if (flash.options.proxyType) {
flashVars.push('proxytype=' + flash.options.proxyType);
}
mediaElement.appendChild(flash.flashWrapper);
mediaElement.originalNode.style.display = 'none';
var settings = [];
if (_constants.IS_IE || _constants.IS_EDGE) {
var specialIEContainer = _document2.default.createElement('div');
flash.flashWrapper.appendChild(specialIEContainer);
if (_constants.IS_EDGE) {
settings = ['type="application/x-shockwave-flash"', 'data="' + flash.options.pluginPath + flash.options.filename + '"', 'id="__' + flash.id + '"', 'width="' + flashWidth + '"', 'height="' + flashHeight + '\'"'];
} else {
settings = ['classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"', 'codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"', 'id="__' + flash.id + '"', 'width="' + flashWidth + '"', 'height="' + flashHeight + '"'];
}
if (!isVideo) {
settings.push('style="clip: rect(0 0 0 0); position: absolute;"');
}
specialIEContainer.outerHTML = '';
} else {
settings = ['id="__' + flash.id + '"', 'name="__' + flash.id + '"', 'play="true"', 'loop="false"', 'quality="high"', 'bgcolor="#000000"', 'wmode="transparent"', 'allowScriptAccess="' + flash.options.shimScriptAccess + '"', 'allowFullScreen="true"', 'type="application/x-shockwave-flash"', 'pluginspage="//www.macromedia.com/go/getflashplayer"', 'src="' + flash.options.pluginPath + flash.options.filename + '"', 'flashvars="' + flashVars.join('&') + '"'];
if (isVideo) {
settings.push('width="' + flashWidth + '"');
settings.push('height="' + flashHeight + '"');
} else {
settings.push('style="position: fixed; left: -9999em; top: -9999em;"');
}
flash.flashWrapper.innerHTML = '