cloudinary-video-player 1.6.4-edge.2 → 1.7.0-edge.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ 1.7.0-edge.0 / 2021-11-15
2
+ ==================
3
+
4
+ Fixes:
5
+ -----
6
+ Fix some documentation mistakes
7
+
1
8
  1.6.4-edge.2 / 2021-10-27
2
9
  ==================
3
10
 
@@ -4525,7 +4525,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
4525
4525
  /***/ (function(module, exports, __webpack_require__) {
4526
4526
 
4527
4527
  "use strict";
4528
- eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nexports.CONSTRUCTOR_PARAMS = void 0;\n\nvar _cloudinaryCore = _interopRequireDefault(__webpack_require__(/*! cloudinary-core */ \"cloudinary-core\"));\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/video.es.js-exposed\"));\n\nvar _mixin2 = __webpack_require__(/*! utils/mixin */ \"./utils/mixin.js\");\n\nvar _applyWithProps = __webpack_require__(/*! utils/apply-with-props */ \"./utils/apply-with-props.js\");\n\nvar _slicing = __webpack_require__(/*! utils/slicing */ \"./utils/slicing.js\");\n\nvar _cloudinary = __webpack_require__(/*! utils/cloudinary */ \"./utils/cloudinary.js\");\n\nvar _assign = __webpack_require__(/*! utils/assign */ \"./utils/assign.js\");\n\nvar _common = __webpack_require__(/*! ./common */ \"./plugins/cloudinary/common.js\");\n\nvar _playlistable = _interopRequireDefault(__webpack_require__(/*! mixins/playlistable */ \"./mixins/playlistable.js\"));\n\nvar _videoSource = _interopRequireDefault(__webpack_require__(/*! ./models/video-source/video-source */ \"./plugins/cloudinary/models/video-source/video-source.js\"));\n\nvar _eventHandlerRegistry = _interopRequireDefault(__webpack_require__(/*! ./event-handler-registry */ \"./plugins/cloudinary/event-handler-registry.js\"));\n\nvar _audioSource = _interopRequireDefault(__webpack_require__(/*! ./models/audio-source/audio-source */ \"./plugins/cloudinary/models/audio-source/audio-source.js\"));\n\nvar _typeInference = __webpack_require__(/*! ../../utils/type-inference */ \"./utils/type-inference.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar DEFAULT_PARAMS = {\n transformation: {},\n sourceTypes: [],\n sourceTransformation: [],\n posterOptions: {}\n};\nvar CONSTRUCTOR_PARAMS = ['cloudinaryConfig', 'transformation', 'sourceTypes', 'sourceTransformation', 'posterOptions', 'autoShowRecommendations'];\nexports.CONSTRUCTOR_PARAMS = CONSTRUCTOR_PARAMS;\n\nvar CloudinaryContext = /*#__PURE__*/function (_mixin) {\n _inherits(CloudinaryContext, _mixin);\n\n var _super = _createSuper(CloudinaryContext);\n\n function CloudinaryContext(player) {\n var _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, CloudinaryContext);\n\n _this = _super.call(this, player, options);\n _this.player = player;\n options = (0, _assign.assign)({}, DEFAULT_PARAMS, options);\n var _source = null;\n var _sources = null;\n var _lastSource = null;\n var _lastPlaylist = null;\n var _posterOptions = null;\n var _cloudinaryConfig = null;\n var _transformation = null;\n var _sourceTypes = null;\n var _sourceTransformation = null;\n var _chainTarget = options.chainTarget;\n var _playerEvents = null;\n var _recommendations = null;\n var _autoShowRecommendations = false;\n\n _this.source = function (source) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n options = (0, _assign.assign)({}, options);\n\n if (!source) {\n return _source;\n }\n\n var src = null;\n\n if (source instanceof _videoSource.default) {\n src = source;\n } else {\n var _normalizeOptions = (0, _common.normalizeOptions)(source, options),\n publicId = _normalizeOptions.publicId,\n _options = _normalizeOptions.options;\n\n src = _this.buildSource(publicId, _options);\n }\n\n if (src.recommendations()) {\n var recommendations = src.recommendations();\n var itemBuilder = null;\n var disableAutoShow = false;\n\n if (options.recommendationOptions) {\n var _sliceAndUnsetPropert = (0, _slicing.sliceAndUnsetProperties)(options.recommendationOptions, 'disableAutoShow', 'itemBuilder');\n\n disableAutoShow = _sliceAndUnsetPropert.disableAutoShow;\n itemBuilder = _sliceAndUnsetPropert.itemBuilder;\n }\n\n setRecommendations(recommendations, {\n disableAutoShow: disableAutoShow,\n itemBuilder: itemBuilder\n });\n } else {\n unsetRecommendations();\n }\n\n _source = src;\n\n if (!options.skipRefresh) {\n refresh();\n }\n\n _this.player.trigger('cldsourcechanged', {\n source: src\n });\n\n return _chainTarget;\n };\n\n _this.buildSource = function (publicId) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var builtSrc = null;\n\n var _normalizeOptions2 = (0, _common.normalizeOptions)(publicId, options);\n\n publicId = _normalizeOptions2.publicId;\n options = _normalizeOptions2.options;\n options.cloudinaryConfig = (0, _common.mergeCloudinaryConfig)(_this.cloudinaryConfig(), options.cloudinaryConfig || {});\n options.transformation = (0, _common.mergeTransformation)(_this.transformation(), options.transformation || {});\n options.sourceTransformation = options.sourceTransformation || _this.sourceTransformation();\n options.sourceTypes = options.sourceTypes || _this.sourceTypes();\n options.poster = options.poster || posterOptionsForCurrent();\n options.queryParams = options.usageReport ? {\n _s: \"vp-\".concat(\"1.6.4-edge.2\")\n } : {};\n\n if (options.sourceTypes.indexOf('audio') > -1) {\n builtSrc = new _audioSource.default(publicId, options);\n } else {\n builtSrc = new _videoSource.default(publicId, options);\n }\n\n return builtSrc;\n };\n\n _this.posterOptions = function (options) {\n if (!options) {\n return _posterOptions;\n }\n\n _posterOptions = options;\n return _chainTarget;\n };\n\n _this.cloudinaryConfig = function (config) {\n if (!config) {\n return _cloudinaryConfig;\n }\n\n _cloudinaryConfig = (0, _cloudinary.getCloudinaryInstanceOf)(_cloudinaryCore.default.Cloudinary, config);\n return _chainTarget;\n };\n\n _this.transformation = function (trans) {\n if (!trans) {\n return _transformation;\n }\n\n _transformation = (0, _cloudinary.getCloudinaryInstanceOf)(_cloudinaryCore.default.Transformation, trans);\n return _chainTarget;\n };\n\n _this.sourceTypes = function (types) {\n if (!types) {\n return _sourceTypes;\n }\n\n _sourceTypes = types;\n return _chainTarget;\n };\n\n _this.getCurrentSources = function () {\n return _sources;\n };\n\n _this.sourceTransformation = function (trans) {\n if (!trans) {\n return _sourceTransformation;\n }\n\n _sourceTransformation = trans;\n return _chainTarget;\n };\n\n _this.on = function () {\n var _playerEvents2;\n\n return (_playerEvents2 = _playerEvents).on.apply(_playerEvents2, arguments);\n };\n\n _this.one = function () {\n var _playerEvents3;\n\n return (_playerEvents3 = _playerEvents).one.apply(_playerEvents3, arguments);\n };\n\n _this.off = function () {\n var _playerEvents4;\n\n return (_playerEvents4 = _playerEvents).off.apply(_playerEvents4, arguments);\n };\n\n _this.autoShowRecommendations = function (autoShow) {\n if (autoShow === undefined) {\n return _autoShowRecommendations;\n }\n\n _autoShowRecommendations = autoShow;\n return _chainTarget;\n };\n\n _this.dispose = function () {\n if (_this.playlist()) {\n _this.disposePlaylist();\n }\n\n unsetRecommendations();\n _source = undefined;\n\n _playerEvents.removeAllListeners();\n };\n\n var setRecommendations = function setRecommendations(recommendations, _ref) {\n var _ref$disableAutoShow = _ref.disableAutoShow,\n disableAutoShow = _ref$disableAutoShow === void 0 ? false : _ref$disableAutoShow,\n _ref$itemBuilder = _ref.itemBuilder,\n itemBuilder = _ref$itemBuilder === void 0 ? null : _ref$itemBuilder;\n unsetRecommendations();\n\n if (!Array.isArray(recommendations) && typeof recommendations !== 'function' && !recommendations.then) {\n throw new Error('\"recommendations\" must be either an array or a function');\n }\n\n _recommendations = {};\n\n itemBuilder = itemBuilder || function (source) {\n return {\n source: source instanceof _videoSource.default ? source : _this.buildSource(source),\n action: function action() {\n return _this.source(source);\n }\n };\n };\n\n _recommendations.sourceChangedHandler = function () {\n var trigger = function trigger(sources) {\n if (typeof sources !== 'undefined' && sources.length > 0) {\n var items = sources.map(function (_source) {\n return itemBuilder(_source);\n });\n\n _this.player.trigger('recommendationschanged', {\n items: items\n });\n } else {\n _this.player.trigger('recommendationsnoshow');\n }\n\n _recommendations.sources = sources;\n };\n\n if ((0, _typeInference.isFunction)(recommendations)) {\n trigger(recommendations());\n } else if (recommendations.then) {\n recommendations.then(trigger);\n } else {\n trigger(recommendations);\n }\n };\n\n _this.one('cldsourcechanged', _recommendations.sourceChangedHandler);\n\n _recommendations.endedHandler = function () {\n if (!disableAutoShow && _this.autoShowRecommendations()) {\n _this.player.trigger('recommendationsshow');\n }\n };\n\n _this.on('ended', _recommendations.endedHandler);\n };\n\n var unsetRecommendations = function unsetRecommendations() {\n if (_recommendations) {\n _this.off('cldsourcechanged', _recommendations.sourceChangedHandler);\n\n _this.off('ended', _recommendations.endedHandler);\n\n delete _recommendations.endedHandler;\n delete _recommendations.sourceChangedHandler;\n }\n\n _recommendations = null;\n };\n\n var refresh = function refresh() {\n var src = _this.source();\n\n if (src.poster()) {\n _this.player.poster(src.poster().url());\n }\n\n _sources = src.generateSources().reduce(function (srcs, src) {\n if (src.isAdaptive) {\n var codec = src.type.split('; ')[1] || null;\n\n if (codec && 'MediaSource' in window) {\n var parts = src.type.split('; ');\n var typeStr = \"video/mp4; \".concat(parts[1] || '');\n var canPlay = testCanPlayTypeAndTypeSupported(typeStr);\n\n if (_video.default.browser.IS_ANY_SAFARI) {\n // work around safari saying it cant play h265\n src.type = \"\".concat(parts[0], \"; \").concat((0, _common.codecShorthandTrans)('h264'));\n }\n\n if (canPlay) {\n srcs.push(src);\n }\n } else {\n srcs.push(src);\n }\n } else {\n srcs.push(src);\n }\n\n return srcs;\n }, []);\n\n _this.player.src(_sources);\n\n _lastSource = src;\n _lastPlaylist = _this.playlist();\n };\n\n var testCanPlayTypeAndTypeSupported = function testCanPlayTypeAndTypeSupported(codec) {\n var v = document.createElement('video');\n return v.canPlayType(codec) || 'MediaSource' in window && MediaSource.isTypeSupported(codec);\n };\n\n var posterOptionsForCurrent = function posterOptionsForCurrent() {\n var opts = (0, _assign.assign)({}, _this.posterOptions());\n\n if (opts.transformation) {\n if ((opts.transformation.width || opts.transformation.height) && !opts.transformation.crop) {\n opts.transformation.crop = 'scale';\n }\n }\n\n opts.transformation = (0, _cloudinary.getCloudinaryInstanceOf)(_cloudinaryCore.default.Transformation, opts.transformation || {}); // Set poster dimensions to player actual size.\n // (unless they were explicitly set via `posterOptions`)\n\n var playerEl = _this.player.el();\n\n if (playerEl && playerEl.clientWidth && playerEl.clientHeight && !(0, _cloudinary.isKeyInTransformation)(opts.transformation, 'width') && !(0, _cloudinary.isKeyInTransformation)(opts.transformation, 'height')) {\n var roundUp100 = function roundUp100(val) {\n return 100 * Math.ceil(val / 100);\n };\n\n opts.transformation.width(roundUp100(playerEl.clientWidth)).height(roundUp100(playerEl.clientHeight)).crop('limit');\n }\n\n return opts;\n }; // Handle external (non-cloudinary plugin) source changes (e.g. by ad plugins)\n\n\n var syncState = function syncState(_, data) {\n var src = data.to; // When source is cloudinary's\n\n if (_lastSource && _lastSource.contains(src)) {\n // If plugin state doesn't have an active VideoSource\n if (!_this.source()) {\n // We might have been running a playlist, reset playlist's state.\n if (_lastPlaylist) {\n _this.playlist(_lastPlaylist);\n } // Rebuild last source state without calling vjs's 'src' and 'poster'\n\n\n _this.source(_lastSource, {\n skipRefresh: true\n });\n }\n } else {\n // Used by cloudinary-only components\n _this.player.trigger('cldsourcechanged', {}); // When source isn't cloudinary's - reset the plugin's state.\n\n\n _this.dispose();\n }\n };\n\n _playerEvents = new _eventHandlerRegistry.default(_this.player);\n\n var constructorParams = _slicing.sliceAndUnsetProperties.apply(void 0, [options].concat(CONSTRUCTOR_PARAMS));\n\n (0, _applyWithProps.applyWithProps)(_assertThisInitialized(_this), constructorParams);\n\n _this.on('sourcechanged', syncState);\n\n return _this;\n }\n\n _createClass(CloudinaryContext, [{\n key: \"currentSourceType\",\n value: function currentSourceType() {\n return this.source().getType();\n }\n }, {\n key: \"currentPublicId\",\n value: function currentPublicId() {\n return this.source() && this.source().publicId();\n }\n }, {\n key: \"currentPoster\",\n value: function currentPoster() {\n return this.source() && this.source().poster();\n }\n }]);\n\n return CloudinaryContext;\n}((0, _mixin2.mixin)(_playlistable.default));\n\nfunction _default() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n options.chainTarget = options.chainTarget || this;\n this.cloudinary = new CloudinaryContext(this, options);\n}\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./plugins/cloudinary/index.js?");
4528
+ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nexports.CONSTRUCTOR_PARAMS = void 0;\n\nvar _cloudinaryCore = _interopRequireDefault(__webpack_require__(/*! cloudinary-core */ \"cloudinary-core\"));\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/video.es.js-exposed\"));\n\nvar _mixin2 = __webpack_require__(/*! utils/mixin */ \"./utils/mixin.js\");\n\nvar _applyWithProps = __webpack_require__(/*! utils/apply-with-props */ \"./utils/apply-with-props.js\");\n\nvar _slicing = __webpack_require__(/*! utils/slicing */ \"./utils/slicing.js\");\n\nvar _cloudinary = __webpack_require__(/*! utils/cloudinary */ \"./utils/cloudinary.js\");\n\nvar _assign = __webpack_require__(/*! utils/assign */ \"./utils/assign.js\");\n\nvar _common = __webpack_require__(/*! ./common */ \"./plugins/cloudinary/common.js\");\n\nvar _playlistable = _interopRequireDefault(__webpack_require__(/*! mixins/playlistable */ \"./mixins/playlistable.js\"));\n\nvar _videoSource = _interopRequireDefault(__webpack_require__(/*! ./models/video-source/video-source */ \"./plugins/cloudinary/models/video-source/video-source.js\"));\n\nvar _eventHandlerRegistry = _interopRequireDefault(__webpack_require__(/*! ./event-handler-registry */ \"./plugins/cloudinary/event-handler-registry.js\"));\n\nvar _audioSource = _interopRequireDefault(__webpack_require__(/*! ./models/audio-source/audio-source */ \"./plugins/cloudinary/models/audio-source/audio-source.js\"));\n\nvar _typeInference = __webpack_require__(/*! ../../utils/type-inference */ \"./utils/type-inference.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar DEFAULT_PARAMS = {\n transformation: {},\n sourceTypes: [],\n sourceTransformation: [],\n posterOptions: {}\n};\nvar CONSTRUCTOR_PARAMS = ['cloudinaryConfig', 'transformation', 'sourceTypes', 'sourceTransformation', 'posterOptions', 'autoShowRecommendations'];\nexports.CONSTRUCTOR_PARAMS = CONSTRUCTOR_PARAMS;\n\nvar CloudinaryContext = /*#__PURE__*/function (_mixin) {\n _inherits(CloudinaryContext, _mixin);\n\n var _super = _createSuper(CloudinaryContext);\n\n function CloudinaryContext(player) {\n var _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, CloudinaryContext);\n\n _this = _super.call(this, player, options);\n _this.player = player;\n options = (0, _assign.assign)({}, DEFAULT_PARAMS, options);\n var _source = null;\n var _sources = null;\n var _lastSource = null;\n var _lastPlaylist = null;\n var _posterOptions = null;\n var _cloudinaryConfig = null;\n var _transformation = null;\n var _sourceTypes = null;\n var _sourceTransformation = null;\n var _chainTarget = options.chainTarget;\n var _playerEvents = null;\n var _recommendations = null;\n var _autoShowRecommendations = false;\n\n _this.source = function (source) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n options = (0, _assign.assign)({}, options);\n\n if (!source) {\n return _source;\n }\n\n var src = null;\n\n if (source instanceof _videoSource.default) {\n src = source;\n } else {\n var _normalizeOptions = (0, _common.normalizeOptions)(source, options),\n publicId = _normalizeOptions.publicId,\n _options = _normalizeOptions.options;\n\n src = _this.buildSource(publicId, _options);\n }\n\n if (src.recommendations()) {\n var recommendations = src.recommendations();\n var itemBuilder = null;\n var disableAutoShow = false;\n\n if (options.recommendationOptions) {\n var _sliceAndUnsetPropert = (0, _slicing.sliceAndUnsetProperties)(options.recommendationOptions, 'disableAutoShow', 'itemBuilder');\n\n disableAutoShow = _sliceAndUnsetPropert.disableAutoShow;\n itemBuilder = _sliceAndUnsetPropert.itemBuilder;\n }\n\n setRecommendations(recommendations, {\n disableAutoShow: disableAutoShow,\n itemBuilder: itemBuilder\n });\n } else {\n unsetRecommendations();\n }\n\n _source = src;\n\n if (!options.skipRefresh) {\n refresh();\n }\n\n _this.player.trigger('cldsourcechanged', {\n source: src\n });\n\n return _chainTarget;\n };\n\n _this.buildSource = function (publicId) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var builtSrc = null;\n\n var _normalizeOptions2 = (0, _common.normalizeOptions)(publicId, options);\n\n publicId = _normalizeOptions2.publicId;\n options = _normalizeOptions2.options;\n options.cloudinaryConfig = (0, _common.mergeCloudinaryConfig)(_this.cloudinaryConfig(), options.cloudinaryConfig || {});\n options.transformation = (0, _common.mergeTransformation)(_this.transformation(), options.transformation || {});\n options.sourceTransformation = options.sourceTransformation || _this.sourceTransformation();\n options.sourceTypes = options.sourceTypes || _this.sourceTypes();\n options.poster = options.poster || posterOptionsForCurrent();\n options.queryParams = options.usageReport ? {\n _s: \"vp-\".concat(\"1.7.0-edge.0\")\n } : {};\n\n if (options.sourceTypes.indexOf('audio') > -1) {\n builtSrc = new _audioSource.default(publicId, options);\n } else {\n builtSrc = new _videoSource.default(publicId, options);\n }\n\n return builtSrc;\n };\n\n _this.posterOptions = function (options) {\n if (!options) {\n return _posterOptions;\n }\n\n _posterOptions = options;\n return _chainTarget;\n };\n\n _this.cloudinaryConfig = function (config) {\n if (!config) {\n return _cloudinaryConfig;\n }\n\n _cloudinaryConfig = (0, _cloudinary.getCloudinaryInstanceOf)(_cloudinaryCore.default.Cloudinary, config);\n return _chainTarget;\n };\n\n _this.transformation = function (trans) {\n if (!trans) {\n return _transformation;\n }\n\n _transformation = (0, _cloudinary.getCloudinaryInstanceOf)(_cloudinaryCore.default.Transformation, trans);\n return _chainTarget;\n };\n\n _this.sourceTypes = function (types) {\n if (!types) {\n return _sourceTypes;\n }\n\n _sourceTypes = types;\n return _chainTarget;\n };\n\n _this.getCurrentSources = function () {\n return _sources;\n };\n\n _this.sourceTransformation = function (trans) {\n if (!trans) {\n return _sourceTransformation;\n }\n\n _sourceTransformation = trans;\n return _chainTarget;\n };\n\n _this.on = function () {\n var _playerEvents2;\n\n return (_playerEvents2 = _playerEvents).on.apply(_playerEvents2, arguments);\n };\n\n _this.one = function () {\n var _playerEvents3;\n\n return (_playerEvents3 = _playerEvents).one.apply(_playerEvents3, arguments);\n };\n\n _this.off = function () {\n var _playerEvents4;\n\n return (_playerEvents4 = _playerEvents).off.apply(_playerEvents4, arguments);\n };\n\n _this.autoShowRecommendations = function (autoShow) {\n if (autoShow === undefined) {\n return _autoShowRecommendations;\n }\n\n _autoShowRecommendations = autoShow;\n return _chainTarget;\n };\n\n _this.dispose = function () {\n if (_this.playlist()) {\n _this.disposePlaylist();\n }\n\n unsetRecommendations();\n _source = undefined;\n\n _playerEvents.removeAllListeners();\n };\n\n var setRecommendations = function setRecommendations(recommendations, _ref) {\n var _ref$disableAutoShow = _ref.disableAutoShow,\n disableAutoShow = _ref$disableAutoShow === void 0 ? false : _ref$disableAutoShow,\n _ref$itemBuilder = _ref.itemBuilder,\n itemBuilder = _ref$itemBuilder === void 0 ? null : _ref$itemBuilder;\n unsetRecommendations();\n\n if (!Array.isArray(recommendations) && typeof recommendations !== 'function' && !recommendations.then) {\n throw new Error('\"recommendations\" must be either an array or a function');\n }\n\n _recommendations = {};\n\n itemBuilder = itemBuilder || function (source) {\n return {\n source: source instanceof _videoSource.default ? source : _this.buildSource(source),\n action: function action() {\n return _this.source(source);\n }\n };\n };\n\n _recommendations.sourceChangedHandler = function () {\n var trigger = function trigger(sources) {\n if (typeof sources !== 'undefined' && sources.length > 0) {\n var items = sources.map(function (_source) {\n return itemBuilder(_source);\n });\n\n _this.player.trigger('recommendationschanged', {\n items: items\n });\n } else {\n _this.player.trigger('recommendationsnoshow');\n }\n\n _recommendations.sources = sources;\n };\n\n if ((0, _typeInference.isFunction)(recommendations)) {\n trigger(recommendations());\n } else if (recommendations.then) {\n recommendations.then(trigger);\n } else {\n trigger(recommendations);\n }\n };\n\n _this.one('cldsourcechanged', _recommendations.sourceChangedHandler);\n\n _recommendations.endedHandler = function () {\n if (!disableAutoShow && _this.autoShowRecommendations()) {\n _this.player.trigger('recommendationsshow');\n }\n };\n\n _this.on('ended', _recommendations.endedHandler);\n };\n\n var unsetRecommendations = function unsetRecommendations() {\n if (_recommendations) {\n _this.off('cldsourcechanged', _recommendations.sourceChangedHandler);\n\n _this.off('ended', _recommendations.endedHandler);\n\n delete _recommendations.endedHandler;\n delete _recommendations.sourceChangedHandler;\n }\n\n _recommendations = null;\n };\n\n var refresh = function refresh() {\n var src = _this.source();\n\n if (src.poster()) {\n _this.player.poster(src.poster().url());\n }\n\n _sources = src.generateSources().reduce(function (srcs, src) {\n if (src.isAdaptive) {\n var codec = src.type.split('; ')[1] || null;\n\n if (codec && 'MediaSource' in window) {\n var parts = src.type.split('; ');\n var typeStr = \"video/mp4; \".concat(parts[1] || '');\n var canPlay = testCanPlayTypeAndTypeSupported(typeStr);\n\n if (_video.default.browser.IS_ANY_SAFARI) {\n // work around safari saying it cant play h265\n src.type = \"\".concat(parts[0], \"; \").concat((0, _common.codecShorthandTrans)('h264'));\n }\n\n if (canPlay) {\n srcs.push(src);\n }\n } else {\n srcs.push(src);\n }\n } else {\n srcs.push(src);\n }\n\n return srcs;\n }, []);\n\n _this.player.src(_sources);\n\n _lastSource = src;\n _lastPlaylist = _this.playlist();\n };\n\n var testCanPlayTypeAndTypeSupported = function testCanPlayTypeAndTypeSupported(codec) {\n var v = document.createElement('video');\n return v.canPlayType(codec) || 'MediaSource' in window && MediaSource.isTypeSupported(codec);\n };\n\n var posterOptionsForCurrent = function posterOptionsForCurrent() {\n var opts = (0, _assign.assign)({}, _this.posterOptions());\n\n if (opts.transformation) {\n if ((opts.transformation.width || opts.transformation.height) && !opts.transformation.crop) {\n opts.transformation.crop = 'scale';\n }\n }\n\n opts.transformation = (0, _cloudinary.getCloudinaryInstanceOf)(_cloudinaryCore.default.Transformation, opts.transformation || {}); // Set poster dimensions to player actual size.\n // (unless they were explicitly set via `posterOptions`)\n\n var playerEl = _this.player.el();\n\n if (playerEl && playerEl.clientWidth && playerEl.clientHeight && !(0, _cloudinary.isKeyInTransformation)(opts.transformation, 'width') && !(0, _cloudinary.isKeyInTransformation)(opts.transformation, 'height')) {\n var roundUp100 = function roundUp100(val) {\n return 100 * Math.ceil(val / 100);\n };\n\n opts.transformation.width(roundUp100(playerEl.clientWidth)).height(roundUp100(playerEl.clientHeight)).crop('limit');\n }\n\n return opts;\n }; // Handle external (non-cloudinary plugin) source changes (e.g. by ad plugins)\n\n\n var syncState = function syncState(_, data) {\n var src = data.to; // When source is cloudinary's\n\n if (_lastSource && _lastSource.contains(src)) {\n // If plugin state doesn't have an active VideoSource\n if (!_this.source()) {\n // We might have been running a playlist, reset playlist's state.\n if (_lastPlaylist) {\n _this.playlist(_lastPlaylist);\n } // Rebuild last source state without calling vjs's 'src' and 'poster'\n\n\n _this.source(_lastSource, {\n skipRefresh: true\n });\n }\n } else {\n // Used by cloudinary-only components\n _this.player.trigger('cldsourcechanged', {}); // When source isn't cloudinary's - reset the plugin's state.\n\n\n _this.dispose();\n }\n };\n\n _playerEvents = new _eventHandlerRegistry.default(_this.player);\n\n var constructorParams = _slicing.sliceAndUnsetProperties.apply(void 0, [options].concat(CONSTRUCTOR_PARAMS));\n\n (0, _applyWithProps.applyWithProps)(_assertThisInitialized(_this), constructorParams);\n\n _this.on('sourcechanged', syncState);\n\n return _this;\n }\n\n _createClass(CloudinaryContext, [{\n key: \"currentSourceType\",\n value: function currentSourceType() {\n return this.source().getType();\n }\n }, {\n key: \"currentPublicId\",\n value: function currentPublicId() {\n return this.source() && this.source().publicId();\n }\n }, {\n key: \"currentPoster\",\n value: function currentPoster() {\n return this.source() && this.source().poster();\n }\n }]);\n\n return CloudinaryContext;\n}((0, _mixin2.mixin)(_playlistable.default));\n\nfunction _default() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n options.chainTarget = options.chainTarget || this;\n this.cloudinary = new CloudinaryContext(this, options);\n}\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./plugins/cloudinary/index.js?");
4529
4529
 
4530
4530
  /***/ }),
4531
4531
 
@@ -4669,7 +4669,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
4669
4669
  /***/ (function(module, exports, __webpack_require__) {
4670
4670
 
4671
4671
  "use strict";
4672
- eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar contextMenuContent = function contextMenuContent(player) {\n var isLooping = player.loop();\n var isPaused = player.paused();\n var isMuted = player.muted();\n var isFullscreen = player.isFullscreen();\n var aboutMenuItem = {\n label: '<span class=\"player-version\">Cloudinary Player v' + \"1.6.4-edge.2\" + '</span>'\n };\n\n if (!player.controls()) {\n return [aboutMenuItem];\n }\n\n return [{\n label: isLooping ? 'Unloop' : 'Loop',\n listener: function listener() {\n player.loop(!isLooping);\n }\n }, {\n label: isPaused ? 'Play' : 'Pause',\n listener: function listener() {\n if (isPaused) {\n player.play();\n } else {\n player.pause();\n }\n }\n }, {\n label: isMuted ? 'Unmute' : 'Mute',\n listener: function listener() {\n player.muted(!isMuted);\n }\n }, {\n label: isFullscreen ? 'Exit Fullscreen' : 'Fullscreen',\n listener: function listener() {\n if (isFullscreen) {\n player.exitFullscreen();\n } else {\n player.requestFullscreen();\n }\n }\n }, aboutMenuItem];\n};\n\nvar _default = contextMenuContent;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./plugins/context-menu/contextMenuContent.js?");
4672
+ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar contextMenuContent = function contextMenuContent(player) {\n var isLooping = player.loop();\n var isPaused = player.paused();\n var isMuted = player.muted();\n var isFullscreen = player.isFullscreen();\n var aboutMenuItem = {\n label: '<span class=\"player-version\">Cloudinary Player v' + \"1.7.0-edge.0\" + '</span>'\n };\n\n if (!player.controls()) {\n return [aboutMenuItem];\n }\n\n return [{\n label: isLooping ? 'Unloop' : 'Loop',\n listener: function listener() {\n player.loop(!isLooping);\n }\n }, {\n label: isPaused ? 'Play' : 'Pause',\n listener: function listener() {\n if (isPaused) {\n player.play();\n } else {\n player.pause();\n }\n }\n }, {\n label: isMuted ? 'Unmute' : 'Mute',\n listener: function listener() {\n player.muted(!isMuted);\n }\n }, {\n label: isFullscreen ? 'Exit Fullscreen' : 'Fullscreen',\n listener: function listener() {\n if (isFullscreen) {\n player.exitFullscreen();\n } else {\n player.requestFullscreen();\n }\n }\n }, aboutMenuItem];\n};\n\nvar _default = contextMenuContent;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./plugins/context-menu/contextMenuContent.js?");
4673
4673
 
4674
4674
  /***/ }),
4675
4675
 
@@ -4729,7 +4729,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
4729
4729
  /***/ (function(module, exports, __webpack_require__) {
4730
4730
 
4731
4731
  "use strict";
4732
- eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _window = _interopRequireDefault(__webpack_require__(/*! global/window */ \"../node_modules/global/window.js\"));\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/video.es.js-exposed\"));\n\nvar _dashjs = _interopRequireDefault(__webpack_require__(/*! dashjs */ \"../node_modules/dashjs/build/es5/index.js\"));\n\nvar _setupAudioTracks = _interopRequireDefault(__webpack_require__(/*! ./setup-audio-tracks */ \"./plugins/dash/setup-audio-tracks.js\"));\n\nvar _setupTextTracks = _interopRequireDefault(__webpack_require__(/*! ./setup-text-tracks */ \"./plugins/dash/setup-text-tracks.js\"));\n\nvar _document = _interopRequireDefault(__webpack_require__(/*! global/document */ \"../node_modules/global/document.js\"));\n\nvar _assign = __webpack_require__(/*! ../../utils/assign */ \"./utils/assign.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * videojs-contrib-dash\n *\n * Use Dash.js to playback DASH content inside of Video.js via a SourceHandler\n */\nvar Html5DashJS = /*#__PURE__*/function () {\n function Html5DashJS(source, tech, options) {\n var _this = this;\n\n _classCallCheck(this, Html5DashJS);\n\n // Get options from tech if not provided for backwards compatibility\n options = options || tech.options_;\n this.player = (0, _video.default)(options.playerId);\n this.player.dash = this.player.dash || {};\n this.tech_ = tech;\n this.el_ = tech.el();\n this.elParent_ = this.el_.parentNode;\n this.hasFiniteDuration_ = false; // Do nothing if the src is falsey\n\n if (!source.src) {\n return;\n } // While the manifest is loading and Dash.js has not finished initializing\n // we must defer events and functions calls with isReady_ and then `triggerReady`\n // again later once everything is setup\n\n\n tech.isReady_ = false;\n\n if (Html5DashJS.updateSourceData) {\n _video.default.log.warn('updateSourceData has been deprecated.' + ' Please switch to using hook(\"updatesource\", callback).');\n\n source = Html5DashJS.updateSourceData(source);\n } // call updatesource hooks\n\n\n Html5DashJS.hooks('updatesource').forEach(function (hook) {\n source = hook(source);\n });\n var manifestSource = source.src;\n this.keySystemOptions_ = Html5DashJS.buildDashJSProtData(source.keySystemOptions); // eslint-disable-next-line new-cap\n\n this.player.dash.mediaPlayer = _dashjs.default.MediaPlayer().create();\n this.mediaPlayer_ = this.player.dash.mediaPlayer; // For whatever reason, we need to call setTextDefaultEnabled(false) to get\n // VTT captions to show, even though we're doing virtually the same thing\n // in setup-text-tracks.js\n\n this.mediaPlayer_.setTextDefaultEnabled(false); // Log MedaPlayer messages through video.js\n\n if (Html5DashJS.useVideoJSDebug) {\n _video.default.log.warn('useVideoJSDebug has been deprecated.' + ' Please switch to using hook(\"beforeinitialize\", callback).');\n\n Html5DashJS.useVideoJSDebug(this.mediaPlayer_);\n }\n\n if (Html5DashJS.beforeInitialize) {\n _video.default.log.warn('beforeInitialize has been deprecated.' + ' Please switch to using hook(\"beforeinitialize\", callback).');\n\n Html5DashJS.beforeInitialize(this.player, this.mediaPlayer_);\n }\n\n Html5DashJS.hooks('beforeinitialize').forEach(function (hook) {\n hook(_this.player, _this.mediaPlayer_);\n }); // Must run controller before these two lines or else there is no\n // element to bind to.\n\n this.mediaPlayer_.initialize(); // Retrigger a dash.js-specific error event as a player error\n // See src/streaming/utils/ErrorHandler.js in dash.js code\n // Handled with error (playback is stopped):\n // - capabilityError\n // - downloadError\n // - manifestError\n // - mediaSourceError\n // - mediaKeySessionError\n // Not handled:\n // - timedTextError (video can still play)\n // - mediaKeyMessageError (only fires under 'might not work' circumstances)\n // eslint-disable-next-line complexity\n\n this.retriggerError_ = function (event) {\n if (event.type === 'error') {\n /* initialize errros for ref https://cdn.dashjs.org/latest/jsdoc/core_errors_Errors.js.html\n map to general init error\n */\n if (event.error.code >= 10 && event.error.code <= 35) {\n _this.player.error({\n code: 4,\n dashjsErrorCode: event.error.code,\n message: event.error.message\n });\n } else if (event.error.code < 10) {\n // network errors\n _this.player.error({\n code: event.error.code,\n dashjsErrorCode: event.error.code,\n message: event.error.message\n });\n } else if (event.error.code >= 100 && event.error.code <= 114) {\n // Protection Errors https://cdn.dashjs.org/latest/jsdoc/streaming_protection_errors_ProtectionErrors.js.html\n _this.player.error({\n code: 5,\n dashjsErrorCode: event.error.code,\n message: event.error.message\n });\n } else {\n _this.player.error({\n code: event.error.code,\n message: event.error.message\n });\n }\n } // only reset the dash player in 10ms async, so that the rest of the\n // calling function finishes\n\n\n setTimeout(function () {\n _this.mediaPlayer_.reset();\n }, 10);\n };\n\n this.mediaPlayer_.on(_dashjs.default.MediaPlayer.events.ERROR, this.retriggerError_);\n\n this.getDuration_ = function (event) {\n var periods = event.data.Period_asArray;\n var oldHasFiniteDuration = _this.hasFiniteDuration_;\n\n if (event.data.mediaPresentationDuration || periods[periods.length - 1].duration) {\n _this.hasFiniteDuration_ = true;\n } else {\n // in case we run into a weird situation where we're VOD but then\n // switch to live\n _this.hasFiniteDuration_ = false;\n }\n\n if (_this.hasFiniteDuration_ !== oldHasFiniteDuration) {\n _this.player.trigger('durationchange');\n }\n };\n\n this.mediaPlayer_.on(_dashjs.default.MediaPlayer.events.MANIFEST_LOADED, this.getDuration_); // Apply all dash options that are set\n\n if (options.dash) {\n Object.keys(options.dash).forEach(function (key) {\n var _this$mediaPlayer_;\n\n var dashOptionsKey = 'set' + key.charAt(0).toUpperCase() + key.slice(1);\n var value = options.dash[key]; // eslint-disable-next-line no-prototype-builtins\n\n if (_this.mediaPlayer_.hasOwnProperty(dashOptionsKey)) {\n // Providing a key without `set` prefix is now deprecated.\n _video.default.log.warn('Using dash options in videojs-contrib-dash without the set prefix ' + \"has been deprecated. Change '\".concat(key, \"' to '\").concat(dashOptionsKey, \"'\")); // Set key so it will still work\n\n\n key = dashOptionsKey;\n } // eslint-disable-next-line no-prototype-builtins\n\n\n if (!_this.mediaPlayer_.hasOwnProperty(key)) {\n _video.default.log.warn(\"Warning: dash configuration option unrecognized: \".concat(key));\n\n return;\n } // Guarantee `value` is an array\n\n\n if (!Array.isArray(value)) {\n value = [value];\n }\n\n (_this$mediaPlayer_ = _this.mediaPlayer_)[key].apply(_this$mediaPlayer_, _toConsumableArray(value));\n });\n }\n\n this.mediaPlayer_.attachView(this.el_); // Dash.js autoplays by default, video.js will handle autoplay\n\n this.mediaPlayer_.setAutoPlay(false); // Setup audio tracks\n // eslint-disable-next-line no-useless-call\n\n _setupAudioTracks.default.call(null, this.player, tech); // Setup text tracks\n // eslint-disable-next-line no-useless-call\n\n\n _setupTextTracks.default.call(null, this.player, tech, options); // Attach the source with any protection data\n\n\n this.mediaPlayer_.setProtectionData(this.keySystemOptions_);\n this.mediaPlayer_.attachSource(manifestSource);\n this.tech_.triggerReady(); // map videojs seek\n\n this.player.on(this.tech_, 'seeking', function () {\n // handle seek the same way as in dash.js\n _this.mediaPlayer_.seek((_this.tech_.currentTime() - 8).toFixed(2));\n });\n }\n /*\n * Iterate over the `keySystemOptions` array and convert each object into\n * the type of object Dash.js expects in the `protData` argument.\n *\n * Also rename 'licenseUrl' property in the options to an 'serverURL' property\n */\n\n\n _createClass(Html5DashJS, [{\n key: \"dispose\",\n value: function dispose() {\n if (this.mediaPlayer_) {\n this.mediaPlayer_.off(_dashjs.default.MediaPlayer.events.ERROR, this.retriggerError_);\n this.mediaPlayer_.off(_dashjs.default.MediaPlayer.events.MANIFEST_LOADED, this.getDuration_);\n this.mediaPlayer_.reset();\n }\n\n if (this.player.dash) {\n delete this.player.dash;\n }\n }\n }, {\n key: \"duration\",\n value: function duration() {\n if (this.mediaPlayer_.isDynamic() && !this.hasFiniteDuration_) {\n return Infinity;\n }\n\n return this.mediaPlayer_.duration();\n }\n /**\n * Get a list of hooks for a specific lifecycle\n *\n * @param {string} type the lifecycle to get hooks from\n * @param {Function=|Function[]=} hook Optionally add a hook tothe lifecycle\n * @return {Array} an array of hooks or epty if none\n * @method hooks\n */\n\n }], [{\n key: \"buildDashJSProtData\",\n value: function buildDashJSProtData(keySystemOptions) {\n var output = {};\n\n if (!keySystemOptions || !Array.isArray(keySystemOptions)) {\n return null;\n }\n\n for (var i = 0; i < keySystemOptions.length; i++) {\n var keySystem = keySystemOptions[i];\n\n var options = _video.default.mergeOptions({}, keySystem.options);\n\n if (options.licenseUrl) {\n options.serverURL = options.licenseUrl;\n delete options.licenseUrl;\n }\n\n output[keySystem.name] = options;\n }\n\n return output;\n }\n }, {\n key: \"hooks\",\n value: function hooks(type, hook) {\n Html5DashJS.hooks_[type] = Html5DashJS.hooks_[type] || [];\n\n if (hook) {\n Html5DashJS.hooks_[type] = Html5DashJS.hooks_[type].concat(hook);\n }\n\n return Html5DashJS.hooks_[type];\n }\n /**\n * Add a function hook to a specific dash lifecycle\n *\n * @param {string} type the lifecycle to hook the function to\n * @param {Function|Function[]} hook the function or array of functions to attach\n * @method hook\n */\n\n }, {\n key: \"hook\",\n value: function hook(type, _hook) {\n Html5DashJS.hooks(type, _hook);\n }\n /**\n * Remove a hook from a specific dash lifecycle.\n *\n * @param {string} type the lifecycle that the function hooked to\n * @param {Function} hook The hooked function to remove\n * @return {boolean} True if the function was removed, false if not found\n * @method removeHook\n */\n\n }, {\n key: \"removeHook\",\n value: function removeHook(type, hook) {\n var index = Html5DashJS.hooks(type).indexOf(hook);\n\n if (index === -1) {\n return false;\n }\n\n Html5DashJS.hooks_[type] = Html5DashJS.hooks_[type].slice();\n Html5DashJS.hooks_[type].splice(index, 1);\n return true;\n }\n }]);\n\n return Html5DashJS;\n}();\n\nHtml5DashJS.hooks_ = {};\n\nvar canHandleKeySystems = function canHandleKeySystems(source) {\n // copy the source\n source = (0, _assign.assign)({}, source);\n\n if (Html5DashJS.updateSourceData) {\n _video.default.log.warn('updateSourceData has been deprecated.' + ' Please switch to using hook(\"updatesource\", callback).');\n\n source = Html5DashJS.updateSourceData(source);\n } // call updatesource hooks\n\n\n Html5DashJS.hooks('updatesource').forEach(function (hook) {\n source = hook(source);\n });\n\n var videoEl = _document.default.createElement('video');\n\n if (source.keySystemOptions && !(_window.default.navigator.requestMediaKeySystemAccess || // IE11 Win 8.1\n videoEl.msSetMediaKeys)) {\n return false;\n }\n\n return true;\n};\n\n_video.default.DashSourceHandler = function () {\n return {\n canHandleSource: function canHandleSource(source) {\n var dashExtRE = /\\.mpd/i;\n\n if (!canHandleKeySystems(source)) {\n return '';\n }\n\n if (_video.default.DashSourceHandler.canPlayType(source.type)) {\n return 'probably';\n } else if (dashExtRE.test(source.src)) {\n return 'maybe';\n }\n\n return '';\n },\n handleSource: function handleSource(source, tech, options) {\n return new Html5DashJS(source, tech, options);\n },\n canPlayType: function canPlayType(type) {\n return _video.default.DashSourceHandler.canPlayType(type);\n }\n };\n};\n\n_video.default.DashSourceHandler.canPlayType = function (type) {\n var dashTypeRE = /^application\\/dash\\+xml/i;\n\n if (dashTypeRE.test(type)) {\n return 'probably';\n }\n\n return '';\n}; // Only add the SourceHandler if the browser supports MediaSourceExtensions\n\n\nif (_window.default.MediaSource) {\n // eslint-disable-next-line new-cap\n _video.default.getTech('Html5').registerSourceHandler(_video.default.DashSourceHandler(), 0);\n}\n\n_video.default.Html5DashJS = Html5DashJS;\nvar _default = Html5DashJS;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./plugins/dash/videojs-dash.js?");
4732
+ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _window = _interopRequireDefault(__webpack_require__(/*! global/window */ \"../node_modules/global/window.js\"));\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/video.es.js-exposed\"));\n\nvar _dashjs = _interopRequireDefault(__webpack_require__(/*! dashjs */ \"../node_modules/dashjs/build/es5/index.js\"));\n\nvar _setupAudioTracks = _interopRequireDefault(__webpack_require__(/*! ./setup-audio-tracks */ \"./plugins/dash/setup-audio-tracks.js\"));\n\nvar _setupTextTracks = _interopRequireDefault(__webpack_require__(/*! ./setup-text-tracks */ \"./plugins/dash/setup-text-tracks.js\"));\n\nvar _document = _interopRequireDefault(__webpack_require__(/*! global/document */ \"../node_modules/global/document.js\"));\n\nvar _assign = __webpack_require__(/*! ../../utils/assign */ \"./utils/assign.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * videojs-contrib-dash\n *\n * Use Dash.js to playback DASH content inside of Video.js via a SourceHandler\n */\nvar Html5DashJS = /*#__PURE__*/function () {\n function Html5DashJS(source, tech, options) {\n var _this = this;\n\n _classCallCheck(this, Html5DashJS);\n\n // Get options from tech if not provided for backwards compatibility\n options = options || tech.options_;\n this.player = (0, _video.default)(options.playerId);\n this.player.dash = this.player.dash || {};\n this.tech_ = tech;\n this.el_ = tech.el();\n this.elParent_ = this.el_.parentNode;\n this.hasFiniteDuration_ = false; // Do nothing if the src is falsey\n\n if (!source.src) {\n return;\n } // While the manifest is loading and Dash.js has not finished initializing\n // we must defer events and functions calls with isReady_ and then `triggerReady`\n // again later once everything is setup\n\n\n tech.isReady_ = false;\n\n if (Html5DashJS.updateSourceData) {\n _video.default.log.warn('updateSourceData has been deprecated.' + ' Please switch to using hook(\"updatesource\", callback).');\n\n source = Html5DashJS.updateSourceData(source);\n } // call updatesource hooks\n\n\n Html5DashJS.hooks('updatesource').forEach(function (hook) {\n source = hook(source);\n });\n var manifestSource = source.src;\n this.keySystemOptions_ = Html5DashJS.buildDashJSProtData(source.keySystemOptions); // eslint-disable-next-line new-cap\n\n this.player.dash.mediaPlayer = _dashjs.default.MediaPlayer().create();\n this.mediaPlayer_ = this.player.dash.mediaPlayer; // For whatever reason, we need to call setTextDefaultEnabled(false) to get\n // VTT captions to show, even though we're doing virtually the same thing\n // in setup-text-tracks.js\n\n this.mediaPlayer_.setTextDefaultEnabled(false); // Log MedaPlayer messages through video.js\n\n if (Html5DashJS.useVideoJSDebug) {\n _video.default.log.warn('useVideoJSDebug has been deprecated.' + ' Please switch to using hook(\"beforeinitialize\", callback).');\n\n Html5DashJS.useVideoJSDebug(this.mediaPlayer_);\n }\n\n if (Html5DashJS.beforeInitialize) {\n _video.default.log.warn('beforeInitialize has been deprecated.' + ' Please switch to using hook(\"beforeinitialize\", callback).');\n\n Html5DashJS.beforeInitialize(this.player, this.mediaPlayer_);\n }\n\n Html5DashJS.hooks('beforeinitialize').forEach(function (hook) {\n hook(_this.player, _this.mediaPlayer_);\n }); // Must run controller before these two lines or else there is no\n // element to bind to.\n\n this.mediaPlayer_.initialize(); // Retrigger a dash.js-specific error event as a player error\n // See src/streaming/utils/ErrorHandler.js in dash.js code\n // Handled with error (playback is stopped):\n // - capabilityError\n // - downloadError\n // - manifestError\n // - mediaSourceError\n // - mediaKeySessionError\n // Not handled:\n // - timedTextError (video can still play)\n // - mediaKeyMessageError (only fires under 'might not work' circumstances)\n // eslint-disable-next-line complexity\n\n this.retriggerError_ = function (event) {\n if (event.type === 'error') {\n /* initialize errros for ref https://cdn.dashjs.org/latest/jsdoc/core_errors_Errors.js.html\n map to general init error\n */\n if (event.error.code >= 10 && event.error.code <= 35) {\n _this.player.error({\n code: 4,\n dashjsErrorCode: event.error.code,\n message: event.error.message\n });\n } else if (event.error.code < 10) {\n // network errors\n _this.player.error({\n code: event.error.code,\n dashjsErrorCode: event.error.code,\n message: event.error.message\n });\n } else if (event.error.code >= 100 && event.error.code <= 114) {\n // Protection Errors https://cdn.dashjs.org/latest/jsdoc/streaming_protection_errors_ProtectionErrors.js.html\n _this.player.error({\n code: 5,\n dashjsErrorCode: event.error.code,\n message: event.error.message\n });\n } else {\n _this.player.error({\n code: event.error.code,\n message: event.error.message\n });\n }\n } // only reset the dash player in 10ms async, so that the rest of the\n // calling function finishes\n\n\n setTimeout(function () {\n _this.mediaPlayer_.reset();\n }, 10);\n };\n\n this.mediaPlayer_.on(_dashjs.default.MediaPlayer.events.ERROR, this.retriggerError_);\n\n this.getDuration_ = function (event) {\n var periods = event.data.Period_asArray;\n var oldHasFiniteDuration = _this.hasFiniteDuration_;\n\n if (event.data.mediaPresentationDuration || periods[periods.length - 1].duration) {\n _this.hasFiniteDuration_ = true;\n } else {\n // in case we run into a weird situation where we're VOD but then\n // switch to live\n _this.hasFiniteDuration_ = false;\n }\n\n if (_this.hasFiniteDuration_ !== oldHasFiniteDuration) {\n _this.player.trigger('durationchange');\n }\n };\n\n this.mediaPlayer_.on(_dashjs.default.MediaPlayer.events.MANIFEST_LOADED, this.getDuration_); // Apply all dash options that are set\n\n if (options.dash) {\n Object.keys(options.dash).forEach(function (key) {\n var _this$mediaPlayer_;\n\n var dashOptionsKey = 'set' + key.charAt(0).toUpperCase() + key.slice(1);\n var value = options.dash[key]; // eslint-disable-next-line no-prototype-builtins\n\n if (_this.mediaPlayer_.hasOwnProperty(dashOptionsKey)) {\n // Providing a key without `set` prefix is now deprecated.\n _video.default.log.warn('Using dash options in videojs-contrib-dash without the set prefix ' + \"has been deprecated. Change '\".concat(key, \"' to '\").concat(dashOptionsKey, \"'\")); // Set key so it will still work\n\n\n key = dashOptionsKey;\n } // eslint-disable-next-line no-prototype-builtins\n\n\n if (!_this.mediaPlayer_.hasOwnProperty(key)) {\n _video.default.log.warn(\"Warning: dash configuration option unrecognized: \".concat(key));\n\n return;\n } // Guarantee `value` is an array\n\n\n if (!Array.isArray(value)) {\n value = [value];\n }\n\n (_this$mediaPlayer_ = _this.mediaPlayer_)[key].apply(_this$mediaPlayer_, _toConsumableArray(value));\n });\n }\n\n this.mediaPlayer_.attachView(this.el_); // Dash.js autoplays by default, video.js will handle autoplay\n\n this.mediaPlayer_.setAutoPlay(false); // Setup audio tracks\n // eslint-disable-next-line no-useless-call\n\n _setupAudioTracks.default.call(null, this.player, tech); // Setup text tracks\n // eslint-disable-next-line no-useless-call\n\n\n _setupTextTracks.default.call(null, this.player, tech, options); // Attach the source with any protection data\n\n\n this.mediaPlayer_.setProtectionData(this.keySystemOptions_);\n this.mediaPlayer_.attachSource(manifestSource);\n this.tech_.triggerReady(); // map videojs seek\n\n this.player.on(this.tech_, 'seeking', function () {\n // handle seek the same way as in dash.js\n _this.mediaPlayer_.seek((_this.tech_.currentTime() - 8).toFixed(2));\n });\n }\n /*\n * Iterate over the `keySystemOptions` array and convert each object into\n * the type of object Dash.js expects in the `protData` argument.\n *\n * Also rename 'licenseUrl' property in the options to an 'serverURL' property\n */\n\n\n _createClass(Html5DashJS, [{\n key: \"dispose\",\n value: function dispose() {\n if (this.mediaPlayer_) {\n this.mediaPlayer_.off(_dashjs.default.MediaPlayer.events.ERROR, this.retriggerError_);\n this.mediaPlayer_.off(_dashjs.default.MediaPlayer.events.MANIFEST_LOADED, this.getDuration_);\n this.mediaPlayer_.reset();\n }\n\n if (this.player.dash) {\n delete this.player.dash;\n }\n }\n }, {\n key: \"duration\",\n value: function duration() {\n if (this.mediaPlayer_.isDynamic() && !this.hasFiniteDuration_) {\n return Infinity;\n }\n\n return this.mediaPlayer_.duration();\n }\n /**\n * Get a list of hooks for a specific lifecycle\n *\n * @param {string} type the lifecycle to get hooks from\n * @param {Function=|Function[]=} hook Optionally add a hook tothe lifecycle\n * @return {Array} an array of hooks or epty if none\n * @method hooks\n */\n\n }], [{\n key: \"buildDashJSProtData\",\n value: function buildDashJSProtData(keySystemOptions) {\n var output = {};\n\n if (!keySystemOptions || !Array.isArray(keySystemOptions)) {\n return null;\n }\n\n for (var i = 0; i < keySystemOptions.length; i++) {\n var keySystem = keySystemOptions[i];\n\n var options = _video.default.mergeOptions({}, keySystem.options);\n\n if (options.licenseUrl) {\n options.serverURL = options.licenseUrl;\n delete options.licenseUrl;\n }\n\n output[keySystem.name] = options;\n }\n\n return output;\n }\n }, {\n key: \"hooks\",\n value: function hooks(type, hook) {\n Html5DashJS.hooks_[type] = Html5DashJS.hooks_[type] || [];\n\n if (hook) {\n Html5DashJS.hooks_[type] = Html5DashJS.hooks_[type].concat(hook);\n }\n\n return Html5DashJS.hooks_[type];\n }\n /**\n * Add a function hook to a specific dash lifecycle\n *\n * @param {string} type the lifecycle to hook the function to\n * @param {Function|Function[]} hook the function or array of functions to attach\n * @method hook\n */\n\n }, {\n key: \"hook\",\n value: function hook(type, _hook) {\n Html5DashJS.hooks(type, _hook);\n }\n /**\n * Remove a hook from a specific dash lifecycle.\n *\n * @param {string} type the lifecycle that the function hooked to\n * @param {Function} hook The hooked function to remove\n * @return {boolean} True if the function was removed, false if not found\n * @method removeHook\n */\n\n }, {\n key: \"removeHook\",\n value: function removeHook(type, hook) {\n var index = Html5DashJS.hooks(type).indexOf(hook);\n\n if (index === -1) {\n return false;\n }\n\n Html5DashJS.hooks_[type] = Html5DashJS.hooks_[type].slice();\n Html5DashJS.hooks_[type].splice(index, 1);\n return true;\n }\n }]);\n\n return Html5DashJS;\n}();\n\nHtml5DashJS.hooks_ = {};\n\nvar canHandleKeySystems = function canHandleKeySystems(source) {\n // copy the source\n source = JSON.parse(JSON.stringify(source));\n\n if (Html5DashJS.updateSourceData) {\n _video.default.log.warn('updateSourceData has been deprecated.' + ' Please switch to using hook(\"updatesource\", callback).');\n\n source = Html5DashJS.updateSourceData(source);\n } // call updatesource hooks\n\n\n Html5DashJS.hooks('updatesource').forEach(function (hook) {\n source = hook(source);\n });\n\n var videoEl = _document.default.createElement('video');\n\n if (source.keySystemOptions && !(_window.default.navigator.requestMediaKeySystemAccess || // IE11 Win 8.1\n videoEl.msSetMediaKeys)) {\n return false;\n }\n\n return true;\n};\n\n_video.default.DashSourceHandler = function () {\n return {\n canHandleSource: function canHandleSource(source) {\n var dashExtRE = /\\.mpd/i;\n\n if (!canHandleKeySystems(source)) {\n return '';\n }\n\n if (_video.default.DashSourceHandler.canPlayType(source.type)) {\n return 'probably';\n } else if (dashExtRE.test(source.src)) {\n return 'maybe';\n }\n\n return '';\n },\n handleSource: function handleSource(source, tech, options) {\n return new Html5DashJS(source, tech, options);\n },\n canPlayType: function canPlayType(type) {\n return _video.default.DashSourceHandler.canPlayType(type);\n }\n };\n};\n\n_video.default.DashSourceHandler.canPlayType = function (type) {\n var dashTypeRE = /^application\\/dash\\+xml/i;\n\n if (dashTypeRE.test(type)) {\n return 'probably';\n }\n\n return '';\n}; // Only add the SourceHandler if the browser supports MediaSourceExtensions\n\n\nif (_window.default.MediaSource) {\n // eslint-disable-next-line new-cap\n _video.default.getTech('Html5').registerSourceHandler(_video.default.DashSourceHandler(), 0);\n}\n\n_video.default.Html5DashJS = Html5DashJS;\nvar _default = Html5DashJS;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./plugins/dash/videojs-dash.js?");
4733
4733
 
4734
4734
  /***/ }),
4735
4735
 
@@ -828,7 +828,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
828
828
  /***/ (function(module, exports, __webpack_require__) {
829
829
 
830
830
  "use strict";
831
- eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nexports.CONSTRUCTOR_PARAMS = void 0;\n\nvar _cloudinaryCore = _interopRequireDefault(__webpack_require__(/*! cloudinary-core */ \"cloudinary-core\"));\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\nvar _mixin2 = __webpack_require__(/*! utils/mixin */ \"./utils/mixin.js\");\n\nvar _applyWithProps = __webpack_require__(/*! utils/apply-with-props */ \"./utils/apply-with-props.js\");\n\nvar _slicing = __webpack_require__(/*! utils/slicing */ \"./utils/slicing.js\");\n\nvar _cloudinary = __webpack_require__(/*! utils/cloudinary */ \"./utils/cloudinary.js\");\n\nvar _assign = __webpack_require__(/*! utils/assign */ \"./utils/assign.js\");\n\nvar _common = __webpack_require__(/*! ./common */ \"./plugins/cloudinary/common.js\");\n\nvar _playlistable = _interopRequireDefault(__webpack_require__(/*! mixins/playlistable */ \"./mixins/playlistable.js\"));\n\nvar _videoSource = _interopRequireDefault(__webpack_require__(/*! ./models/video-source/video-source */ \"./plugins/cloudinary/models/video-source/video-source.js\"));\n\nvar _eventHandlerRegistry = _interopRequireDefault(__webpack_require__(/*! ./event-handler-registry */ \"./plugins/cloudinary/event-handler-registry.js\"));\n\nvar _audioSource = _interopRequireDefault(__webpack_require__(/*! ./models/audio-source/audio-source */ \"./plugins/cloudinary/models/audio-source/audio-source.js\"));\n\nvar _typeInference = __webpack_require__(/*! ../../utils/type-inference */ \"./utils/type-inference.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar DEFAULT_PARAMS = {\n transformation: {},\n sourceTypes: [],\n sourceTransformation: [],\n posterOptions: {}\n};\nvar CONSTRUCTOR_PARAMS = ['cloudinaryConfig', 'transformation', 'sourceTypes', 'sourceTransformation', 'posterOptions', 'autoShowRecommendations'];\nexports.CONSTRUCTOR_PARAMS = CONSTRUCTOR_PARAMS;\n\nvar CloudinaryContext = /*#__PURE__*/function (_mixin) {\n _inherits(CloudinaryContext, _mixin);\n\n var _super = _createSuper(CloudinaryContext);\n\n function CloudinaryContext(player) {\n var _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, CloudinaryContext);\n\n _this = _super.call(this, player, options);\n _this.player = player;\n options = (0, _assign.assign)({}, DEFAULT_PARAMS, options);\n var _source = null;\n var _sources = null;\n var _lastSource = null;\n var _lastPlaylist = null;\n var _posterOptions = null;\n var _cloudinaryConfig = null;\n var _transformation = null;\n var _sourceTypes = null;\n var _sourceTransformation = null;\n var _chainTarget = options.chainTarget;\n var _playerEvents = null;\n var _recommendations = null;\n var _autoShowRecommendations = false;\n\n _this.source = function (source) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n options = (0, _assign.assign)({}, options);\n\n if (!source) {\n return _source;\n }\n\n var src = null;\n\n if (source instanceof _videoSource.default) {\n src = source;\n } else {\n var _normalizeOptions = (0, _common.normalizeOptions)(source, options),\n publicId = _normalizeOptions.publicId,\n _options = _normalizeOptions.options;\n\n src = _this.buildSource(publicId, _options);\n }\n\n if (src.recommendations()) {\n var recommendations = src.recommendations();\n var itemBuilder = null;\n var disableAutoShow = false;\n\n if (options.recommendationOptions) {\n var _sliceAndUnsetPropert = (0, _slicing.sliceAndUnsetProperties)(options.recommendationOptions, 'disableAutoShow', 'itemBuilder');\n\n disableAutoShow = _sliceAndUnsetPropert.disableAutoShow;\n itemBuilder = _sliceAndUnsetPropert.itemBuilder;\n }\n\n setRecommendations(recommendations, {\n disableAutoShow: disableAutoShow,\n itemBuilder: itemBuilder\n });\n } else {\n unsetRecommendations();\n }\n\n _source = src;\n\n if (!options.skipRefresh) {\n refresh();\n }\n\n _this.player.trigger('cldsourcechanged', {\n source: src\n });\n\n return _chainTarget;\n };\n\n _this.buildSource = function (publicId) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var builtSrc = null;\n\n var _normalizeOptions2 = (0, _common.normalizeOptions)(publicId, options);\n\n publicId = _normalizeOptions2.publicId;\n options = _normalizeOptions2.options;\n options.cloudinaryConfig = (0, _common.mergeCloudinaryConfig)(_this.cloudinaryConfig(), options.cloudinaryConfig || {});\n options.transformation = (0, _common.mergeTransformation)(_this.transformation(), options.transformation || {});\n options.sourceTransformation = options.sourceTransformation || _this.sourceTransformation();\n options.sourceTypes = options.sourceTypes || _this.sourceTypes();\n options.poster = options.poster || posterOptionsForCurrent();\n options.queryParams = options.usageReport ? {\n _s: \"vp-\".concat(\"1.6.4-edge.2\")\n } : {};\n\n if (options.sourceTypes.indexOf('audio') > -1) {\n builtSrc = new _audioSource.default(publicId, options);\n } else {\n builtSrc = new _videoSource.default(publicId, options);\n }\n\n return builtSrc;\n };\n\n _this.posterOptions = function (options) {\n if (!options) {\n return _posterOptions;\n }\n\n _posterOptions = options;\n return _chainTarget;\n };\n\n _this.cloudinaryConfig = function (config) {\n if (!config) {\n return _cloudinaryConfig;\n }\n\n _cloudinaryConfig = (0, _cloudinary.getCloudinaryInstanceOf)(_cloudinaryCore.default.Cloudinary, config);\n return _chainTarget;\n };\n\n _this.transformation = function (trans) {\n if (!trans) {\n return _transformation;\n }\n\n _transformation = (0, _cloudinary.getCloudinaryInstanceOf)(_cloudinaryCore.default.Transformation, trans);\n return _chainTarget;\n };\n\n _this.sourceTypes = function (types) {\n if (!types) {\n return _sourceTypes;\n }\n\n _sourceTypes = types;\n return _chainTarget;\n };\n\n _this.getCurrentSources = function () {\n return _sources;\n };\n\n _this.sourceTransformation = function (trans) {\n if (!trans) {\n return _sourceTransformation;\n }\n\n _sourceTransformation = trans;\n return _chainTarget;\n };\n\n _this.on = function () {\n var _playerEvents2;\n\n return (_playerEvents2 = _playerEvents).on.apply(_playerEvents2, arguments);\n };\n\n _this.one = function () {\n var _playerEvents3;\n\n return (_playerEvents3 = _playerEvents).one.apply(_playerEvents3, arguments);\n };\n\n _this.off = function () {\n var _playerEvents4;\n\n return (_playerEvents4 = _playerEvents).off.apply(_playerEvents4, arguments);\n };\n\n _this.autoShowRecommendations = function (autoShow) {\n if (autoShow === undefined) {\n return _autoShowRecommendations;\n }\n\n _autoShowRecommendations = autoShow;\n return _chainTarget;\n };\n\n _this.dispose = function () {\n if (_this.playlist()) {\n _this.disposePlaylist();\n }\n\n unsetRecommendations();\n _source = undefined;\n\n _playerEvents.removeAllListeners();\n };\n\n var setRecommendations = function setRecommendations(recommendations, _ref) {\n var _ref$disableAutoShow = _ref.disableAutoShow,\n disableAutoShow = _ref$disableAutoShow === void 0 ? false : _ref$disableAutoShow,\n _ref$itemBuilder = _ref.itemBuilder,\n itemBuilder = _ref$itemBuilder === void 0 ? null : _ref$itemBuilder;\n unsetRecommendations();\n\n if (!Array.isArray(recommendations) && typeof recommendations !== 'function' && !recommendations.then) {\n throw new Error('\"recommendations\" must be either an array or a function');\n }\n\n _recommendations = {};\n\n itemBuilder = itemBuilder || function (source) {\n return {\n source: source instanceof _videoSource.default ? source : _this.buildSource(source),\n action: function action() {\n return _this.source(source);\n }\n };\n };\n\n _recommendations.sourceChangedHandler = function () {\n var trigger = function trigger(sources) {\n if (typeof sources !== 'undefined' && sources.length > 0) {\n var items = sources.map(function (_source) {\n return itemBuilder(_source);\n });\n\n _this.player.trigger('recommendationschanged', {\n items: items\n });\n } else {\n _this.player.trigger('recommendationsnoshow');\n }\n\n _recommendations.sources = sources;\n };\n\n if ((0, _typeInference.isFunction)(recommendations)) {\n trigger(recommendations());\n } else if (recommendations.then) {\n recommendations.then(trigger);\n } else {\n trigger(recommendations);\n }\n };\n\n _this.one('cldsourcechanged', _recommendations.sourceChangedHandler);\n\n _recommendations.endedHandler = function () {\n if (!disableAutoShow && _this.autoShowRecommendations()) {\n _this.player.trigger('recommendationsshow');\n }\n };\n\n _this.on('ended', _recommendations.endedHandler);\n };\n\n var unsetRecommendations = function unsetRecommendations() {\n if (_recommendations) {\n _this.off('cldsourcechanged', _recommendations.sourceChangedHandler);\n\n _this.off('ended', _recommendations.endedHandler);\n\n delete _recommendations.endedHandler;\n delete _recommendations.sourceChangedHandler;\n }\n\n _recommendations = null;\n };\n\n var refresh = function refresh() {\n var src = _this.source();\n\n if (src.poster()) {\n _this.player.poster(src.poster().url());\n }\n\n _sources = src.generateSources().reduce(function (srcs, src) {\n if (src.isAdaptive) {\n var codec = src.type.split('; ')[1] || null;\n\n if (codec && 'MediaSource' in window) {\n var parts = src.type.split('; ');\n var typeStr = \"video/mp4; \".concat(parts[1] || '');\n var canPlay = testCanPlayTypeAndTypeSupported(typeStr);\n\n if (_video.default.browser.IS_ANY_SAFARI) {\n // work around safari saying it cant play h265\n src.type = \"\".concat(parts[0], \"; \").concat((0, _common.codecShorthandTrans)('h264'));\n }\n\n if (canPlay) {\n srcs.push(src);\n }\n } else {\n srcs.push(src);\n }\n } else {\n srcs.push(src);\n }\n\n return srcs;\n }, []);\n\n _this.player.src(_sources);\n\n _lastSource = src;\n _lastPlaylist = _this.playlist();\n };\n\n var testCanPlayTypeAndTypeSupported = function testCanPlayTypeAndTypeSupported(codec) {\n var v = document.createElement('video');\n return v.canPlayType(codec) || 'MediaSource' in window && MediaSource.isTypeSupported(codec);\n };\n\n var posterOptionsForCurrent = function posterOptionsForCurrent() {\n var opts = (0, _assign.assign)({}, _this.posterOptions());\n\n if (opts.transformation) {\n if ((opts.transformation.width || opts.transformation.height) && !opts.transformation.crop) {\n opts.transformation.crop = 'scale';\n }\n }\n\n opts.transformation = (0, _cloudinary.getCloudinaryInstanceOf)(_cloudinaryCore.default.Transformation, opts.transformation || {}); // Set poster dimensions to player actual size.\n // (unless they were explicitly set via `posterOptions`)\n\n var playerEl = _this.player.el();\n\n if (playerEl && playerEl.clientWidth && playerEl.clientHeight && !(0, _cloudinary.isKeyInTransformation)(opts.transformation, 'width') && !(0, _cloudinary.isKeyInTransformation)(opts.transformation, 'height')) {\n var roundUp100 = function roundUp100(val) {\n return 100 * Math.ceil(val / 100);\n };\n\n opts.transformation.width(roundUp100(playerEl.clientWidth)).height(roundUp100(playerEl.clientHeight)).crop('limit');\n }\n\n return opts;\n }; // Handle external (non-cloudinary plugin) source changes (e.g. by ad plugins)\n\n\n var syncState = function syncState(_, data) {\n var src = data.to; // When source is cloudinary's\n\n if (_lastSource && _lastSource.contains(src)) {\n // If plugin state doesn't have an active VideoSource\n if (!_this.source()) {\n // We might have been running a playlist, reset playlist's state.\n if (_lastPlaylist) {\n _this.playlist(_lastPlaylist);\n } // Rebuild last source state without calling vjs's 'src' and 'poster'\n\n\n _this.source(_lastSource, {\n skipRefresh: true\n });\n }\n } else {\n // Used by cloudinary-only components\n _this.player.trigger('cldsourcechanged', {}); // When source isn't cloudinary's - reset the plugin's state.\n\n\n _this.dispose();\n }\n };\n\n _playerEvents = new _eventHandlerRegistry.default(_this.player);\n\n var constructorParams = _slicing.sliceAndUnsetProperties.apply(void 0, [options].concat(CONSTRUCTOR_PARAMS));\n\n (0, _applyWithProps.applyWithProps)(_assertThisInitialized(_this), constructorParams);\n\n _this.on('sourcechanged', syncState);\n\n return _this;\n }\n\n _createClass(CloudinaryContext, [{\n key: \"currentSourceType\",\n value: function currentSourceType() {\n return this.source().getType();\n }\n }, {\n key: \"currentPublicId\",\n value: function currentPublicId() {\n return this.source() && this.source().publicId();\n }\n }, {\n key: \"currentPoster\",\n value: function currentPoster() {\n return this.source() && this.source().poster();\n }\n }]);\n\n return CloudinaryContext;\n}((0, _mixin2.mixin)(_playlistable.default));\n\nfunction _default() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n options.chainTarget = options.chainTarget || this;\n this.cloudinary = new CloudinaryContext(this, options);\n}\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./plugins/cloudinary/index.js?");
831
+ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nexports.CONSTRUCTOR_PARAMS = void 0;\n\nvar _cloudinaryCore = _interopRequireDefault(__webpack_require__(/*! cloudinary-core */ \"cloudinary-core\"));\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\nvar _mixin2 = __webpack_require__(/*! utils/mixin */ \"./utils/mixin.js\");\n\nvar _applyWithProps = __webpack_require__(/*! utils/apply-with-props */ \"./utils/apply-with-props.js\");\n\nvar _slicing = __webpack_require__(/*! utils/slicing */ \"./utils/slicing.js\");\n\nvar _cloudinary = __webpack_require__(/*! utils/cloudinary */ \"./utils/cloudinary.js\");\n\nvar _assign = __webpack_require__(/*! utils/assign */ \"./utils/assign.js\");\n\nvar _common = __webpack_require__(/*! ./common */ \"./plugins/cloudinary/common.js\");\n\nvar _playlistable = _interopRequireDefault(__webpack_require__(/*! mixins/playlistable */ \"./mixins/playlistable.js\"));\n\nvar _videoSource = _interopRequireDefault(__webpack_require__(/*! ./models/video-source/video-source */ \"./plugins/cloudinary/models/video-source/video-source.js\"));\n\nvar _eventHandlerRegistry = _interopRequireDefault(__webpack_require__(/*! ./event-handler-registry */ \"./plugins/cloudinary/event-handler-registry.js\"));\n\nvar _audioSource = _interopRequireDefault(__webpack_require__(/*! ./models/audio-source/audio-source */ \"./plugins/cloudinary/models/audio-source/audio-source.js\"));\n\nvar _typeInference = __webpack_require__(/*! ../../utils/type-inference */ \"./utils/type-inference.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar DEFAULT_PARAMS = {\n transformation: {},\n sourceTypes: [],\n sourceTransformation: [],\n posterOptions: {}\n};\nvar CONSTRUCTOR_PARAMS = ['cloudinaryConfig', 'transformation', 'sourceTypes', 'sourceTransformation', 'posterOptions', 'autoShowRecommendations'];\nexports.CONSTRUCTOR_PARAMS = CONSTRUCTOR_PARAMS;\n\nvar CloudinaryContext = /*#__PURE__*/function (_mixin) {\n _inherits(CloudinaryContext, _mixin);\n\n var _super = _createSuper(CloudinaryContext);\n\n function CloudinaryContext(player) {\n var _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, CloudinaryContext);\n\n _this = _super.call(this, player, options);\n _this.player = player;\n options = (0, _assign.assign)({}, DEFAULT_PARAMS, options);\n var _source = null;\n var _sources = null;\n var _lastSource = null;\n var _lastPlaylist = null;\n var _posterOptions = null;\n var _cloudinaryConfig = null;\n var _transformation = null;\n var _sourceTypes = null;\n var _sourceTransformation = null;\n var _chainTarget = options.chainTarget;\n var _playerEvents = null;\n var _recommendations = null;\n var _autoShowRecommendations = false;\n\n _this.source = function (source) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n options = (0, _assign.assign)({}, options);\n\n if (!source) {\n return _source;\n }\n\n var src = null;\n\n if (source instanceof _videoSource.default) {\n src = source;\n } else {\n var _normalizeOptions = (0, _common.normalizeOptions)(source, options),\n publicId = _normalizeOptions.publicId,\n _options = _normalizeOptions.options;\n\n src = _this.buildSource(publicId, _options);\n }\n\n if (src.recommendations()) {\n var recommendations = src.recommendations();\n var itemBuilder = null;\n var disableAutoShow = false;\n\n if (options.recommendationOptions) {\n var _sliceAndUnsetPropert = (0, _slicing.sliceAndUnsetProperties)(options.recommendationOptions, 'disableAutoShow', 'itemBuilder');\n\n disableAutoShow = _sliceAndUnsetPropert.disableAutoShow;\n itemBuilder = _sliceAndUnsetPropert.itemBuilder;\n }\n\n setRecommendations(recommendations, {\n disableAutoShow: disableAutoShow,\n itemBuilder: itemBuilder\n });\n } else {\n unsetRecommendations();\n }\n\n _source = src;\n\n if (!options.skipRefresh) {\n refresh();\n }\n\n _this.player.trigger('cldsourcechanged', {\n source: src\n });\n\n return _chainTarget;\n };\n\n _this.buildSource = function (publicId) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var builtSrc = null;\n\n var _normalizeOptions2 = (0, _common.normalizeOptions)(publicId, options);\n\n publicId = _normalizeOptions2.publicId;\n options = _normalizeOptions2.options;\n options.cloudinaryConfig = (0, _common.mergeCloudinaryConfig)(_this.cloudinaryConfig(), options.cloudinaryConfig || {});\n options.transformation = (0, _common.mergeTransformation)(_this.transformation(), options.transformation || {});\n options.sourceTransformation = options.sourceTransformation || _this.sourceTransformation();\n options.sourceTypes = options.sourceTypes || _this.sourceTypes();\n options.poster = options.poster || posterOptionsForCurrent();\n options.queryParams = options.usageReport ? {\n _s: \"vp-\".concat(\"1.7.0-edge.0\")\n } : {};\n\n if (options.sourceTypes.indexOf('audio') > -1) {\n builtSrc = new _audioSource.default(publicId, options);\n } else {\n builtSrc = new _videoSource.default(publicId, options);\n }\n\n return builtSrc;\n };\n\n _this.posterOptions = function (options) {\n if (!options) {\n return _posterOptions;\n }\n\n _posterOptions = options;\n return _chainTarget;\n };\n\n _this.cloudinaryConfig = function (config) {\n if (!config) {\n return _cloudinaryConfig;\n }\n\n _cloudinaryConfig = (0, _cloudinary.getCloudinaryInstanceOf)(_cloudinaryCore.default.Cloudinary, config);\n return _chainTarget;\n };\n\n _this.transformation = function (trans) {\n if (!trans) {\n return _transformation;\n }\n\n _transformation = (0, _cloudinary.getCloudinaryInstanceOf)(_cloudinaryCore.default.Transformation, trans);\n return _chainTarget;\n };\n\n _this.sourceTypes = function (types) {\n if (!types) {\n return _sourceTypes;\n }\n\n _sourceTypes = types;\n return _chainTarget;\n };\n\n _this.getCurrentSources = function () {\n return _sources;\n };\n\n _this.sourceTransformation = function (trans) {\n if (!trans) {\n return _sourceTransformation;\n }\n\n _sourceTransformation = trans;\n return _chainTarget;\n };\n\n _this.on = function () {\n var _playerEvents2;\n\n return (_playerEvents2 = _playerEvents).on.apply(_playerEvents2, arguments);\n };\n\n _this.one = function () {\n var _playerEvents3;\n\n return (_playerEvents3 = _playerEvents).one.apply(_playerEvents3, arguments);\n };\n\n _this.off = function () {\n var _playerEvents4;\n\n return (_playerEvents4 = _playerEvents).off.apply(_playerEvents4, arguments);\n };\n\n _this.autoShowRecommendations = function (autoShow) {\n if (autoShow === undefined) {\n return _autoShowRecommendations;\n }\n\n _autoShowRecommendations = autoShow;\n return _chainTarget;\n };\n\n _this.dispose = function () {\n if (_this.playlist()) {\n _this.disposePlaylist();\n }\n\n unsetRecommendations();\n _source = undefined;\n\n _playerEvents.removeAllListeners();\n };\n\n var setRecommendations = function setRecommendations(recommendations, _ref) {\n var _ref$disableAutoShow = _ref.disableAutoShow,\n disableAutoShow = _ref$disableAutoShow === void 0 ? false : _ref$disableAutoShow,\n _ref$itemBuilder = _ref.itemBuilder,\n itemBuilder = _ref$itemBuilder === void 0 ? null : _ref$itemBuilder;\n unsetRecommendations();\n\n if (!Array.isArray(recommendations) && typeof recommendations !== 'function' && !recommendations.then) {\n throw new Error('\"recommendations\" must be either an array or a function');\n }\n\n _recommendations = {};\n\n itemBuilder = itemBuilder || function (source) {\n return {\n source: source instanceof _videoSource.default ? source : _this.buildSource(source),\n action: function action() {\n return _this.source(source);\n }\n };\n };\n\n _recommendations.sourceChangedHandler = function () {\n var trigger = function trigger(sources) {\n if (typeof sources !== 'undefined' && sources.length > 0) {\n var items = sources.map(function (_source) {\n return itemBuilder(_source);\n });\n\n _this.player.trigger('recommendationschanged', {\n items: items\n });\n } else {\n _this.player.trigger('recommendationsnoshow');\n }\n\n _recommendations.sources = sources;\n };\n\n if ((0, _typeInference.isFunction)(recommendations)) {\n trigger(recommendations());\n } else if (recommendations.then) {\n recommendations.then(trigger);\n } else {\n trigger(recommendations);\n }\n };\n\n _this.one('cldsourcechanged', _recommendations.sourceChangedHandler);\n\n _recommendations.endedHandler = function () {\n if (!disableAutoShow && _this.autoShowRecommendations()) {\n _this.player.trigger('recommendationsshow');\n }\n };\n\n _this.on('ended', _recommendations.endedHandler);\n };\n\n var unsetRecommendations = function unsetRecommendations() {\n if (_recommendations) {\n _this.off('cldsourcechanged', _recommendations.sourceChangedHandler);\n\n _this.off('ended', _recommendations.endedHandler);\n\n delete _recommendations.endedHandler;\n delete _recommendations.sourceChangedHandler;\n }\n\n _recommendations = null;\n };\n\n var refresh = function refresh() {\n var src = _this.source();\n\n if (src.poster()) {\n _this.player.poster(src.poster().url());\n }\n\n _sources = src.generateSources().reduce(function (srcs, src) {\n if (src.isAdaptive) {\n var codec = src.type.split('; ')[1] || null;\n\n if (codec && 'MediaSource' in window) {\n var parts = src.type.split('; ');\n var typeStr = \"video/mp4; \".concat(parts[1] || '');\n var canPlay = testCanPlayTypeAndTypeSupported(typeStr);\n\n if (_video.default.browser.IS_ANY_SAFARI) {\n // work around safari saying it cant play h265\n src.type = \"\".concat(parts[0], \"; \").concat((0, _common.codecShorthandTrans)('h264'));\n }\n\n if (canPlay) {\n srcs.push(src);\n }\n } else {\n srcs.push(src);\n }\n } else {\n srcs.push(src);\n }\n\n return srcs;\n }, []);\n\n _this.player.src(_sources);\n\n _lastSource = src;\n _lastPlaylist = _this.playlist();\n };\n\n var testCanPlayTypeAndTypeSupported = function testCanPlayTypeAndTypeSupported(codec) {\n var v = document.createElement('video');\n return v.canPlayType(codec) || 'MediaSource' in window && MediaSource.isTypeSupported(codec);\n };\n\n var posterOptionsForCurrent = function posterOptionsForCurrent() {\n var opts = (0, _assign.assign)({}, _this.posterOptions());\n\n if (opts.transformation) {\n if ((opts.transformation.width || opts.transformation.height) && !opts.transformation.crop) {\n opts.transformation.crop = 'scale';\n }\n }\n\n opts.transformation = (0, _cloudinary.getCloudinaryInstanceOf)(_cloudinaryCore.default.Transformation, opts.transformation || {}); // Set poster dimensions to player actual size.\n // (unless they were explicitly set via `posterOptions`)\n\n var playerEl = _this.player.el();\n\n if (playerEl && playerEl.clientWidth && playerEl.clientHeight && !(0, _cloudinary.isKeyInTransformation)(opts.transformation, 'width') && !(0, _cloudinary.isKeyInTransformation)(opts.transformation, 'height')) {\n var roundUp100 = function roundUp100(val) {\n return 100 * Math.ceil(val / 100);\n };\n\n opts.transformation.width(roundUp100(playerEl.clientWidth)).height(roundUp100(playerEl.clientHeight)).crop('limit');\n }\n\n return opts;\n }; // Handle external (non-cloudinary plugin) source changes (e.g. by ad plugins)\n\n\n var syncState = function syncState(_, data) {\n var src = data.to; // When source is cloudinary's\n\n if (_lastSource && _lastSource.contains(src)) {\n // If plugin state doesn't have an active VideoSource\n if (!_this.source()) {\n // We might have been running a playlist, reset playlist's state.\n if (_lastPlaylist) {\n _this.playlist(_lastPlaylist);\n } // Rebuild last source state without calling vjs's 'src' and 'poster'\n\n\n _this.source(_lastSource, {\n skipRefresh: true\n });\n }\n } else {\n // Used by cloudinary-only components\n _this.player.trigger('cldsourcechanged', {}); // When source isn't cloudinary's - reset the plugin's state.\n\n\n _this.dispose();\n }\n };\n\n _playerEvents = new _eventHandlerRegistry.default(_this.player);\n\n var constructorParams = _slicing.sliceAndUnsetProperties.apply(void 0, [options].concat(CONSTRUCTOR_PARAMS));\n\n (0, _applyWithProps.applyWithProps)(_assertThisInitialized(_this), constructorParams);\n\n _this.on('sourcechanged', syncState);\n\n return _this;\n }\n\n _createClass(CloudinaryContext, [{\n key: \"currentSourceType\",\n value: function currentSourceType() {\n return this.source().getType();\n }\n }, {\n key: \"currentPublicId\",\n value: function currentPublicId() {\n return this.source() && this.source().publicId();\n }\n }, {\n key: \"currentPoster\",\n value: function currentPoster() {\n return this.source() && this.source().poster();\n }\n }]);\n\n return CloudinaryContext;\n}((0, _mixin2.mixin)(_playlistable.default));\n\nfunction _default() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n options.chainTarget = options.chainTarget || this;\n this.cloudinary = new CloudinaryContext(this, options);\n}\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./plugins/cloudinary/index.js?");
832
832
 
833
833
  /***/ }),
834
834
 
@@ -972,7 +972,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
972
972
  /***/ (function(module, exports, __webpack_require__) {
973
973
 
974
974
  "use strict";
975
- eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar contextMenuContent = function contextMenuContent(player) {\n var isLooping = player.loop();\n var isPaused = player.paused();\n var isMuted = player.muted();\n var isFullscreen = player.isFullscreen();\n var aboutMenuItem = {\n label: '<span class=\"player-version\">Cloudinary Player v' + \"1.6.4-edge.2\" + '</span>'\n };\n\n if (!player.controls()) {\n return [aboutMenuItem];\n }\n\n return [{\n label: isLooping ? 'Unloop' : 'Loop',\n listener: function listener() {\n player.loop(!isLooping);\n }\n }, {\n label: isPaused ? 'Play' : 'Pause',\n listener: function listener() {\n if (isPaused) {\n player.play();\n } else {\n player.pause();\n }\n }\n }, {\n label: isMuted ? 'Unmute' : 'Mute',\n listener: function listener() {\n player.muted(!isMuted);\n }\n }, {\n label: isFullscreen ? 'Exit Fullscreen' : 'Fullscreen',\n listener: function listener() {\n if (isFullscreen) {\n player.exitFullscreen();\n } else {\n player.requestFullscreen();\n }\n }\n }, aboutMenuItem];\n};\n\nvar _default = contextMenuContent;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./plugins/context-menu/contextMenuContent.js?");
975
+ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar contextMenuContent = function contextMenuContent(player) {\n var isLooping = player.loop();\n var isPaused = player.paused();\n var isMuted = player.muted();\n var isFullscreen = player.isFullscreen();\n var aboutMenuItem = {\n label: '<span class=\"player-version\">Cloudinary Player v' + \"1.7.0-edge.0\" + '</span>'\n };\n\n if (!player.controls()) {\n return [aboutMenuItem];\n }\n\n return [{\n label: isLooping ? 'Unloop' : 'Loop',\n listener: function listener() {\n player.loop(!isLooping);\n }\n }, {\n label: isPaused ? 'Play' : 'Pause',\n listener: function listener() {\n if (isPaused) {\n player.play();\n } else {\n player.pause();\n }\n }\n }, {\n label: isMuted ? 'Unmute' : 'Mute',\n listener: function listener() {\n player.muted(!isMuted);\n }\n }, {\n label: isFullscreen ? 'Exit Fullscreen' : 'Fullscreen',\n listener: function listener() {\n if (isFullscreen) {\n player.exitFullscreen();\n } else {\n player.requestFullscreen();\n }\n }\n }, aboutMenuItem];\n};\n\nvar _default = contextMenuContent;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./plugins/context-menu/contextMenuContent.js?");
976
976
 
977
977
  /***/ }),
978
978