cloudinary-video-player 1.6.4-edge.2 → 1.7.0-edge.3
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 +21 -0
- package/dist/cld-video-player.js +42 -19
- package/dist/cld-video-player.light.js +48 -13
- package/dist/cld-video-player.light.min.js +1 -1
- package/dist/cld-video-player.min.js +1 -1
- package/docs/360.html +3 -3
- package/docs/analytics.html +4 -0
- package/docs/raw-url.html +14 -2
- package/docs/subtitles-and-captions.html +31 -27
- package/package.json +3 -2
- package/src/components/interaction-area/interaction-area.service.js +10 -10
- package/src/components/playlist/components/upcoming-video-overlay.js +15 -12
- package/src/components/playlist/layout/playlist-layout.js +4 -3
- package/src/components/playlist/panel/playlist-panel.js +6 -5
- package/src/components/playlist/playlist-widget.js +3 -2
- package/src/components/shoppable-bar/layout/bar-layout.js +2 -1
- package/src/components/shoppable-bar/layout/shoppable-panel-toggle.js +2 -1
- package/src/components/shoppable-bar/layout/shoppable-products-overlay.js +6 -7
- package/src/components/shoppable-bar/panel/shoppable-panel.js +5 -3
- package/src/components/shoppable-bar/shoppable-widget.js +5 -4
- package/src/extended-events.js +22 -21
- package/src/plugins/analytics/index.js +26 -25
- package/src/plugins/cloudinary/models/audio-source/audio-source.js +3 -6
- package/src/plugins/cloudinary/models/video-source/video-source.js +2 -1
- package/src/plugins/dash/videojs-dash.js +1 -1
- package/src/utils/consts.js +44 -0
- package/src/video-player.js +47 -41
- package/src/video-player.utils.js +8 -1
|
@@ -96,6 +96,17 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
96
96
|
/************************************************************************/
|
|
97
97
|
/******/ ({
|
|
98
98
|
|
|
99
|
+
/***/ "../node_modules/css.escape/css.escape.js":
|
|
100
|
+
/*!************************************************!*\
|
|
101
|
+
!*** ../node_modules/css.escape/css.escape.js ***!
|
|
102
|
+
\************************************************/
|
|
103
|
+
/*! no static exports found */
|
|
104
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
105
|
+
|
|
106
|
+
eval("/* WEBPACK VAR INJECTION */(function(global) {/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */\n;(function(root, factory) {\n\t// https://github.com/umdjs/umd/blob/master/returnExports.js\n\tif (true) {\n\t\t// For Node.js.\n\t\tmodule.exports = factory(root);\n\t} else {}\n}(typeof global != 'undefined' ? global : this, function(root) {\n\n\tif (root.CSS && root.CSS.escape) {\n\t\treturn root.CSS.escape;\n\t}\n\n\t// https://drafts.csswg.org/cssom/#serialize-an-identifier\n\tvar cssEscape = function(value) {\n\t\tif (arguments.length == 0) {\n\t\t\tthrow new TypeError('`CSS.escape` requires an argument.');\n\t\t}\n\t\tvar string = String(value);\n\t\tvar length = string.length;\n\t\tvar index = -1;\n\t\tvar codeUnit;\n\t\tvar result = '';\n\t\tvar firstCodeUnit = string.charCodeAt(0);\n\t\twhile (++index < length) {\n\t\t\tcodeUnit = string.charCodeAt(index);\n\t\t\t// Note: there’s no need to special-case astral symbols, surrogate\n\t\t\t// pairs, or lone surrogates.\n\n\t\t\t// If the character is NULL (U+0000), then the REPLACEMENT CHARACTER\n\t\t\t// (U+FFFD).\n\t\t\tif (codeUnit == 0x0000) {\n\t\t\t\tresult += '\\uFFFD';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t// If the character is in the range [\\1-\\1F] (U+0001 to U+001F) or is\n\t\t\t\t// U+007F, […]\n\t\t\t\t(codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F ||\n\t\t\t\t// If the character is the first character and is in the range [0-9]\n\t\t\t\t// (U+0030 to U+0039), […]\n\t\t\t\t(index == 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) ||\n\t\t\t\t// If the character is the second character and is in the range [0-9]\n\t\t\t\t// (U+0030 to U+0039) and the first character is a `-` (U+002D), […]\n\t\t\t\t(\n\t\t\t\t\tindex == 1 &&\n\t\t\t\t\tcodeUnit >= 0x0030 && codeUnit <= 0x0039 &&\n\t\t\t\t\tfirstCodeUnit == 0x002D\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// https://drafts.csswg.org/cssom/#escape-a-character-as-code-point\n\t\t\t\tresult += '\\\\' + codeUnit.toString(16) + ' ';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t// If the character is the first character and is a `-` (U+002D), and\n\t\t\t\t// there is no second character, […]\n\t\t\t\tindex == 0 &&\n\t\t\t\tlength == 1 &&\n\t\t\t\tcodeUnit == 0x002D\n\t\t\t) {\n\t\t\t\tresult += '\\\\' + string.charAt(index);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If the character is not handled by one of the above rules and is\n\t\t\t// greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or\n\t\t\t// is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to\n\t\t\t// U+005A), or [a-z] (U+0061 to U+007A), […]\n\t\t\tif (\n\t\t\t\tcodeUnit >= 0x0080 ||\n\t\t\t\tcodeUnit == 0x002D ||\n\t\t\t\tcodeUnit == 0x005F ||\n\t\t\t\tcodeUnit >= 0x0030 && codeUnit <= 0x0039 ||\n\t\t\t\tcodeUnit >= 0x0041 && codeUnit <= 0x005A ||\n\t\t\t\tcodeUnit >= 0x0061 && codeUnit <= 0x007A\n\t\t\t) {\n\t\t\t\t// the character itself\n\t\t\t\tresult += string.charAt(index);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Otherwise, the escaped character.\n\t\t\t// https://drafts.csswg.org/cssom/#escape-a-character\n\t\t\tresult += '\\\\' + string.charAt(index);\n\n\t\t}\n\t\treturn result;\n\t};\n\n\tif (!root.CSS) {\n\t\troot.CSS = {};\n\t}\n\n\troot.CSS.escape = cssEscape;\n\treturn cssEscape;\n\n}));\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"../node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/../node_modules/css.escape/css.escape.js?");
|
|
107
|
+
|
|
108
|
+
/***/ }),
|
|
109
|
+
|
|
99
110
|
/***/ "../node_modules/events/events.js":
|
|
100
111
|
/*!****************************************!*\
|
|
101
112
|
!*** ../node_modules/events/events.js ***!
|
|
@@ -408,7 +419,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
408
419
|
/***/ (function(module, exports, __webpack_require__) {
|
|
409
420
|
|
|
410
421
|
"use strict";
|
|
411
|
-
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 = void 0;\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\n__webpack_require__(/*! ./upcoming-video-overlay.scss */ \"./components/playlist/components/upcoming-video-overlay.scss\");\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 _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\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\n// support VJS5 & VJS6 at the same time\nvar dom = _video.default.dom || _video.default;\n\nvar Component = _video.default.getComponent('Component');\n\nvar ClickableComponent = _video.default.getComponent('ClickableComponent');\n\nvar UpcomingVideoOverlay = /*#__PURE__*/function (_ClickableComponent) {\n _inherits(UpcomingVideoOverlay, _ClickableComponent);\n\n var _super = _createSuper(UpcomingVideoOverlay);\n\n function UpcomingVideoOverlay(player) {\n var _this;\n\n _classCallCheck(this, UpcomingVideoOverlay);\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this, player].concat(args));\n\n _this._setEvents(player);\n\n return _this;\n }\n\n _createClass(UpcomingVideoOverlay, [{\n key: \"_setEvents\",\n value: function _setEvents(player) {\n player.on('upcomingvideoshow', this._show.bind(this));\n player.on('upcomingvideohide', this._hide.bind(this));\n player.on('playlistitemchanged', this._onPlaylistItemChange.bind(this));\n }\n }, {\n key: \"_hide\",\n value: function _hide() {\n this.removeClass('vjs-upcoming-video-show');\n }\n }, {\n key: \"_disableTransition\",\n value: function _disableTransition(block) {\n this.addClass('disable-transition');\n block();\n this.removeClass('disable-transition');\n }\n }, {\n key: \"_onPlaylistItemChange\",\n value: function _onPlaylistItemChange(_, event) {\n var _this2 = this;\n\n this._hide();\n\n this._disableTransition(function () {\n if (event.next) {\n _this2.setItem(event.next);\n }\n });\n }\n }, {\n key: \"_show\",\n value: function _show() {\n var videoShowClass = 'vjs-upcoming-video-show';\n var ima = this.player().ima;\n var adsManager = ima === 'object' && ima.getAdsManager();\n\n if (adsManager) {\n if (!adsManager.getCurrentAd() || adsManager.getCurrentAd().isLinear()) {\n this.addClass(videoShowClass);\n }\n } else {\n this.addClass(videoShowClass);\n }\n }\n }, {\n key: \"setTitle\",\n value: function setTitle(source) {\n var title = this.getChild('upcomingVideoOverlayContent').getChild('upcomingVideoOverlayBar').getChild('upcomingVideoOverlayTitle');\n title.setContent(source.info().title || source.publicId());\n }\n }, {\n key: \"setItem\",\n value: function setItem(source) {\n this._source = source;\n var maxWidth = parseInt(window.getComputedStyle(this.el(), null).getPropertyValue('max-width'), 10);\n var maxHeight = Math.round(maxWidth * (9 / 16.0));\n var transformation = {\n crop: 'pad',\n background: 'auto:predominant',\n width: maxWidth,\n height: maxHeight\n };\n var content = this.getChild('upcomingVideoOverlayContent');\n this.setTitle(source);\n content.el().style.backgroundImage = \"url(\".concat(this._source.poster().url({\n transformation: transformation\n }), \")\");\n }\n }, {\n key: \"handleClick\",\n value: function handleClick() {\n _get(_getPrototypeOf(UpcomingVideoOverlay.prototype), \"handleClick\", this).call(this, event);\n\n this.player().cloudinary.playlist().playNext();\n }\n }, {\n key: \"createEl\",\n value: function createEl() {\n return _get(_getPrototypeOf(UpcomingVideoOverlay.prototype), \"createEl\", this).call(this, 'div', {\n className: 'vjs-upcoming-video'\n });\n }\n }]);\n\n return UpcomingVideoOverlay;\n}(ClickableComponent);\n\nvar UpcomingVideoOverlayContent = /*#__PURE__*/function (_Component) {\n _inherits(UpcomingVideoOverlayContent, _Component);\n\n var _super2 = _createSuper(UpcomingVideoOverlayContent);\n\n function UpcomingVideoOverlayContent() {\n _classCallCheck(this, UpcomingVideoOverlayContent);\n\n return _super2.apply(this, arguments);\n }\n\n _createClass(UpcomingVideoOverlayContent, [{\n key: \"createEl\",\n value: function createEl() {\n // Content wraps image and bar\n return _get(_getPrototypeOf(UpcomingVideoOverlayContent.prototype), \"createEl\", this).call(this, 'div', {\n className: 'aspect-ratio-content'\n });\n }\n }]);\n\n return UpcomingVideoOverlayContent;\n}(Component);\n\nvar UpcomingVideoOverlayTitle = /*#__PURE__*/function (_Component2) {\n _inherits(UpcomingVideoOverlayTitle, _Component2);\n\n var _super3 = _createSuper(UpcomingVideoOverlayTitle);\n\n function UpcomingVideoOverlayTitle() {\n _classCallCheck(this, UpcomingVideoOverlayTitle);\n\n return _super3.apply(this, arguments);\n }\n\n _createClass(UpcomingVideoOverlayTitle, [{\n key: \"setContent\",\n value: function setContent(title) {\n this._contentSpan.innerText = title;\n }\n }, {\n key: \"createEl\",\n value: function createEl() {\n var el = _get(_getPrototypeOf(UpcomingVideoOverlayTitle.prototype), \"createEl\", this).call(this, 'div', {\n className: 'vjs-control vjs-upcoming-video-title'\n });\n\n var container = dom.createEl('div', {\n className: 'vjs-upcoming-video-title-display',\n innerHTML: '<span class=\"vjs-control-text\">Next up</span>Next up: '\n });\n this._contentSpan = dom.createEl('span', {\n className: 'vjs-upcoming-video-title-display-label'\n });\n container.appendChild(this._contentSpan);\n el.appendChild(container);\n return el;\n }\n }]);\n\n return UpcomingVideoOverlayTitle;\n}(Component);\n\nvar UpcomingVideoOverlayBar = /*#__PURE__*/function (_Component3) {\n _inherits(UpcomingVideoOverlayBar, _Component3);\n\n var _super4 = _createSuper(UpcomingVideoOverlayBar);\n\n function UpcomingVideoOverlayBar() {\n _classCallCheck(this, UpcomingVideoOverlayBar);\n\n return _super4.apply(this, arguments);\n }\n\n _createClass(UpcomingVideoOverlayBar, [{\n key: \"createEl\",\n value: function createEl() {\n return _get(_getPrototypeOf(UpcomingVideoOverlayBar.prototype), \"createEl\", this).call(this, 'div', {\n className: 'vjs-upcoming-video-bar'\n });\n }\n }]);\n\n return UpcomingVideoOverlayBar;\n}(Component);\n\nUpcomingVideoOverlay.prototype.options_ = {\n children: ['upcomingVideoOverlayContent']\n};\n\n_video.default.registerComponent('upcomingVideoOverlay', UpcomingVideoOverlay);\n\nUpcomingVideoOverlayContent.prototype.options_ = {\n children: ['upcomingVideoOverlayBar']\n};\n\n_video.default.registerComponent('upcomingVideoOverlayContent', UpcomingVideoOverlayContent);\n\nUpcomingVideoOverlayBar.prototype.options_ = {\n children: ['upcomingVideoOverlayTitle', 'playlistNextButton']\n};\n\n_video.default.registerComponent('upcomingVideoOverlayBar', UpcomingVideoOverlayBar);\n\n_video.default.registerComponent('upcomingVideoOverlayTitle', UpcomingVideoOverlayTitle);\n\nvar _default = UpcomingVideoOverlay;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./components/playlist/components/upcoming-video-overlay.js?");
|
|
422
|
+
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 = void 0;\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\n__webpack_require__(/*! ./upcoming-video-overlay.scss */ \"./components/playlist/components/upcoming-video-overlay.scss\");\n\nvar _consts = __webpack_require__(/*! ../../../utils/consts */ \"./utils/consts.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 _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\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\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n// support VJS5 & VJS6 at the same time\nvar dom = _video.default.dom || _video.default;\n\nvar Component = _video.default.getComponent('Component');\n\nvar ClickableComponent = _video.default.getComponent('ClickableComponent');\n\nvar UpcomingVideoOverlay = /*#__PURE__*/function (_ClickableComponent) {\n _inherits(UpcomingVideoOverlay, _ClickableComponent);\n\n var _super = _createSuper(UpcomingVideoOverlay);\n\n function UpcomingVideoOverlay(player) {\n var _this;\n\n _classCallCheck(this, UpcomingVideoOverlay);\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this, player].concat(args));\n\n _defineProperty(_assertThisInitialized(_this), \"_hide\", function () {\n _this.removeClass(UpcomingVideoOverlay.VJS_UPCOMING_VIDEO_SHOW);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_onPlaylistItemChange\", function (_, event) {\n _this._hide();\n\n _this._disableTransition(function () {\n if (event.next) {\n _this.setItem(event.next);\n }\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_show\", function () {\n var ima = _this.player().ima;\n\n var adsManager = ima === 'object' && ima.getAdsManager();\n\n if (adsManager) {\n if (!adsManager.getCurrentAd() || adsManager.getCurrentAd().isLinear()) {\n _this.addClass(UpcomingVideoOverlay.VJS_UPCOMING_VIDEO_SHOW);\n }\n } else {\n _this.addClass(UpcomingVideoOverlay.VJS_UPCOMING_VIDEO_SHOW);\n }\n });\n\n _this._setEvents(player);\n\n return _this;\n }\n\n _createClass(UpcomingVideoOverlay, [{\n key: \"_setEvents\",\n value: function _setEvents(player) {\n player.on(_consts.PLAYER_EVENT.UP_COMING_VIDEO_SHOW, this._show);\n player.on(_consts.PLAYER_EVENT.UP_COMING_VIDEO_HIDE, this._hide);\n player.on(_consts.PLAYER_EVENT.PLAYLIST_ITEM_CHANGED, this._onPlaylistItemChange);\n }\n }, {\n key: \"_disableTransition\",\n value: function _disableTransition(block) {\n this.addClass(UpcomingVideoOverlay.DISABLE_TRANSITION_CLASS);\n block();\n this.removeClass(UpcomingVideoOverlay.DISABLE_TRANSITION_CLASS);\n }\n }, {\n key: \"setTitle\",\n value: function setTitle(source) {\n var title = this.getChild('upcomingVideoOverlayContent').getChild('upcomingVideoOverlayBar').getChild('upcomingVideoOverlayTitle');\n title.setContent(source.info().title || source.publicId());\n }\n }, {\n key: \"setItem\",\n value: function setItem(source) {\n this._source = source;\n var maxWidth = parseInt(window.getComputedStyle(this.el(), null).getPropertyValue('max-width'), 10);\n var maxHeight = Math.round(maxWidth * (9 / 16.0));\n var transformation = {\n crop: 'pad',\n background: 'auto:predominant',\n width: maxWidth,\n height: maxHeight\n };\n var content = this.getChild('upcomingVideoOverlayContent');\n this.setTitle(source);\n content.el().style.backgroundImage = \"url(\".concat(this._source.poster().url({\n transformation: transformation\n }), \")\");\n }\n }, {\n key: \"handleClick\",\n value: function handleClick() {\n _get(_getPrototypeOf(UpcomingVideoOverlay.prototype), \"handleClick\", this).call(this, event);\n\n this.player().cloudinary.playlist().playNext();\n }\n }, {\n key: \"createEl\",\n value: function createEl() {\n return _get(_getPrototypeOf(UpcomingVideoOverlay.prototype), \"createEl\", this).call(this, 'div', {\n className: 'vjs-upcoming-video'\n });\n }\n }]);\n\n return UpcomingVideoOverlay;\n}(ClickableComponent);\n\n_defineProperty(UpcomingVideoOverlay, \"DISABLE_TRANSITION_CLASS\", 'disable-transition');\n\n_defineProperty(UpcomingVideoOverlay, \"VJS_UPCOMING_VIDEO_SHOW\", 'vjs-upcoming-video-show');\n\nvar UpcomingVideoOverlayContent = /*#__PURE__*/function (_Component) {\n _inherits(UpcomingVideoOverlayContent, _Component);\n\n var _super2 = _createSuper(UpcomingVideoOverlayContent);\n\n function UpcomingVideoOverlayContent() {\n _classCallCheck(this, UpcomingVideoOverlayContent);\n\n return _super2.apply(this, arguments);\n }\n\n _createClass(UpcomingVideoOverlayContent, [{\n key: \"createEl\",\n value: function createEl() {\n // Content wraps image and bar\n return _get(_getPrototypeOf(UpcomingVideoOverlayContent.prototype), \"createEl\", this).call(this, 'div', {\n className: 'aspect-ratio-content'\n });\n }\n }]);\n\n return UpcomingVideoOverlayContent;\n}(Component);\n\nvar UpcomingVideoOverlayTitle = /*#__PURE__*/function (_Component2) {\n _inherits(UpcomingVideoOverlayTitle, _Component2);\n\n var _super3 = _createSuper(UpcomingVideoOverlayTitle);\n\n function UpcomingVideoOverlayTitle() {\n _classCallCheck(this, UpcomingVideoOverlayTitle);\n\n return _super3.apply(this, arguments);\n }\n\n _createClass(UpcomingVideoOverlayTitle, [{\n key: \"setContent\",\n value: function setContent(title) {\n this._contentSpan.innerText = title;\n }\n }, {\n key: \"createEl\",\n value: function createEl() {\n var el = _get(_getPrototypeOf(UpcomingVideoOverlayTitle.prototype), \"createEl\", this).call(this, 'div', {\n className: 'vjs-control vjs-upcoming-video-title'\n });\n\n var container = dom.createEl('div', {\n className: 'vjs-upcoming-video-title-display',\n innerHTML: '<span class=\"vjs-control-text\">Next up</span>Next up: '\n });\n this._contentSpan = dom.createEl('span', {\n className: 'vjs-upcoming-video-title-display-label'\n });\n container.appendChild(this._contentSpan);\n el.appendChild(container);\n return el;\n }\n }]);\n\n return UpcomingVideoOverlayTitle;\n}(Component);\n\nvar UpcomingVideoOverlayBar = /*#__PURE__*/function (_Component3) {\n _inherits(UpcomingVideoOverlayBar, _Component3);\n\n var _super4 = _createSuper(UpcomingVideoOverlayBar);\n\n function UpcomingVideoOverlayBar() {\n _classCallCheck(this, UpcomingVideoOverlayBar);\n\n return _super4.apply(this, arguments);\n }\n\n _createClass(UpcomingVideoOverlayBar, [{\n key: \"createEl\",\n value: function createEl() {\n return _get(_getPrototypeOf(UpcomingVideoOverlayBar.prototype), \"createEl\", this).call(this, 'div', {\n className: 'vjs-upcoming-video-bar'\n });\n }\n }]);\n\n return UpcomingVideoOverlayBar;\n}(Component);\n\nUpcomingVideoOverlay.prototype.options_ = {\n children: ['upcomingVideoOverlayContent']\n};\n\n_video.default.registerComponent('upcomingVideoOverlay', UpcomingVideoOverlay);\n\nUpcomingVideoOverlayContent.prototype.options_ = {\n children: ['upcomingVideoOverlayBar']\n};\n\n_video.default.registerComponent('upcomingVideoOverlayContent', UpcomingVideoOverlayContent);\n\nUpcomingVideoOverlayBar.prototype.options_ = {\n children: ['upcomingVideoOverlayTitle', 'playlistNextButton']\n};\n\n_video.default.registerComponent('upcomingVideoOverlayBar', UpcomingVideoOverlayBar);\n\n_video.default.registerComponent('upcomingVideoOverlayTitle', UpcomingVideoOverlayTitle);\n\nvar _default = UpcomingVideoOverlay;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./components/playlist/components/upcoming-video-overlay.js?");
|
|
412
423
|
|
|
413
424
|
/***/ }),
|
|
414
425
|
|
|
@@ -468,7 +479,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol
|
|
|
468
479
|
/***/ (function(module, exports, __webpack_require__) {
|
|
469
480
|
|
|
470
481
|
"use strict";
|
|
471
|
-
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 = void 0;\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\nvar _dom = __webpack_require__(/*! ../../../utils/dom */ \"./utils/dom.js\");\n\nvar _cssPrefix = __webpack_require__(/*! ../../../utils/css-prefix */ \"./utils/css-prefix.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return 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 _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar dom = _video.default.dom || _video.default;\n\nvar Component = _video.default.getComponent('Component');\n\nvar OPTIONS_DEFAULT = {\n wrap: false\n};\n\nvar PlaylistLayout = /*#__PURE__*/function (_Component) {\n _inherits(PlaylistLayout, _Component);\n\n var _super = _createSuper(PlaylistLayout);\n\n function PlaylistLayout(player, options) {\n var _thisSuper, _this;\n\n _classCallCheck(this, PlaylistLayout);\n\n var layoutOptions = _objectSpread(_objectSpread({}, OPTIONS_DEFAULT), options);\n\n _this = _super.call(this, player, layoutOptions);\n _this.player_ = player;\n\n _this.setCls();\n\n var fluidHandler = function fluidHandler(e, fluid) {\n _this.options_.fluid = fluid;\n\n _this.removeCls();\n\n _this.setCls();\n };\n\n var wrapVideoWithLayout = function wrapVideoWithLayout() {\n var el = _this.el();\n\n _this.videoWrap_ = dom.createEl('div', {\n className: 'cld-plw-col-player'\n });\n _this.contentEl_ = _this.contentEl_ = dom.createEl('div', {\n className: 'cld-plw-col-list'\n });\n (0, _dom.wrap)(_this.player().el(), el);\n el.appendChild(_this.videoWrap_);\n el.appendChild(_this.contentEl_);\n (0, _dom.wrap)(_this.player().el(), _this.videoWrap_);\n };\n\n if (layoutOptions.wrap) {\n wrapVideoWithLayout();\n }\n\n player.on(
|
|
482
|
+
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 = void 0;\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\nvar _dom = __webpack_require__(/*! ../../../utils/dom */ \"./utils/dom.js\");\n\nvar _cssPrefix = __webpack_require__(/*! ../../../utils/css-prefix */ \"./utils/css-prefix.js\");\n\nvar _consts = __webpack_require__(/*! ../../../utils/consts */ \"./utils/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return 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 _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar dom = _video.default.dom || _video.default;\n\nvar Component = _video.default.getComponent('Component');\n\nvar OPTIONS_DEFAULT = {\n wrap: false\n};\n\nvar PlaylistLayout = /*#__PURE__*/function (_Component) {\n _inherits(PlaylistLayout, _Component);\n\n var _super = _createSuper(PlaylistLayout);\n\n function PlaylistLayout(player, options) {\n var _thisSuper, _this;\n\n _classCallCheck(this, PlaylistLayout);\n\n var layoutOptions = _objectSpread(_objectSpread({}, OPTIONS_DEFAULT), options);\n\n _this = _super.call(this, player, layoutOptions);\n _this.player_ = player;\n\n _this.setCls();\n\n var fluidHandler = function fluidHandler(e, fluid) {\n _this.options_.fluid = fluid;\n\n _this.removeCls();\n\n _this.setCls();\n };\n\n var wrapVideoWithLayout = function wrapVideoWithLayout() {\n var el = _this.el();\n\n _this.videoWrap_ = dom.createEl('div', {\n className: 'cld-plw-col-player'\n });\n _this.contentEl_ = _this.contentEl_ = dom.createEl('div', {\n className: 'cld-plw-col-list'\n });\n (0, _dom.wrap)(_this.player().el(), el);\n el.appendChild(_this.videoWrap_);\n el.appendChild(_this.contentEl_);\n (0, _dom.wrap)(_this.player().el(), _this.videoWrap_);\n };\n\n if (layoutOptions.wrap) {\n wrapVideoWithLayout();\n }\n\n player.on(_consts.PLAYER_EVENT.FLUID, fluidHandler);\n\n _this.addChild(_consts.PLAYER_EVENT.PLAYLIST_PANEL, _this.options_);\n\n _this.dispose = function () {\n _this.removeLayout();\n\n _get((_thisSuper = _assertThisInitialized(_this), _getPrototypeOf(PlaylistLayout.prototype)), \"dispose\", _thisSuper).call(_thisSuper);\n\n player.off(_consts.PLAYER_EVENT.FLUID, fluidHandler);\n };\n\n return _this;\n }\n\n _createClass(PlaylistLayout, [{\n key: \"getCls\",\n value: function getCls() {\n var cls = ['cld-video-player', 'cld-plw-layout'];\n cls.push((0, _cssPrefix.skinClassPrefix)(this.player()));\n cls.push((0, _cssPrefix.playerClassPrefix)(this.player()));\n\n if (this.options_.fluid) {\n cls.push('cld-plw-layout-fluid');\n }\n\n return cls;\n }\n }, {\n key: \"setCls\",\n value: function setCls() {\n var _this2 = this;\n\n this.removeClass((0, _cssPrefix.skinClassPrefix)(this));\n this.getCls().forEach(function (cls) {\n _this2.addClass(cls);\n });\n }\n }, {\n key: \"removeCls\",\n value: function removeCls() {\n var _this3 = this;\n\n this.getCls().forEach(function (cls) {\n _this3.removeClass(cls);\n });\n }\n }, {\n key: \"update\",\n value: function update(optionToChange, options) {\n this.options(options);\n this.removeChild('PlaylistPanel');\n this.addChild('PlaylistPanel', this.options_);\n this.trigger('playlistlayoutupdate');\n }\n }, {\n key: \"removeLayout\",\n value: function removeLayout() {\n var parentElem = this.el().parentElement;\n\n if (parentElem) {\n parentElem.appendChild(this.player().el());\n }\n }\n }, {\n key: \"createEl\",\n value: function createEl() {\n var el = _get(_getPrototypeOf(PlaylistLayout.prototype), \"createEl\", this).call(this, 'div'); // Apply font styles on wrapper div.\n\n\n el.style.fontFamily = this.player().el().style.fontFamily;\n return el;\n }\n }]);\n\n return PlaylistLayout;\n}(Component);\n\n_video.default.registerComponent('playlistLayout', PlaylistLayout);\n\nvar _default = PlaylistLayout;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./components/playlist/layout/playlist-layout.js?");
|
|
472
483
|
|
|
473
484
|
/***/ }),
|
|
474
485
|
|
|
@@ -492,7 +503,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol
|
|
|
492
503
|
/***/ (function(module, exports, __webpack_require__) {
|
|
493
504
|
|
|
494
505
|
"use strict";
|
|
495
|
-
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 = void 0;\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\n__webpack_require__(/*! assets/styles/components/playlist.scss */ \"./assets/styles/components/playlist.scss\");\n\nvar _playlistPanelItem = _interopRequireDefault(__webpack_require__(/*! ./playlist-panel-item */ \"./components/playlist/panel/playlist-panel-item.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 _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar Component = _video.default.getComponent('Component');\n\nvar PlaylistPanel = /*#__PURE__*/function (_Component) {\n _inherits(PlaylistPanel, _Component);\n\n var _super = _createSuper(PlaylistPanel);\n\n function PlaylistPanel(player) {\n var _thisSuper, _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, PlaylistPanel);\n\n _this = _super.call(this, player, options);\n\n var itemChangeHandler = function itemChangeHandler() {\n _this.render();\n };\n\n player.on(
|
|
506
|
+
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 = void 0;\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\n__webpack_require__(/*! assets/styles/components/playlist.scss */ \"./assets/styles/components/playlist.scss\");\n\nvar _playlistPanelItem = _interopRequireDefault(__webpack_require__(/*! ./playlist-panel-item */ \"./components/playlist/panel/playlist-panel-item.js\"));\n\nvar _consts = __webpack_require__(/*! ../../../utils/consts */ \"./utils/consts.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 _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar Component = _video.default.getComponent('Component');\n\nvar PlaylistPanel = /*#__PURE__*/function (_Component) {\n _inherits(PlaylistPanel, _Component);\n\n var _super = _createSuper(PlaylistPanel);\n\n function PlaylistPanel(player) {\n var _thisSuper, _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, PlaylistPanel);\n\n _this = _super.call(this, player, options);\n\n var itemChangeHandler = function itemChangeHandler() {\n _this.render();\n };\n\n player.on(_consts.PLAYER_EVENT.PLAYLIST_ITEM_CHANGED, itemChangeHandler);\n\n _this.render();\n\n _this.dispose = function () {\n _get((_thisSuper = _assertThisInitialized(_this), _getPrototypeOf(PlaylistPanel.prototype)), \"dispose\", _thisSuper).call(_thisSuper);\n\n player.off(_consts.PLAYER_EVENT.PLAYLIST_ITEM_CHANGED, itemChangeHandler);\n };\n\n return _this;\n }\n\n _createClass(PlaylistPanel, [{\n key: \"createEl\",\n value: function createEl() {\n var el = _get(_getPrototypeOf(PlaylistPanel.prototype), \"createEl\", this).call(this);\n\n el.classList.add('cld-plw-panel');\n return el;\n }\n }, {\n key: \"removeAll\",\n value: function removeAll() {\n var children = this.children();\n\n for (var i = children.length - 1; i >= 0; --i) {\n this.removeChild(children[i]);\n }\n }\n }, {\n key: \"getItems\",\n value: function getItems() {\n var playlist = this.player().cloudinary.playlist();\n var repeat = playlist._repeat;\n\n if (this.options_.showAll) {\n return playlist.list();\n }\n\n var items = [];\n var numOfItems = this.options_.total;\n var index = playlist.currentIndex();\n var source = playlist.list()[index];\n items.push(source);\n\n while (items.length < numOfItems) {\n index = playlist.nextIndex(index);\n\n if (index === -1) {\n if (!repeat && items.length > 0) {\n break;\n }\n\n index = 0;\n }\n\n source = playlist.list()[index];\n items.push(source);\n }\n\n return items;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var items = this.getItems();\n this.removeAll();\n items.forEach(function (source, index) {\n var playlistItem = new _playlistPanelItem.default(_this2.player(), _video.default.mergeOptions(_this2.options_, {\n item: source,\n next: index === 1,\n current: index === 0\n }));\n\n _this2.addChild(playlistItem);\n });\n }\n }]);\n\n return PlaylistPanel;\n}(Component);\n\n_video.default.registerComponent('playlistPanel', PlaylistPanel);\n\nvar _default = PlaylistPanel;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./components/playlist/panel/playlist-panel.js?");
|
|
496
507
|
|
|
497
508
|
/***/ }),
|
|
498
509
|
|
|
@@ -504,7 +515,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol
|
|
|
504
515
|
/***/ (function(module, exports, __webpack_require__) {
|
|
505
516
|
|
|
506
517
|
"use strict";
|
|
507
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\nvar _playlistLayoutHorizontal = _interopRequireDefault(__webpack_require__(/*! ./layout/playlist-layout-horizontal */ \"./components/playlist/layout/playlist-layout-horizontal.js\"));\n\nvar _playlistLayoutVertical = _interopRequireDefault(__webpack_require__(/*! ./layout/playlist-layout-vertical */ \"./components/playlist/layout/playlist-layout-vertical.js\"));\n\nvar _playlistLayoutCustom = _interopRequireDefault(__webpack_require__(/*! ./layout/playlist-layout-custom */ \"./components/playlist/layout/playlist-layout-custom.js\"));\n\nvar _playlist = __webpack_require__(/*! ./playlist.const */ \"./components/playlist/playlist.const.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 ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar modifyOptions = function modifyOptions(player, opt) {\n var options = _objectSpread(_objectSpread({}, _playlist.PLAYLIST_DEFAULTS_OPTIONS), opt);\n\n if (options.show && typeof options.selector === 'string') {\n options.useDefaultLayout = false;\n options.useCustomLayout = true;\n options.renderTo = document.querySelector(options.selector);\n options.showAll = true;\n\n if (!options.renderTo.length === 0) {\n throw new Error(\"Couldn't find element(s) by selector '\".concat(options.selector, \"' for playlist\"));\n }\n }\n\n if (options.show && !options.selector) {\n options.useDefaultLayout = true;\n options.useCustomLayout = false;\n }\n\n options.direction = options.direction.toLowerCase() === 'horizontal' ? 'horizontal' : 'vertical';\n options.skin = player.options_.skin;\n return options;\n};\n\nvar PlaylistWidget = /*#__PURE__*/function () {\n function PlaylistWidget(player) {\n var _this = this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, PlaylistWidget);\n\n options = modifyOptions(player, options);\n this.options_ = options;\n this.player_ = player;\n this.render();\n\n var fluidHandler = function fluidHandler(e, fluid) {\n _this.options_.fluid = fluid;\n };\n\n player.on(
|
|
518
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\nvar _playlistLayoutHorizontal = _interopRequireDefault(__webpack_require__(/*! ./layout/playlist-layout-horizontal */ \"./components/playlist/layout/playlist-layout-horizontal.js\"));\n\nvar _playlistLayoutVertical = _interopRequireDefault(__webpack_require__(/*! ./layout/playlist-layout-vertical */ \"./components/playlist/layout/playlist-layout-vertical.js\"));\n\nvar _playlistLayoutCustom = _interopRequireDefault(__webpack_require__(/*! ./layout/playlist-layout-custom */ \"./components/playlist/layout/playlist-layout-custom.js\"));\n\nvar _playlist = __webpack_require__(/*! ./playlist.const */ \"./components/playlist/playlist.const.js\");\n\nvar _consts = __webpack_require__(/*! ../../utils/consts */ \"./utils/consts.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 ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar modifyOptions = function modifyOptions(player, opt) {\n var options = _objectSpread(_objectSpread({}, _playlist.PLAYLIST_DEFAULTS_OPTIONS), opt);\n\n if (options.show && typeof options.selector === 'string') {\n options.useDefaultLayout = false;\n options.useCustomLayout = true;\n options.renderTo = document.querySelector(options.selector);\n options.showAll = true;\n\n if (!options.renderTo.length === 0) {\n throw new Error(\"Couldn't find element(s) by selector '\".concat(options.selector, \"' for playlist\"));\n }\n }\n\n if (options.show && !options.selector) {\n options.useDefaultLayout = true;\n options.useCustomLayout = false;\n }\n\n options.direction = options.direction.toLowerCase() === 'horizontal' ? 'horizontal' : 'vertical';\n options.skin = player.options_.skin;\n return options;\n};\n\nvar PlaylistWidget = /*#__PURE__*/function () {\n function PlaylistWidget(player) {\n var _this = this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, PlaylistWidget);\n\n options = modifyOptions(player, options);\n this.options_ = options;\n this.player_ = player;\n this.render();\n\n var fluidHandler = function fluidHandler(e, fluid) {\n _this.options_.fluid = fluid;\n };\n\n player.on(_consts.PLAYER_EVENT.FLUID, fluidHandler);\n\n this.options = function (options) {\n if (!options) {\n return _this.options_;\n }\n\n _this.options_ = _video.default.mergeOptions(_this.options_, options);\n player.trigger('playlistwidgetoption', _this.options_.playlistWidget);\n return _this.options_;\n };\n\n this.dispose = function () {\n _this.layout_.dispose();\n\n player.off(_consts.PLAYER_EVENT.FLUID, fluidHandler);\n };\n }\n\n _createClass(PlaylistWidget, [{\n key: \"render\",\n value: function render() {\n if (this.options_.useDefaultLayout) {\n if (this.options_.direction === 'horizontal') {\n this.layout_ = new _playlistLayoutHorizontal.default(this.player_, this.options_);\n } else {\n this.layout_ = new _playlistLayoutVertical.default(this.player_, this.options_);\n }\n }\n\n if (this.options_.useCustomLayout) {\n this.layout_ = new _playlistLayoutCustom.default(this.player_, this.options_);\n }\n }\n }, {\n key: \"getLayout\",\n value: function getLayout() {\n return this.layout_;\n }\n }, {\n key: \"update\",\n value: function update(optionName, optionValue) {\n this.options(optionValue);\n\n if (optionName === 'direction') {\n this.layout_.removeLayout();\n this.layout_.dispose();\n this.render();\n } else {\n this.layout_.update(optionName, this.options_);\n }\n }\n }, {\n key: \"setSkin\",\n value: function setSkin() {\n this.layout_.setCls();\n }\n }, {\n key: \"total\",\n value: function total() {\n var totalNumber = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _playlist.PLAYLIST_DEFAULTS_OPTIONS.total;\n var total = parseInt(totalNumber, 10);\n\n if (total !== this.options_.total && typeof total === 'number' && total > 0) {\n this.update('total', {\n total: total\n });\n }\n\n return this;\n }\n }, {\n key: \"direction\",\n value: function direction() {\n var _direction = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _playlist.PLAYLIST_DEFAULTS_OPTIONS.direction;\n\n if (_direction === 'horizontal' || _direction === 'vertical') {\n this.update('direction', {\n direction: _direction\n });\n }\n\n return this;\n }\n }]);\n\n return PlaylistWidget;\n}();\n\nvar _default = PlaylistWidget;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./components/playlist/playlist-widget.js?");
|
|
508
519
|
|
|
509
520
|
/***/ }),
|
|
510
521
|
|
|
@@ -684,7 +695,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol
|
|
|
684
695
|
/***/ (function(module, exports, __webpack_require__) {
|
|
685
696
|
|
|
686
697
|
"use strict";
|
|
687
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\nvar _assign = __webpack_require__(/*! utils/assign */ \"./utils/assign.js\");\n\nvar _throttle = __webpack_require__(/*! utils/throttle */ \"./utils/throttle.js\");\n\nvar _time = __webpack_require__(/*! utils/time */ \"./utils/time.js\");\n\n__webpack_require__(/*! assets/styles/components/playlist.scss */ \"./assets/styles/components/playlist.scss\");\n\nvar _shoppablePanelItem = _interopRequireDefault(__webpack_require__(/*! ./shoppable-panel-item */ \"./components/shoppable-bar/panel/shoppable-panel-item.js\"));\n\nvar _imageSource = _interopRequireDefault(__webpack_require__(/*! ../../../plugins/cloudinary/models/image-source */ \"./plugins/cloudinary/models/image-source.js\"));\n\nvar _shoppableWidget = __webpack_require__(/*! ../shoppable-widget.const */ \"./components/shoppable-bar/shoppable-widget.const.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\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\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 _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar Component = _video.default.getComponent('Component');\n\nvar ShoppablePanel = /*#__PURE__*/function (_Component) {\n _inherits(ShoppablePanel, _Component);\n\n var _super = _createSuper(ShoppablePanel);\n\n function ShoppablePanel(player) {\n var _thisSuper, _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, ShoppablePanel);\n\n _this = _super.call(this, player, options);\n _this.options = options;\n\n var itemChangeHandler = function itemChangeHandler() {\n _this.render();\n };\n\n player.on('shoppableitemchanged', itemChangeHandler);\n\n _this.render();\n\n _this.dispose = function () {\n _get((_thisSuper = _assertThisInitialized(_this), _getPrototypeOf(ShoppablePanel.prototype)), \"dispose\", _thisSuper).call(_thisSuper);\n\n player.off('shoppableitemchanged', itemChangeHandler);\n };\n\n return _this;\n }\n\n _createClass(ShoppablePanel, [{\n key: \"createEl\",\n value: function createEl() {\n var el = _get(_getPrototypeOf(ShoppablePanel.prototype), \"createEl\", this).call(this);\n\n [_shoppableWidget.CLD_SPBL_PANEL_CLASS, 'base-color-bg'].map(function (cls) {\n return el.classList.add(cls);\n });\n return el;\n }\n }, {\n key: \"removeAll\",\n value: function removeAll() {\n var childrens = this.children();\n\n for (var i = childrens.length - 1; i >= 0; --i) {\n this.removeChild(childrens[i]);\n }\n }\n }, {\n key: \"getItems\",\n value: function getItems() {\n var _this2 = this;\n\n var cloudinaryConfig = this.player_.cloudinary.cloudinaryConfig();\n return this.options.products.map(function (product) {\n if (product.onHover && _typeof(product.onHover.args) === 'object') {\n product.onHover.args.transformation = (0, _assign.assign)({}, _this2.options.transformation, product.onHover.args.transformation);\n }\n\n var conf = {\n productId: product.productId,\n productName: product.productName,\n title: product.title,\n onHover: product.onHover,\n onClick: product.onClick,\n startTime: product.startTime,\n endTime: product.endTime\n };\n var imageSource = new _imageSource.default(product.publicId, {\n cloudinaryConfig: cloudinaryConfig,\n transformation: (0, _assign.assign)({}, _this2.options.transformation, product.transformation)\n });\n return {\n imageSrc: imageSource,\n conf: conf\n };\n });\n }\n }, {\n key: \"scrollToActiveItem\",\n value: function scrollToActiveItem() {\n var activeItems = this.el_.getElementsByClassName('active');\n\n if (activeItems.length > 0) {\n var toScroll = activeItems[0].offsetTop - 12; // Test for native scrollTo support (IE will fail)\n\n if ('scrollBehavior' in document.documentElement.style) {\n this.el_.scrollTo({\n top: toScroll,\n behavior: 'smooth'\n });\n } else {\n this.el_.scrollTop = toScroll;\n }\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this3 = this;\n\n this.removeAll();\n var items = this.getItems();\n var throttledScrollToActiveItem = (0, _throttle.throttle)(function () {\n return _this3.scrollToActiveItem();\n }, 1000);\n items.forEach(function (item, index) {\n var shoppablePanelItem = new _shoppablePanelItem.default(_this3.player(), {\n item: item.imageSrc,\n conf: item.conf,\n next: index === 1,\n current: index === 0,\n clickHandler: function clickHandler(e) {\n var target = e.currentTarget || e.target;\n var evName = _this3.player_.ended() ? 'productClickPost' : 'productClick';\n\n _this3.player_.trigger(evName, {\n productId: target.dataset.productId,\n productName: target.dataset.productName\n }); // Go to URL, or seek video (set currentTime)\n\n\n if (target.dataset.clickAction === _shoppableWidget.SHOPPABLE_CLICK_ACTIONS.GO_TO) {\n window.open(target.dataset.gotoUrl, '_blank');\n } else if (target.dataset.clickAction === _shoppableWidget.SHOPPABLE_CLICK_ACTIONS.SEEk) {\n var gotoSecs = (0, _time.parseTime)(target.dataset.seek);\n\n if (gotoSecs !== null) {\n _this3.player_.addClass('vjs-has-started'); // Hide the poster image\n\n\n if (_this3.player_.postModal) {\n _this3.player_.postModal.close();\n }\n\n _this3.player_.currentTime(gotoSecs); // Close products side-panel\n\n\n _this3.player_.removeClass(_shoppableWidget.SHOPPABLE_PANEL_VISIBLE_CLASS);\n\n _this3.player_.addClass(_shoppableWidget.SHOPPABLE_PANEL_HIDDEN_CLASS);\n\n _this3.player_.addClass(_shoppableWidget.SHOPPABLE_PRODUCTS_OVERLAY_CLASS); // Wait for the time update and show the tooltips\n\n\n _this3.player_.one('seeked', function () {\n return _this3.player_.trigger('showProductsOverlay');\n });\n }\n } // pause - true (default), false, or number of seconds\n\n\n if (target.dataset.pause !== 'false') {\n _this3.player_.pause();\n\n if ((0, _time.parseTime)(target.dataset.pause)) {\n setTimeout(function () {\n _this3.player_.play();\n }, (0, _time.parseTime)(target.dataset.pause) * 1000);\n }\n }\n }\n });\n shoppablePanelItem.on('mouseover', function (e) {\n var target = e.currentTarget || e.target;\n var evName = _this3.player_.ended() ? 'productHoverPost' : 'productHover';\n\n _this3.player_.trigger(evName, {\n productId: target.dataset.productId,\n productName: target.dataset.productName\n });\n });\n\n if (typeof item.conf.startTime !== 'undefined' && typeof item.conf.endTime !== 'undefined') {\n _this3.player_.on('timeupdate', function () {\n var time = _this3.player_.currentTime();\n\n if (time >= item.conf.startTime && time < item.conf.endTime) {\n shoppablePanelItem.el_.classList.add('active');\n throttledScrollToActiveItem();\n } else if (shoppablePanelItem.el_.classList.contains('active')) {\n shoppablePanelItem.el_.classList.remove('active');\n }\n });\n }\n\n _this3.addChild(shoppablePanelItem);\n });\n }\n }]);\n\n return ShoppablePanel;\n}(Component);\n\n_video.default.registerComponent('shoppablePanel', ShoppablePanel);\n\nvar _default = ShoppablePanel;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./components/shoppable-bar/panel/shoppable-panel.js?");
|
|
698
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\nvar _assign = __webpack_require__(/*! utils/assign */ \"./utils/assign.js\");\n\nvar _throttle = __webpack_require__(/*! utils/throttle */ \"./utils/throttle.js\");\n\nvar _time = __webpack_require__(/*! utils/time */ \"./utils/time.js\");\n\n__webpack_require__(/*! assets/styles/components/playlist.scss */ \"./assets/styles/components/playlist.scss\");\n\nvar _shoppablePanelItem = _interopRequireDefault(__webpack_require__(/*! ./shoppable-panel-item */ \"./components/shoppable-bar/panel/shoppable-panel-item.js\"));\n\nvar _imageSource = _interopRequireDefault(__webpack_require__(/*! ../../../plugins/cloudinary/models/image-source */ \"./plugins/cloudinary/models/image-source.js\"));\n\nvar _shoppableWidget = __webpack_require__(/*! ../shoppable-widget.const */ \"./components/shoppable-bar/shoppable-widget.const.js\");\n\nvar _consts = __webpack_require__(/*! ../../../utils/consts */ \"./utils/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\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\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 _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar Component = _video.default.getComponent('Component');\n\nvar ShoppablePanel = /*#__PURE__*/function (_Component) {\n _inherits(ShoppablePanel, _Component);\n\n var _super = _createSuper(ShoppablePanel);\n\n function ShoppablePanel(player) {\n var _thisSuper, _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, ShoppablePanel);\n\n _this = _super.call(this, player, options);\n _this.options = options;\n\n var itemChangeHandler = function itemChangeHandler() {\n _this.render();\n };\n\n player.on(_consts.PLAYER_EVENT.SHOPPABLE_ITEM_CHANGED, itemChangeHandler);\n\n _this.render();\n\n _this.dispose = function () {\n _get((_thisSuper = _assertThisInitialized(_this), _getPrototypeOf(ShoppablePanel.prototype)), \"dispose\", _thisSuper).call(_thisSuper);\n\n player.off(_consts.PLAYER_EVENT.SHOPPABLE_ITEM_CHANGED, itemChangeHandler);\n };\n\n return _this;\n }\n\n _createClass(ShoppablePanel, [{\n key: \"createEl\",\n value: function createEl() {\n var el = _get(_getPrototypeOf(ShoppablePanel.prototype), \"createEl\", this).call(this);\n\n [_shoppableWidget.CLD_SPBL_PANEL_CLASS, 'base-color-bg'].map(function (cls) {\n return el.classList.add(cls);\n });\n return el;\n }\n }, {\n key: \"removeAll\",\n value: function removeAll() {\n var childrens = this.children();\n\n for (var i = childrens.length - 1; i >= 0; --i) {\n this.removeChild(childrens[i]);\n }\n }\n }, {\n key: \"getItems\",\n value: function getItems() {\n var _this2 = this;\n\n var cloudinaryConfig = this.player_.cloudinary.cloudinaryConfig();\n return this.options.products.map(function (product) {\n if (product.onHover && _typeof(product.onHover.args) === 'object') {\n product.onHover.args.transformation = (0, _assign.assign)({}, _this2.options.transformation, product.onHover.args.transformation);\n }\n\n var conf = {\n productId: product.productId,\n productName: product.productName,\n title: product.title,\n onHover: product.onHover,\n onClick: product.onClick,\n startTime: product.startTime,\n endTime: product.endTime\n };\n var imageSource = new _imageSource.default(product.publicId, {\n cloudinaryConfig: cloudinaryConfig,\n transformation: (0, _assign.assign)({}, _this2.options.transformation, product.transformation)\n });\n return {\n imageSrc: imageSource,\n conf: conf\n };\n });\n }\n }, {\n key: \"scrollToActiveItem\",\n value: function scrollToActiveItem() {\n var activeItems = this.el_.getElementsByClassName('active');\n\n if (activeItems.length > 0) {\n var toScroll = activeItems[0].offsetTop - 12; // Test for native scrollTo support (IE will fail)\n\n if ('scrollBehavior' in document.documentElement.style) {\n this.el_.scrollTo({\n top: toScroll,\n behavior: 'smooth'\n });\n } else {\n this.el_.scrollTop = toScroll;\n }\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this3 = this;\n\n this.removeAll();\n var items = this.getItems();\n var throttledScrollToActiveItem = (0, _throttle.throttle)(function () {\n return _this3.scrollToActiveItem();\n }, 1000);\n items.forEach(function (item, index) {\n var shoppablePanelItem = new _shoppablePanelItem.default(_this3.player(), {\n item: item.imageSrc,\n conf: item.conf,\n next: index === 1,\n current: index === 0,\n clickHandler: function clickHandler(e) {\n var target = e.currentTarget || e.target;\n var evName = _this3.player_.ended() ? 'productClickPost' : 'productClick';\n\n _this3.player_.trigger(evName, {\n productId: target.dataset.productId,\n productName: target.dataset.productName\n }); // Go to URL, or seek video (set currentTime)\n\n\n if (target.dataset.clickAction === _shoppableWidget.SHOPPABLE_CLICK_ACTIONS.GO_TO) {\n window.open(target.dataset.gotoUrl, '_blank');\n } else if (target.dataset.clickAction === _shoppableWidget.SHOPPABLE_CLICK_ACTIONS.SEEk) {\n var gotoSecs = (0, _time.parseTime)(target.dataset.seek);\n\n if (gotoSecs !== null) {\n _this3.player_.addClass('vjs-has-started'); // Hide the poster image\n\n\n if (_this3.player_.postModal) {\n _this3.player_.postModal.close();\n }\n\n _this3.player_.currentTime(gotoSecs); // Close products side-panel\n\n\n _this3.player_.removeClass(_shoppableWidget.SHOPPABLE_PANEL_VISIBLE_CLASS);\n\n _this3.player_.addClass(_shoppableWidget.SHOPPABLE_PANEL_HIDDEN_CLASS);\n\n _this3.player_.addClass(_shoppableWidget.SHOPPABLE_PRODUCTS_OVERLAY_CLASS); // Wait for the time update and show the tooltips\n\n\n _this3.player_.one('seeked', function () {\n return _this3.player_.trigger('showProductsOverlay');\n });\n }\n } // pause - true (default), false, or number of seconds\n\n\n if (target.dataset.pause !== 'false') {\n _this3.player_.pause();\n\n if ((0, _time.parseTime)(target.dataset.pause)) {\n setTimeout(function () {\n _this3.player_.play();\n }, (0, _time.parseTime)(target.dataset.pause) * 1000);\n }\n }\n }\n });\n shoppablePanelItem.on('mouseover', function (e) {\n var target = e.currentTarget || e.target;\n var evName = _this3.player_.ended() ? 'productHoverPost' : 'productHover';\n\n _this3.player_.trigger(evName, {\n productId: target.dataset.productId,\n productName: target.dataset.productName\n });\n });\n\n if (typeof item.conf.startTime !== 'undefined' && typeof item.conf.endTime !== 'undefined') {\n _this3.player_.on(_consts.PLAYER_EVENT.TIME_UPDATE, function () {\n var time = _this3.player_.currentTime();\n\n if (time >= item.conf.startTime && time < item.conf.endTime) {\n shoppablePanelItem.el_.classList.add('active');\n throttledScrollToActiveItem();\n } else if (shoppablePanelItem.el_.classList.contains('active')) {\n shoppablePanelItem.el_.classList.remove('active');\n }\n });\n }\n\n _this3.addChild(shoppablePanelItem);\n });\n }\n }]);\n\n return ShoppablePanel;\n}(Component);\n\n_video.default.registerComponent('shoppablePanel', ShoppablePanel);\n\nvar _default = ShoppablePanel;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./components/shoppable-bar/panel/shoppable-panel.js?");
|
|
688
699
|
|
|
689
700
|
/***/ }),
|
|
690
701
|
|
|
@@ -732,7 +743,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
732
743
|
/***/ (function(module, exports, __webpack_require__) {
|
|
733
744
|
|
|
734
745
|
"use strict";
|
|
735
|
-
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 = exports.normalizeEventsParam = void 0;\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\nvar _events = _interopRequireDefault(__webpack_require__(/*! events */ \"../node_modules/events/events.js\"));\n\nvar _assign = __webpack_require__(/*! utils/assign */ \"./utils/assign.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 _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 EVENT_DEFAULTS = {\n percentsplayed: {\n percents: [25, 50, 75, 100]\n }\n};\nvar DEFAULT_EVENTS = ['percentsplayed', 'pausenoseek', 'seek', 'mute', 'unmute', 'qualitychanged'];\nvar DEFAULT_OPTIONS = {\n events: DEFAULT_EVENTS\n}; // Emits the following additional events:\n// percentsplayed, timeplayed, pausenoseek, seek, mute, unmute\n\nvar ExtendedEvents = /*#__PURE__*/function (_EventEmitter) {\n _inherits(ExtendedEvents, _EventEmitter);\n\n var _super = _createSuper(ExtendedEvents);\n\n function ExtendedEvents(player) {\n var _this;\n\n var initOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, ExtendedEvents);\n\n _this = _super.call(this);\n _this.player = player;\n\n var options = _video.default.mergeOptions(DEFAULT_OPTIONS, initOptions);\n\n var _muteData = {\n lastState: undefined\n };\n var _seekStart = 0;\n var _seekEnd = 0;\n var _seeking = false;\n var _percentsTracked = [];\n var _timesTracked = [];\n var _currentSource = null;\n var _ended = false;\n\n var volumechange = function volumechange(event) {\n if (_this.player.muted() && _muteData.lastState !== 'muted') {\n _muteData.lastState = 'muted';\n\n _this.emit('mute', event);\n } else if (!_this.player.muted() && _muteData.lastState !== 'unmuted') {\n _muteData.lastState = 'unmuted';\n\n _this.emit('unmute', event);\n }\n };\n\n var timeupdate = function timeupdate(event) {\n var currentTime = _this.player.currentTime();\n\n var duration = _this.player.duration();\n\n var _emit = function _emit(type, data) {\n data.originalType = 'timeupdate';\n\n _this.emit(type, event, data);\n };\n\n if (_this.events.percentsplayed) {\n _this.events.percentsplayed.percents.forEach(function (percent) {\n if (playedAtPercentage(currentTime, duration, percent) && _percentsTracked.indexOf(percent) === -1) {\n _percentsTracked.push(percent);\n\n _emit('percentsplayed', {\n percent: percent\n });\n }\n });\n }\n\n if (_this.events.timeplayed) {\n var timeplayed = _this.events.timeplayed;\n var times = timeplayed.interval ? [Math.floor(currentTime / timeplayed.interval) * timeplayed.interval] : timeplayed.times;\n times.forEach(function (time) {\n if (playedAtTime(currentTime, time) && _timesTracked.indexOf(time) === -1) {\n _timesTracked.push(time);\n\n _emit('timeplayed', {\n time: time\n });\n }\n });\n }\n\n if (_this.events.seek) {\n _seekStart = _seekEnd;\n _seekEnd = currentTime;\n\n if (Math.abs(_seekStart - _seekEnd) > 1) {\n _seeking = true; // should empty _timesTracked array on seek, needed for 'timeplayed' event\n\n resetPerVideoState();\n\n _emit('seek', {\n seekStart: _seekStart,\n seekEnd: _seekEnd\n });\n }\n }\n };\n\n var pause = function pause(event) {\n var currentTime = Math.round(_this.player.currentTime());\n var duration = Math.round(_this.player.duration());\n\n if (currentTime !== duration && !_seeking) {\n _this.emit('pausenoseek', event);\n }\n };\n\n var play = function play() {\n _seeking = false;\n };\n\n var replay = function replay() {\n if (_ended) {\n _this.player.trigger('replay');\n\n _ended = false;\n }\n };\n\n var loadedmetadata = function loadedmetadata() {\n if (_this.player.currentSource().src !== _currentSource) {\n resetPerVideoState();\n _currentSource = _this.player.currentSource().src;\n }\n };\n\n var adaptiveEvents = function adaptiveEvents(event) {\n var ee = _assertThisInitialized(_this);\n\n var tracks = _this.player.textTracks();\n\n var segmentMetadataTrack = null;\n\n for (var i = 0; i < tracks.length; i++) {\n if (tracks[i].label === 'segment-metadata') {\n segmentMetadataTrack = tracks[i];\n }\n }\n\n var previousResolution = null;\n\n if (segmentMetadataTrack) {\n segmentMetadataTrack.on('cuechange', function () {\n var activeCue = segmentMetadataTrack.activeCues[0];\n\n if (activeCue) {\n var currentRes = activeCue.value.resolution;\n\n if (previousResolution !== currentRes) {\n var data = {\n from: previousResolution,\n to: currentRes\n };\n ee.emit('qualitychanged', event, data);\n }\n\n previousResolution = currentRes;\n }\n });\n }\n };\n\n var resetState = function resetState() {\n _muteData = {\n lastState: undefined\n };\n _seekStart = _seekEnd = 0;\n _seeking = false;\n resetPerVideoState();\n };\n\n var resetPerVideoState = function resetPerVideoState() {\n _percentsTracked = [];\n _timesTracked = [];\n };\n\n var ended = function ended() {\n _ended = true;\n };\n\n _this.events = normalizeEventsParam(options.events, EVENT_DEFAULTS);\n resetState();\n\n _this.player.on('play', replay.bind(_assertThisInitialized(_this)));\n\n _this.player.on('ended', ended.bind(_assertThisInitialized(_this)));\n\n if (_this.events.percentsplayed || _this.events.timeplayed || _this.events.seek || _this.events.totaltimeplayed) {\n _this.player.on('timeupdate', timeupdate.bind(_assertThisInitialized(_this)));\n }\n\n if (_this.events.mute || _this.events.unmute) {\n _this.player.on('volumechange', volumechange.bind(_assertThisInitialized(_this)));\n }\n\n if (_this.events.pausenoseek) {\n _this.player.on('pause', pause.bind(_assertThisInitialized(_this)));\n\n _this.player.on('play', play.bind(_assertThisInitialized(_this)));\n }\n\n _this.player.on('loadedmetadata', loadedmetadata.bind(_assertThisInitialized(_this)));\n\n _this.player.on('loadeddata', adaptiveEvents.bind(_assertThisInitialized(_this)));\n\n return _this;\n }\n\n return ExtendedEvents;\n}(_events.default);\n\nvar normalizeEventsParam = function normalizeEventsParam(events, defaults) {\n var normalized = events;\n\n if (events.constructor.name === 'Array') {\n normalized = events.reduce(function (agg, item) {\n var eventDefaults = defaults[item] || {};\n\n if ((0, _typeInference.isPlainObject)(item)) {\n agg[item.type] = (0, _assign.assign)({}, eventDefaults, item);\n } else {\n agg[item] = eventDefaults;\n }\n\n return agg;\n }, {});\n }\n\n return normalized;\n};\n\nexports.normalizeEventsParam = normalizeEventsParam;\n\nvar playedAtPercentage = function playedAtPercentage(currentTime, duration, percentageCheckpoint) {\n var graceRangeSeconds = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.5;\n var checkPoint = duration * percentageCheckpoint / 100;\n return playedAtTime(currentTime, checkPoint, graceRangeSeconds);\n};\n\nvar playedAtTime = function playedAtTime(currentTime, checkpoint) {\n var graceRangeSeconds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.5;\n return currentTime <= checkpoint + graceRangeSeconds && currentTime >= checkpoint - graceRangeSeconds;\n};\n\nvar _default = ExtendedEvents;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./extended-events.js?");
|
|
746
|
+
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 = exports.normalizeEventsParam = void 0;\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\nvar _events = _interopRequireDefault(__webpack_require__(/*! events */ \"../node_modules/events/events.js\"));\n\nvar _assign = __webpack_require__(/*! utils/assign */ \"./utils/assign.js\");\n\nvar _typeInference = __webpack_require__(/*! utils/type-inference */ \"./utils/type-inference.js\");\n\nvar _consts = __webpack_require__(/*! ./utils/consts */ \"./utils/consts.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 _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 EVENT_DEFAULTS = {\n percentsplayed: {\n percents: [25, 50, 75, 100]\n }\n};\nvar DEFAULT_EVENTS = [_consts.PLAYER_EVENT.PERCENTS_PLAYED, _consts.PLAYER_EVENT.PAUSE_NO_SEEK, _consts.PLAYER_EVENT.SEEK, _consts.PLAYER_EVENT.MUTE, _consts.PLAYER_EVENT.UNMUTE, _consts.PLAYER_EVENT.QUALITY_CHANGED];\nvar DEFAULT_OPTIONS = {\n events: DEFAULT_EVENTS\n}; // Emits the following additional events:\n// percentsplayed, timeplayed, pausenoseek, seek, mute, unmute\n\nvar ExtendedEvents = /*#__PURE__*/function (_EventEmitter) {\n _inherits(ExtendedEvents, _EventEmitter);\n\n var _super = _createSuper(ExtendedEvents);\n\n function ExtendedEvents(player) {\n var _this;\n\n var initOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, ExtendedEvents);\n\n _this = _super.call(this);\n _this.player = player;\n\n var options = _video.default.mergeOptions(DEFAULT_OPTIONS, initOptions);\n\n var _muteData = {\n lastState: undefined\n };\n var _seekStart = 0;\n var _seekEnd = 0;\n var _seeking = false;\n var _percentsTracked = [];\n var _timesTracked = [];\n var _currentSource = null;\n var _ended = false;\n\n var volumechange = function volumechange(event) {\n if (_this.player.muted() && _muteData.lastState !== 'muted') {\n _muteData.lastState = 'muted';\n\n _this.emit(_consts.PLAYER_EVENT.MUTE, event);\n } else if (!_this.player.muted() && _muteData.lastState !== 'unmuted') {\n _muteData.lastState = 'unmuted';\n\n _this.emit(_consts.PLAYER_EVENT.UNMUTE, event);\n }\n };\n\n var timeupdate = function timeupdate(event) {\n var currentTime = _this.player.currentTime();\n\n var duration = _this.player.duration();\n\n var _emit = function _emit(type, data) {\n data.originalType = 'timeupdate';\n\n _this.emit(type, event, data);\n };\n\n if (_this.events.percentsplayed) {\n _this.events.percentsplayed.percents.forEach(function (percent) {\n if (playedAtPercentage(currentTime, duration, percent) && _percentsTracked.indexOf(percent) === -1) {\n _percentsTracked.push(percent);\n\n _emit(_consts.PLAYER_EVENT.PERCENTS_PLAYED, {\n percent: percent\n });\n }\n });\n }\n\n if (_this.events.timeplayed) {\n var timeplayed = _this.events.timeplayed;\n var times = timeplayed.interval ? [Math.floor(currentTime / timeplayed.interval) * timeplayed.interval] : timeplayed.times;\n times.forEach(function (time) {\n if (playedAtTime(currentTime, time) && _timesTracked.indexOf(time) === -1) {\n _timesTracked.push(time);\n\n _emit(_consts.PLAYER_EVENT.TIME_PLAYED, {\n time: time\n });\n }\n });\n }\n\n if (_this.events.seek) {\n _seekStart = _seekEnd;\n _seekEnd = currentTime;\n\n if (Math.abs(_seekStart - _seekEnd) > 1) {\n _seeking = true; // should empty _timesTracked array on seek, needed for 'timeplayed' event\n\n resetPerVideoState();\n\n _emit(_consts.PLAYER_EVENT.SEEK, {\n seekStart: _seekStart,\n seekEnd: _seekEnd\n });\n }\n }\n };\n\n var pause = function pause(event) {\n var currentTime = Math.round(_this.player.currentTime());\n var duration = Math.round(_this.player.duration());\n\n if (currentTime !== duration && !_seeking) {\n _this.emit(_consts.PLAYER_EVENT.PAUSE_NO_SEEK, event);\n }\n };\n\n var play = function play() {\n _seeking = false;\n };\n\n var replay = function replay() {\n if (_ended) {\n _this.player.trigger('replay');\n\n _ended = false;\n }\n };\n\n var loadedmetadata = function loadedmetadata() {\n if (_this.player.currentSource().src !== _currentSource) {\n resetPerVideoState();\n _currentSource = _this.player.currentSource().src;\n }\n };\n\n var adaptiveEvents = function adaptiveEvents(event) {\n var ee = _assertThisInitialized(_this);\n\n var tracks = _this.player.textTracks();\n\n var segmentMetadataTrack = null;\n\n for (var i = 0; i < tracks.length; i++) {\n if (tracks[i].label === 'segment-metadata') {\n segmentMetadataTrack = tracks[i];\n }\n }\n\n var previousResolution = null;\n\n if (segmentMetadataTrack) {\n segmentMetadataTrack.on('cuechange', function () {\n var activeCue = segmentMetadataTrack.activeCues[0];\n\n if (activeCue) {\n var currentRes = activeCue.value.resolution;\n\n if (previousResolution !== currentRes) {\n var data = {\n from: previousResolution,\n to: currentRes\n };\n ee.emit(_consts.PLAYER_EVENT.QUALITY_CHANGED, event, data);\n }\n\n previousResolution = currentRes;\n }\n });\n }\n };\n\n var resetState = function resetState() {\n _muteData = {\n lastState: undefined\n };\n _seekStart = _seekEnd = 0;\n _seeking = false;\n resetPerVideoState();\n };\n\n var resetPerVideoState = function resetPerVideoState() {\n _percentsTracked = [];\n _timesTracked = [];\n };\n\n var ended = function ended() {\n _ended = true;\n };\n\n _this.events = normalizeEventsParam(options.events, EVENT_DEFAULTS);\n resetState();\n\n _this.player.on(_consts.PLAYER_EVENT.PLAY, replay.bind(_assertThisInitialized(_this)));\n\n _this.player.on(_consts.PLAYER_EVENT.ENDED, ended.bind(_assertThisInitialized(_this)));\n\n if (_this.events.percentsplayed || _this.events.timeplayed || _this.events.seek || _this.events.totaltimeplayed) {\n _this.player.on(_consts.PLAYER_EVENT.TIME_UPDATE, timeupdate.bind(_assertThisInitialized(_this)));\n }\n\n if (_this.events.mute || _this.events.unmute) {\n _this.player.on(_consts.PLAYER_EVENT.VOLUME_CHANGE, volumechange.bind(_assertThisInitialized(_this)));\n }\n\n if (_this.events.pausenoseek) {\n _this.player.on(_consts.PLAYER_EVENT.PAUSE, pause.bind(_assertThisInitialized(_this)));\n\n _this.player.on(_consts.PLAYER_EVENT.PLAY, play.bind(_assertThisInitialized(_this)));\n }\n\n _this.player.on(_consts.PLAYER_EVENT.LOADED_METADATA, loadedmetadata.bind(_assertThisInitialized(_this)));\n\n _this.player.on(_consts.PLAYER_EVENT.LOADED_DATA, adaptiveEvents.bind(_assertThisInitialized(_this)));\n\n return _this;\n }\n\n return ExtendedEvents;\n}(_events.default);\n\nvar normalizeEventsParam = function normalizeEventsParam(events, defaults) {\n var normalized = events;\n\n if (events.constructor.name === 'Array') {\n normalized = events.reduce(function (agg, item) {\n var eventDefaults = defaults[item] || {};\n\n if ((0, _typeInference.isPlainObject)(item)) {\n agg[item.type] = (0, _assign.assign)({}, eventDefaults, item);\n } else {\n agg[item] = eventDefaults;\n }\n\n return agg;\n }, {});\n }\n\n return normalized;\n};\n\nexports.normalizeEventsParam = normalizeEventsParam;\n\nvar playedAtPercentage = function playedAtPercentage(currentTime, duration, percentageCheckpoint) {\n var graceRangeSeconds = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.5;\n var checkPoint = duration * percentageCheckpoint / 100;\n return playedAtTime(currentTime, checkPoint, graceRangeSeconds);\n};\n\nvar playedAtTime = function playedAtTime(currentTime, checkpoint) {\n var graceRangeSeconds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.5;\n return currentTime <= checkpoint + graceRangeSeconds && currentTime >= checkpoint - graceRangeSeconds;\n};\n\nvar _default = ExtendedEvents;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./extended-events.js?");
|
|
736
747
|
|
|
737
748
|
/***/ }),
|
|
738
749
|
|
|
@@ -780,7 +791,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol
|
|
|
780
791
|
/***/ (function(module, exports, __webpack_require__) {
|
|
781
792
|
|
|
782
793
|
"use strict";
|
|
783
|
-
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;\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\nvar _slicing = __webpack_require__(/*! utils/slicing */ \"./utils/slicing.js\");\n\nvar _extendedEvents = _interopRequireWildcard(__webpack_require__(/*! extended-events */ \"./extended-events.js\"));\n\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\n\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\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\nvar DEFAULT_EVENTS = ['play', 'pause', 'ended', 'volumechange', 'resize', 'error', 'fullscreenchange', 'start', 'videoload', 'percentsplayed', 'seek', 'playerload'];\nvar EVENT_DEFAULTS = {\n percentsplayed: {\n percents: [25, 50, 75, 100]\n }\n};\nvar DEFAULT_OPTIONS = {\n events: DEFAULT_EVENTS,\n category: 'Video',\n defaultLabel: function defaultLabel(player) {\n return player.cloudinary && player.cloudinary.currentPublicId() || player.currentSource().src;\n }\n};\n\nvar AnalyticsPlugin = /*#__PURE__*/function () {\n function AnalyticsPlugin(player) {\n var initOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, AnalyticsPlugin);\n\n this.player = player;\n this.options = _video.default.mergeOptions(DEFAULT_OPTIONS, initOptions);\n this.events = (0, _extendedEvents.normalizeEventsParam)(this.options.events, EVENT_DEFAULTS);\n var extendedEvents = (0, _slicing.sliceProperties)(this.events, 'percentsplayed', 'timeplayed', 'pause', 'seek');\n\n if (extendedEvents.pause) {\n delete extendedEvents.pause;\n extendedEvents.pausenoseek = {};\n }\n\n this._extendedEvents = new _extendedEvents.default(player, {\n events: extendedEvents\n });\n this._currentSource = null;\n this._startTracked = null;\n this._endTracked = null;\n this.resetState();\n }\n\n _createClass(AnalyticsPlugin, [{\n key: \"init\",\n value: function init() {\n var _this = this;\n\n var playerLoad = function playerLoad() {\n _this.track({\n action: 'Player Load',\n label: window.location.href,\n nonInteraction: true\n });\n };\n\n var play = function play() {\n _this.track({\n action: 'Play'\n });\n };\n\n var start = function start() {\n if (_this._startTracked) {\n _this.track({\n action: 'Start'\n });\n\n _this._startTracked = true;\n }\n };\n\n var pause = function pause() {\n _this.track({\n action: 'Pause'\n });\n };\n\n var ended = function ended() {\n if (!_this._endTracked) {\n _this.track({\n action: 'Ended',\n nonInteraction: true\n });\n\n _this._endTracked = true;\n }\n };\n\n var error = function error() {\n _this.track({\n action: 'Error',\n nonInteraction: true\n });\n };\n\n var volumechange = function volumechange() {\n var value = _this.player.muted() ? 0 : _this.player.volume();\n\n _this.track({\n action: 'Volume Change',\n value: value\n });\n };\n\n var resize = function resize() {\n var action = \"Resize - \".concat(_this.player.width(), \"x\").concat(_this.player.height(), \"}\");\n\n _this.track({\n action: action\n });\n };\n\n var fullscreenchange = function fullscreenchange() {\n var action = _this.player.isFullscreen() ? 'Enter Fullscreen' : 'Exit Fullscreen';\n\n _this.track({\n action: action\n });\n };\n\n var percentsPlayed = function percentsPlayed(event, data) {\n var percent = data.percent;\n\n _this.track({\n action: \"\".concat(percent, \" Percents Played\"),\n nonInteraction: true\n });\n };\n\n var timePlayed = function timePlayed(event, data) {\n var time = data.time;\n\n _this.track({\n action: \"\".concat(time, \" Seconds Played\"),\n value: time,\n nonInteraction: true\n });\n };\n\n var seek = function seek(event, data) {\n var seekStart = data.seekStart,\n seekEnd = data.seekEnd;\n\n _this.track({\n action: 'Seek Start',\n value: seekStart\n });\n\n _this.track({\n action: 'Seek End',\n value: seekEnd\n });\n };\n\n var shoppableProductHover = function shoppableProductHover(event, data) {\n _this.track({\n action: 'productHover',\n label: data.productName\n });\n };\n\n var shoppableProductClick = function shoppableProductClick(event, data) {\n _this.track({\n action: 'productClick',\n label: data.productName\n });\n };\n\n var shoppableBarMax = function shoppableBarMax() {\n _this.track({\n action: 'shoppableBar',\n label: 'opened'\n });\n };\n\n var shoppableBarMin = function shoppableBarMin() {\n _this.track({\n action: 'shoppableBar',\n label: 'closed'\n });\n };\n\n var shoppableReplay = function shoppableReplay() {\n _this.track({\n action: 'replay'\n });\n };\n\n var shoppableProductClickPost = function shoppableProductClickPost(event, data) {\n _this.track({\n action: 'productClickPostPlay',\n label: data.productName\n });\n };\n\n var shoppableProductHoverPost = function shoppableProductHoverPost(event, data) {\n _this.track({\n action: 'productHoverPostPlay',\n label: data.productName\n });\n };\n\n if (this.events.shoppable) {\n this.player.on('productHover', shoppableProductHover.bind(this));\n this.player.on('productClick', shoppableProductClick.bind(this));\n this.player.on('productHoverPost', shoppableProductHoverPost.bind(this));\n this.player.on('productClickPost', shoppableProductClickPost.bind(this));\n this.player.on('productBarMin', shoppableBarMin.bind(this));\n this.player.on('productBarMax', shoppableBarMax.bind(this));\n this.player.on('replay', shoppableReplay.bind(this));\n }\n\n if (this.events.play) {\n this.player.on('play', play.bind(this));\n }\n\n if (this.events.ended) {\n this.player.on('ended', ended.bind(this));\n }\n\n if (this.events.volumechange) {\n this.player.on('volumechange', volumechange.bind(this));\n }\n\n if (this.events.resize) {\n this.player.on('resize', resize.bind(this));\n }\n\n if (this.events.error) {\n this.player.on('error', error.bind(this));\n }\n\n if (this.events.start) {\n this.player.on('playing', start.bind(this));\n }\n\n if (this.events.fullscreenchange) {\n this.player.on('fullscreenchange', fullscreenchange.bind(this));\n }\n\n if (this.events.percentsplayed) {\n this._extendedEvents.on('percentsplayed', percentsPlayed.bind(this));\n }\n\n if (this.events.timeplayed) {\n this._extendedEvents.on('timeplayed', timePlayed.bind(this));\n }\n\n if (this.events.pause) {\n this._extendedEvents.on('pausenoseek', pause.bind(this));\n }\n\n if (this.events.seek) {\n this._extendedEvents.on('seek', seek.bind(this));\n }\n\n if (this.events.playerload) {\n playerLoad();\n }\n\n this.player.on('loadedmetadata', this.loadedmetadata.bind(this));\n }\n }, {\n key: \"track\",\n value: function track(_ref) {\n var action = _ref.action,\n label = _ref.label,\n _ref$value = _ref.value,\n value = _ref$value === void 0 ? null : _ref$value,\n _ref$nonInteraction = _ref.nonInteraction,\n nonInteraction = _ref$nonInteraction === void 0 ? false : _ref$nonInteraction;\n var eventData = {\n eventCategory: this.options.category,\n eventAction: action,\n eventLabel: label || this.options.defaultLabel(this.player),\n eventValue: value || Math.round(this.player.currentTime()),\n nonInteraction: nonInteraction\n };\n window.ga('send', 'event', eventData);\n }\n }, {\n key: \"videoload\",\n value: function videoload() {\n this.track({\n action: 'Video Load',\n nonInteraction: true\n });\n }\n }, {\n key: \"resetState\",\n value: function resetState() {\n this._currentSource = '';\n this._startTracked = false;\n this._endTracked = false;\n }\n }, {\n key: \"loadedmetadata\",\n value: function loadedmetadata() {\n var src = this.player.currentSource().src;\n\n if (src !== this._currentSource) {\n this.resetState();\n this._currentSource = src;\n\n if (this.events.videoload) {\n this.videoload();\n }\n }\n }\n }]);\n\n return AnalyticsPlugin;\n}();\n\nfunction _default() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n new AnalyticsPlugin(this, opts).init();\n}\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./plugins/analytics/index.js?");
|
|
794
|
+
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;\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\nvar _slicing = __webpack_require__(/*! utils/slicing */ \"./utils/slicing.js\");\n\nvar _extendedEvents = _interopRequireWildcard(__webpack_require__(/*! extended-events */ \"./extended-events.js\"));\n\nvar _consts = __webpack_require__(/*! ../../utils/consts */ \"./utils/consts.js\");\n\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\n\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\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\nvar DEFAULT_EVENTS = [_consts.PLAYER_EVENT.PLAY, _consts.PLAYER_EVENT.PAUSE, _consts.PLAYER_EVENT.ENDED, _consts.PLAYER_EVENT.VOLUME_CHANGE, _consts.PLAYER_EVENT.RESIZE, _consts.PLAYER_EVENT.ERROR, _consts.PLAYER_EVENT.FULL_SCREEN_CHANGE, _consts.PLAYER_EVENT.START, _consts.PLAYER_EVENT.VIDEO_LOAD, _consts.PLAYER_EVENT.PERCENTS_PLAYED, _consts.PLAYER_EVENT.SEEK, _consts.PLAYER_EVENT.PLAYER_LOAD];\nvar EVENT_DEFAULTS = {\n percentsplayed: {\n percents: [25, 50, 75, 100]\n }\n};\nvar DEFAULT_OPTIONS = {\n events: DEFAULT_EVENTS,\n category: 'Video',\n defaultLabel: function defaultLabel(player) {\n return player.cloudinary && player.cloudinary.currentPublicId() || player.currentSource().src;\n }\n};\n\nvar AnalyticsPlugin = /*#__PURE__*/function () {\n function AnalyticsPlugin(player) {\n var initOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, AnalyticsPlugin);\n\n this.player = player;\n this.options = _video.default.mergeOptions(DEFAULT_OPTIONS, initOptions);\n this.events = (0, _extendedEvents.normalizeEventsParam)(this.options.events, EVENT_DEFAULTS);\n var extendedEvents = (0, _slicing.sliceProperties)(this.events, _consts.PLAYER_EVENT.PERCENTS_PLAYED, _consts.PLAYER_EVENT.TIME_PLAYED, _consts.PLAYER_EVENT.PAUSE, _consts.PLAYER_EVENT.SEEK);\n\n if (extendedEvents.pause) {\n delete extendedEvents.pause;\n extendedEvents.pausenoseek = {};\n }\n\n this._extendedEvents = new _extendedEvents.default(player, {\n events: extendedEvents\n });\n this._currentSource = null;\n this._startTracked = null;\n this._endTracked = null;\n this.resetState();\n }\n\n _createClass(AnalyticsPlugin, [{\n key: \"init\",\n value: function init() {\n var _this = this;\n\n var playerLoad = function playerLoad() {\n _this.track({\n action: 'Player Load',\n label: window.location.href,\n nonInteraction: true\n });\n };\n\n var play = function play() {\n _this.track({\n action: 'Play'\n });\n };\n\n var start = function start() {\n if (_this._startTracked) {\n _this.track({\n action: 'Start'\n });\n\n _this._startTracked = true;\n }\n };\n\n var pause = function pause() {\n _this.track({\n action: 'Pause'\n });\n };\n\n var ended = function ended() {\n if (!_this._endTracked) {\n _this.track({\n action: 'Ended',\n nonInteraction: true\n });\n\n _this._endTracked = true;\n }\n };\n\n var error = function error() {\n _this.track({\n action: 'Error',\n nonInteraction: true\n });\n };\n\n var volumechange = function volumechange() {\n var value = _this.player.muted() ? 0 : _this.player.volume();\n\n _this.track({\n action: 'Volume Change',\n value: value\n });\n };\n\n var resize = function resize() {\n var action = \"Resize - \".concat(_this.player.width(), \"x\").concat(_this.player.height(), \"}\");\n\n _this.track({\n action: action\n });\n };\n\n var fullscreenchange = function fullscreenchange() {\n var action = _this.player.isFullscreen() ? 'Enter Fullscreen' : 'Exit Fullscreen';\n\n _this.track({\n action: action\n });\n };\n\n var percentsPlayed = function percentsPlayed(event, data) {\n var percent = data.percent;\n\n _this.track({\n action: \"\".concat(percent, \" Percents Played\"),\n nonInteraction: true\n });\n };\n\n var timePlayed = function timePlayed(event, data) {\n var time = data.time;\n\n _this.track({\n action: \"\".concat(time, \" Seconds Played\"),\n value: time,\n nonInteraction: true\n });\n };\n\n var seek = function seek(event, data) {\n var seekStart = data.seekStart,\n seekEnd = data.seekEnd;\n\n _this.track({\n action: 'Seek Start',\n value: seekStart\n });\n\n _this.track({\n action: 'Seek End',\n value: seekEnd\n });\n };\n\n var shoppableProductHover = function shoppableProductHover(event, data) {\n _this.track({\n action: 'productHover',\n label: data.productName\n });\n };\n\n var shoppableProductClick = function shoppableProductClick(event, data) {\n _this.track({\n action: 'productClick',\n label: data.productName\n });\n };\n\n var shoppableBarMax = function shoppableBarMax() {\n _this.track({\n action: 'shoppableBar',\n label: 'opened'\n });\n };\n\n var shoppableBarMin = function shoppableBarMin() {\n _this.track({\n action: 'shoppableBar',\n label: 'closed'\n });\n };\n\n var shoppableReplay = function shoppableReplay() {\n _this.track({\n action: 'replay'\n });\n };\n\n var shoppableProductClickPost = function shoppableProductClickPost(event, data) {\n _this.track({\n action: 'productClickPostPlay',\n label: data.productName\n });\n };\n\n var shoppableProductHoverPost = function shoppableProductHoverPost(event, data) {\n _this.track({\n action: 'productHoverPostPlay',\n label: data.productName\n });\n };\n\n if (this.events.shoppable) {\n this.player.on('productHover', shoppableProductHover.bind(this));\n this.player.on('productClick', shoppableProductClick.bind(this));\n this.player.on('productHoverPost', shoppableProductHoverPost.bind(this));\n this.player.on('productClickPost', shoppableProductClickPost.bind(this));\n this.player.on('productBarMin', shoppableBarMin.bind(this));\n this.player.on('productBarMax', shoppableBarMax.bind(this));\n this.player.on('replay', shoppableReplay.bind(this));\n }\n\n if (this.events.play) {\n this.player.on(_consts.PLAYER_EVENT.PLAY, play.bind(this));\n }\n\n if (this.events.ended) {\n this.player.on(_consts.PLAYER_EVENT.ENDED, ended.bind(this));\n }\n\n if (this.events.volumechange) {\n this.player.on(_consts.PLAYER_EVENT.VOLUME_CHANGE, volumechange.bind(this));\n }\n\n if (this.events.resize) {\n this.player.on(_consts.PLAYER_EVENT.RESIZE, resize.bind(this));\n }\n\n if (this.events.error) {\n this.player.on(_consts.PLAYER_EVENT.ERROR, error.bind(this));\n }\n\n if (this.events.start) {\n this.player.on(_consts.PLAYER_EVENT.PLAYING, start.bind(this));\n }\n\n if (this.events.fullscreenchange) {\n this.player.on(_consts.PLAYER_EVENT.FULL_SCREEN_CHANGE, fullscreenchange.bind(this));\n }\n\n if (this.events.percentsplayed) {\n this._extendedEvents.on(_consts.PLAYER_EVENT.PERCENTS_PLAYED, percentsPlayed.bind(this));\n }\n\n if (this.events.timeplayed) {\n this._extendedEvents.on(_consts.PLAYER_EVENT.TIME_PLAYED, timePlayed.bind(this));\n }\n\n if (this.events.pause) {\n this._extendedEvents.on(_consts.PLAYER_EVENT.PAUSE_NO_SEEK, pause.bind(this));\n }\n\n if (this.events.seek) {\n this._extendedEvents.on(_consts.PLAYER_EVENT.SEEK, seek.bind(this));\n }\n\n if (this.events.playerload) {\n playerLoad();\n }\n\n this.player.on(_consts.PLAYER_EVENT.LOADED_METADATA, this.loadedmetadata.bind(this));\n }\n }, {\n key: \"track\",\n value: function track(_ref) {\n var action = _ref.action,\n label = _ref.label,\n _ref$value = _ref.value,\n value = _ref$value === void 0 ? null : _ref$value,\n _ref$nonInteraction = _ref.nonInteraction,\n nonInteraction = _ref$nonInteraction === void 0 ? false : _ref$nonInteraction;\n var eventData = {\n eventCategory: this.options.category,\n eventAction: action,\n eventLabel: label || this.options.defaultLabel(this.player),\n eventValue: value || Math.round(this.player.currentTime()),\n nonInteraction: nonInteraction\n };\n window.ga('send', 'event', eventData);\n }\n }, {\n key: \"videoload\",\n value: function videoload() {\n this.track({\n action: 'Video Load',\n nonInteraction: true\n });\n }\n }, {\n key: \"resetState\",\n value: function resetState() {\n this._currentSource = '';\n this._startTracked = false;\n this._endTracked = false;\n }\n }, {\n key: \"loadedmetadata\",\n value: function loadedmetadata() {\n var src = this.player.currentSource().src;\n\n if (src !== this._currentSource) {\n this.resetState();\n this._currentSource = src;\n\n if (this.events.videoload) {\n this.videoload();\n }\n }\n }\n }]);\n\n return AnalyticsPlugin;\n}();\n\nfunction _default() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n new AnalyticsPlugin(this, opts).init();\n}\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./plugins/analytics/index.js?");
|
|
784
795
|
|
|
785
796
|
/***/ }),
|
|
786
797
|
|
|
@@ -828,7 +839,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
828
839
|
/***/ (function(module, exports, __webpack_require__) {
|
|
829
840
|
|
|
830
841
|
"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?");
|
|
842
|
+
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.3\")\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
843
|
|
|
833
844
|
/***/ }),
|
|
834
845
|
|
|
@@ -852,7 +863,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
852
863
|
/***/ (function(module, exports, __webpack_require__) {
|
|
853
864
|
|
|
854
865
|
"use strict";
|
|
855
|
-
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 = void 0;\n\nvar _videoSource = _interopRequireDefault(__webpack_require__(/*! ../video-source/video-source */ \"./plugins/cloudinary/models/video-source/video-source.js\"));\n\nvar _imageSource = _interopRequireDefault(__webpack_require__(/*! ../image-source */ \"./plugins/cloudinary/models/image-source.js\"));\n\nvar _common = __webpack_require__(/*! ../../common */ \"./plugins/cloudinary/common.js\");\n\nvar _slicing = __webpack_require__(/*! utils/slicing */ \"./utils/slicing.js\");\n\nvar _assign = __webpack_require__(/*! utils/assign */ \"./utils/assign.js\");\n\nvar _querystring = __webpack_require__(/*! utils/querystring */ \"./utils/querystring.js\");\n\nvar _audioSource = __webpack_require__(/*! ./audio-source.const */ \"./plugins/cloudinary/models/audio-source/audio-source.const.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 AudioSource = /*#__PURE__*/function (_VideoSource) {\n _inherits(AudioSource, _VideoSource);\n\n var _super = _createSuper(AudioSource);\n\n function AudioSource(publicId) {\n var _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, AudioSource);\n\n var _normalizeOptions = (0, _common.normalizeOptions)(publicId, options);\n\n publicId = _normalizeOptions.publicId;\n options = _normalizeOptions.options;\n publicId = publicId.replace(_audioSource.AUDIO_SUFFIX_REMOVAL_PATTERN, '');\n options = (0, _assign.assign)({}, _audioSource.DEFAULT_AUDIO_PARAMS, options);\n\n var _sliceAndUnsetPropert = (0, _slicing.sliceAndUnsetProperties)(options, 'poster'),\n poster = _sliceAndUnsetPropert.poster;\n\n _this = _super.call(this, publicId, options);\n _this._poster = null;\n _this._type =
|
|
866
|
+
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 = void 0;\n\nvar _videoSource = _interopRequireDefault(__webpack_require__(/*! ../video-source/video-source */ \"./plugins/cloudinary/models/video-source/video-source.js\"));\n\nvar _imageSource = _interopRequireDefault(__webpack_require__(/*! ../image-source */ \"./plugins/cloudinary/models/image-source.js\"));\n\nvar _common = __webpack_require__(/*! ../../common */ \"./plugins/cloudinary/common.js\");\n\nvar _slicing = __webpack_require__(/*! utils/slicing */ \"./utils/slicing.js\");\n\nvar _assign = __webpack_require__(/*! utils/assign */ \"./utils/assign.js\");\n\nvar _querystring = __webpack_require__(/*! utils/querystring */ \"./utils/querystring.js\");\n\nvar _audioSource = __webpack_require__(/*! ./audio-source.const */ \"./plugins/cloudinary/models/audio-source/audio-source.const.js\");\n\nvar _consts = __webpack_require__(/*! ../../../../utils/consts */ \"./utils/consts.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 AudioSource = /*#__PURE__*/function (_VideoSource) {\n _inherits(AudioSource, _VideoSource);\n\n var _super = _createSuper(AudioSource);\n\n function AudioSource(publicId) {\n var _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, AudioSource);\n\n var _normalizeOptions = (0, _common.normalizeOptions)(publicId, options);\n\n publicId = _normalizeOptions.publicId;\n options = _normalizeOptions.options;\n publicId = publicId.replace(_audioSource.AUDIO_SUFFIX_REMOVAL_PATTERN, '');\n options = (0, _assign.assign)({}, _audioSource.DEFAULT_AUDIO_PARAMS, options);\n\n var _sliceAndUnsetPropert = (0, _slicing.sliceAndUnsetProperties)(options, 'poster'),\n poster = _sliceAndUnsetPropert.poster;\n\n _this = _super.call(this, publicId, options);\n _this._poster = null;\n _this._type = _consts.SOURCE_TYPE.AUDIO;\n\n _this.poster(poster);\n\n return _this;\n }\n\n _createClass(AudioSource, [{\n key: \"getPoster\",\n value: function getPoster() {\n return this._poster;\n }\n }, {\n key: \"poster\",\n value: function poster(publicId) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (!publicId) {\n return this._poster;\n }\n\n if (publicId instanceof _imageSource.default) {\n this._poster = publicId;\n return this;\n }\n\n var _normalizeOptions2 = (0, _common.normalizeOptions)(publicId, options, {\n tolerateMissingId: true\n });\n\n publicId = _normalizeOptions2.publicId;\n options = _normalizeOptions2.options;\n\n if (!publicId) {\n publicId = this.publicId();\n options = (0, _assign.assign)({}, options, _audioSource.DEFAULT_POSTER_PARAMS);\n }\n\n options.cloudinaryConfig = options.cloudinaryConfig || this.cloudinaryConfig();\n this._poster = new _imageSource.default(publicId, options);\n return this;\n }\n }, {\n key: \"generateSources\",\n value: function generateSources() {\n var _this2 = this;\n\n return this.sourceTypes().map(function (sourceType) {\n if (sourceType === 'audio') {\n var format = 'mp3';\n var opts = {};\n var srcTransformation = _this2.sourceTransformation()[sourceType] || [_this2.transformation()];\n\n if (srcTransformation) {\n opts.transformation = srcTransformation;\n }\n\n (0, _assign.assign)(opts, {\n resource_type: 'video',\n format: format\n });\n var queryString = _this2.queryParams() ? (0, _querystring.objectToQuerystring)(_this2.queryParams()) : '';\n var src = \"\".concat(_this2.config().url(_this2.publicId(), opts)).concat(queryString);\n var type = 'video/mp4';\n return {\n type: type,\n src: src,\n cldSrc: _this2,\n poster: _this2.getPoster().url()\n };\n } else {\n return null;\n }\n }, this);\n }\n }]);\n\n return AudioSource;\n}(_videoSource.default);\n\nvar _default = AudioSource;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./plugins/cloudinary/models/audio-source/audio-source.js?");
|
|
856
867
|
|
|
857
868
|
/***/ }),
|
|
858
869
|
|
|
@@ -900,7 +911,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
900
911
|
/***/ (function(module, exports, __webpack_require__) {
|
|
901
912
|
|
|
902
913
|
"use strict";
|
|
903
|
-
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 = void 0;\n\nvar _baseSource = _interopRequireDefault(__webpack_require__(/*! ../base-source */ \"./plugins/cloudinary/models/base-source.js\"));\n\nvar _imageSource = _interopRequireDefault(__webpack_require__(/*! ../image-source */ \"./plugins/cloudinary/models/image-source.js\"));\n\nvar _common = __webpack_require__(/*! ../../common */ \"./plugins/cloudinary/common.js\");\n\nvar _slicing = __webpack_require__(/*! utils/slicing */ \"./utils/slicing.js\");\n\nvar _assign = __webpack_require__(/*! utils/assign */ \"./utils/assign.js\");\n\nvar _querystring = __webpack_require__(/*! utils/querystring */ \"./utils/querystring.js\");\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\nvar _videoSource = __webpack_require__(/*! ./video-source.const */ \"./plugins/cloudinary/models/video-source/video-source.const.js\");\n\nvar _videoSource2 = __webpack_require__(/*! ./video-source.utils */ \"./plugins/cloudinary/models/video-source/video-source.utils.js\");\n\nvar _array = __webpack_require__(/*! ../../../../utils/array */ \"./utils/array.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure 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 _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 _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\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 objectId = 0;\n\nvar generateId = function generateId() {\n return objectId++;\n};\n\nvar VideoSource = /*#__PURE__*/function (_BaseSource) {\n _inherits(VideoSource, _BaseSource);\n\n var _super = _createSuper(VideoSource);\n\n function VideoSource(_publicId) {\n var _this;\n\n var initOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, VideoSource);\n\n var isRawUrl = _videoSource.URL_PATTERN.test(_publicId);\n\n var _normalizeOptions = (0, _common.normalizeOptions)(_publicId, initOptions),\n publicId = _normalizeOptions.publicId,\n options = _normalizeOptions.options;\n\n if (!isRawUrl) {\n publicId = publicId.replace(_videoSource.VIDEO_SUFFIX_REMOVAL_PATTERN, '');\n }\n\n options = (0, _assign.assign)({}, _videoSource.DEFAULT_VIDEO_PARAMS, options);\n\n if (!options.poster) {\n options.poster = (0, _assign.assign)({\n publicId: publicId\n }, _videoSource.DEFAULT_POSTER_PARAMS);\n }\n\n var _sliceAndUnsetPropert = (0, _slicing.sliceAndUnsetProperties)(options, 'poster', 'sourceTypes', 'sourceTransformation', 'info', 'recommendations', 'textTracks', 'withCredentials', 'interactionAreas'),\n poster = _sliceAndUnsetPropert.poster,\n sourceTypes = _sliceAndUnsetPropert.sourceTypes,\n sourceTransformation = _sliceAndUnsetPropert.sourceTransformation,\n info = _sliceAndUnsetPropert.info,\n recommendations = _sliceAndUnsetPropert.recommendations,\n textTracks = _sliceAndUnsetPropert.textTracks,\n withCredentials = _sliceAndUnsetPropert.withCredentials,\n interactionAreas = _sliceAndUnsetPropert.interactionAreas;\n\n _this = _super.call(this, publicId, options);\n _this._sourceTypes = null;\n _this._recommendations = null;\n _this._textTracks = null;\n _this._poster = null;\n _this._info = null;\n _this._sourceTransformation = null;\n _this._interactionAreas = null;\n _this._type = 'VideoSource';\n _this.isRawUrl = isRawUrl;\n _this._rawTransformation = options.raw_transformation;\n _this.withCredentials = !!withCredentials;\n\n _this.getInitOptions = function () {\n return initOptions;\n };\n\n _this.poster(poster);\n\n _this.sourceTypes(sourceTypes);\n\n _this.sourceTransformation(sourceTransformation);\n\n _this.info(info);\n\n _this.interactionAreas(interactionAreas);\n\n _this.recommendations(recommendations);\n\n _this.textTracks(textTracks);\n\n _this.objectId = generateId();\n return _this;\n }\n\n _createClass(VideoSource, [{\n key: \"textTracks\",\n value: function textTracks(_textTracks) {\n if (_textTracks === undefined) {\n return this._textTracks;\n }\n\n this._textTracks = _textTracks;\n return this;\n }\n }, {\n key: \"recommendations\",\n value: function recommendations(recommends) {\n if (recommends === undefined) {\n return this._recommendations;\n }\n\n this._recommendations = recommends;\n return this;\n }\n }, {\n key: \"sourceTypes\",\n value: function sourceTypes(types) {\n if (!types) {\n return this._sourceTypes;\n }\n\n this._sourceTypes = types;\n return this;\n }\n }, {\n key: \"info\",\n value: function info(_info) {\n if (!_info) {\n return this._info;\n }\n\n this._info = _info;\n return this;\n }\n }, {\n key: \"interactionAreas\",\n value: function interactionAreas(_interactionAreas) {\n if (!_interactionAreas) {\n return this._interactionAreas;\n }\n\n this._interactionAreas = _interactionAreas;\n return this;\n }\n }, {\n key: \"sourceTransformation\",\n value: function sourceTransformation(trans) {\n if (!trans) {\n return this._sourceTransformation;\n }\n\n this._sourceTransformation = trans;\n return this;\n }\n }, {\n key: \"poster\",\n value: function poster(publicId) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (!publicId) {\n return this._poster;\n }\n\n if (publicId instanceof _imageSource.default) {\n this._poster = publicId;\n return this;\n }\n\n var _normalizeOptions2 = (0, _common.normalizeOptions)(publicId, options, {\n tolerateMissingId: true\n });\n\n publicId = _normalizeOptions2.publicId;\n options = _normalizeOptions2.options;\n\n if (!publicId) {\n publicId = this.publicId();\n options = (0, _assign.assign)({}, options, _videoSource.DEFAULT_POSTER_PARAMS);\n }\n\n options.cloudinaryConfig = options.cloudinaryConfig || this.cloudinaryConfig();\n this._poster = new _imageSource.default(publicId, options);\n return this;\n }\n }, {\n key: \"contains\",\n value: function contains(source) {\n var sources = this.generateSources();\n return sources.some(function (_source) {\n return (0, _common.isSrcEqual)(_source, source);\n });\n }\n }, {\n key: \"generateSources\",\n value: function generateSources() {\n var _this2 = this;\n\n if (this.isRawUrl) {\n var type = this.sourceTypes().length > 1 ? null : this.sourceTypes()[0];\n return [this.generateRawSource(this.publicId(), type)];\n }\n\n var srcs = this.sourceTypes().map(function (sourceType) {\n var srcTransformation = _this2.sourceTransformation()[sourceType] || _this2.transformation();\n\n var format = (0, _videoSource2.normalizeFormat)(sourceType);\n var isAdaptive = ['mpd', 'm3u8'].indexOf(format) !== -1;\n var opts = {};\n\n if (srcTransformation) {\n opts.transformation = (0, _array.castArray)(srcTransformation);\n }\n\n (0, _assign.assign)(opts, {\n resource_type: 'video',\n format: format\n });\n\n var _formatToMimeTypeAndT = (0, _videoSource2.formatToMimeTypeAndTransformation)(sourceType),\n _formatToMimeTypeAndT2 = _slicedToArray(_formatToMimeTypeAndT, 2),\n type = _formatToMimeTypeAndT2[0],\n codecTrans = _formatToMimeTypeAndT2[1]; // If user's transformation include video_codec then don't add another video codec to transformation\n\n\n if (codecTrans && !(0, _videoSource2.isCodecAlreadyExist)(opts.transformation, _this2._rawTransformation)) {\n opts.transformation.push(codecTrans);\n }\n\n if (opts.format === 'auto') {\n delete opts.format;\n }\n\n var queryString = _this2.queryParams() ? (0, _querystring.objectToQuerystring)(_this2.queryParams()) : '';\n\n var src = _this2.config().url(_this2.publicId(), opts); // if src is a url that already contains query params then replace '?' with '&'\n\n\n var params = src.indexOf('?') > -1 ? queryString.replace('?', '&') : queryString;\n return {\n type: type,\n src: src + params,\n cldSrc: _this2,\n isAdaptive: isAdaptive,\n withCredentials: _this2.withCredentials\n };\n });\n var isIe = typeof navigator !== 'undefined' && (/MSIE/.test(navigator.userAgent) || /Trident\\//.test(navigator.appVersion));\n\n if (isIe) {\n return srcs.filter(function (s) {\n return s.type !== 'video/mp4; codec=\"hev1.1.6.L93.B0\"';\n });\n } else if (_video.default.browser.IS_ANY_SAFARI) {\n // filter out dash on safari\n return srcs.filter(function (s) {\n return s.type.indexOf('application/dash+xml') === -1;\n });\n } else {\n return srcs;\n }\n }\n }, {\n key: \"generateRawSource\",\n value: function generateRawSource(url, type) {\n var t = type || url.split('.').pop();\n var isAdaptive = !!_videoSource.CONTAINER_MIME_TYPES[t];\n\n if (isAdaptive) {\n type = _videoSource.CONTAINER_MIME_TYPES[t][0];\n } else {\n type = type ? \"video/\".concat(type) : null;\n }\n\n return {\n type: type,\n src: url,\n cldSrc: this,\n isAdaptive: isAdaptive,\n withCredentials: this.withCredentials\n };\n }\n }, {\n key: \"getInteractionAreas\",\n value: function getInteractionAreas() {\n return this._interactionAreas;\n }\n }]);\n\n return VideoSource;\n}(_baseSource.default);\n\nvar _default = VideoSource;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./plugins/cloudinary/models/video-source/video-source.js?");
|
|
914
|
+
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 = void 0;\n\nvar _baseSource = _interopRequireDefault(__webpack_require__(/*! ../base-source */ \"./plugins/cloudinary/models/base-source.js\"));\n\nvar _imageSource = _interopRequireDefault(__webpack_require__(/*! ../image-source */ \"./plugins/cloudinary/models/image-source.js\"));\n\nvar _common = __webpack_require__(/*! ../../common */ \"./plugins/cloudinary/common.js\");\n\nvar _slicing = __webpack_require__(/*! utils/slicing */ \"./utils/slicing.js\");\n\nvar _assign = __webpack_require__(/*! utils/assign */ \"./utils/assign.js\");\n\nvar _querystring = __webpack_require__(/*! utils/querystring */ \"./utils/querystring.js\");\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\nvar _videoSource = __webpack_require__(/*! ./video-source.const */ \"./plugins/cloudinary/models/video-source/video-source.const.js\");\n\nvar _videoSource2 = __webpack_require__(/*! ./video-source.utils */ \"./plugins/cloudinary/models/video-source/video-source.utils.js\");\n\nvar _array = __webpack_require__(/*! ../../../../utils/array */ \"./utils/array.js\");\n\nvar _consts = __webpack_require__(/*! ../../../../utils/consts */ \"./utils/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure 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 _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 _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\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 objectId = 0;\n\nvar generateId = function generateId() {\n return objectId++;\n};\n\nvar VideoSource = /*#__PURE__*/function (_BaseSource) {\n _inherits(VideoSource, _BaseSource);\n\n var _super = _createSuper(VideoSource);\n\n function VideoSource(_publicId) {\n var _this;\n\n var initOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, VideoSource);\n\n var isRawUrl = _videoSource.URL_PATTERN.test(_publicId);\n\n var _normalizeOptions = (0, _common.normalizeOptions)(_publicId, initOptions),\n publicId = _normalizeOptions.publicId,\n options = _normalizeOptions.options;\n\n if (!isRawUrl) {\n publicId = publicId.replace(_videoSource.VIDEO_SUFFIX_REMOVAL_PATTERN, '');\n }\n\n options = (0, _assign.assign)({}, _videoSource.DEFAULT_VIDEO_PARAMS, options);\n\n if (!options.poster) {\n options.poster = (0, _assign.assign)({\n publicId: publicId\n }, _videoSource.DEFAULT_POSTER_PARAMS);\n }\n\n var _sliceAndUnsetPropert = (0, _slicing.sliceAndUnsetProperties)(options, 'poster', 'sourceTypes', 'sourceTransformation', 'info', 'recommendations', 'textTracks', 'withCredentials', 'interactionAreas'),\n poster = _sliceAndUnsetPropert.poster,\n sourceTypes = _sliceAndUnsetPropert.sourceTypes,\n sourceTransformation = _sliceAndUnsetPropert.sourceTransformation,\n info = _sliceAndUnsetPropert.info,\n recommendations = _sliceAndUnsetPropert.recommendations,\n textTracks = _sliceAndUnsetPropert.textTracks,\n withCredentials = _sliceAndUnsetPropert.withCredentials,\n interactionAreas = _sliceAndUnsetPropert.interactionAreas;\n\n _this = _super.call(this, publicId, options);\n _this._sourceTypes = null;\n _this._recommendations = null;\n _this._textTracks = null;\n _this._poster = null;\n _this._info = null;\n _this._sourceTransformation = null;\n _this._interactionAreas = null;\n _this._type = _consts.SOURCE_TYPE.VIDEO;\n _this.isRawUrl = isRawUrl;\n _this._rawTransformation = options.raw_transformation;\n _this.withCredentials = !!withCredentials;\n\n _this.getInitOptions = function () {\n return initOptions;\n };\n\n _this.poster(poster);\n\n _this.sourceTypes(sourceTypes);\n\n _this.sourceTransformation(sourceTransformation);\n\n _this.info(info);\n\n _this.interactionAreas(interactionAreas);\n\n _this.recommendations(recommendations);\n\n _this.textTracks(textTracks);\n\n _this.objectId = generateId();\n return _this;\n }\n\n _createClass(VideoSource, [{\n key: \"textTracks\",\n value: function textTracks(_textTracks) {\n if (_textTracks === undefined) {\n return this._textTracks;\n }\n\n this._textTracks = _textTracks;\n return this;\n }\n }, {\n key: \"recommendations\",\n value: function recommendations(recommends) {\n if (recommends === undefined) {\n return this._recommendations;\n }\n\n this._recommendations = recommends;\n return this;\n }\n }, {\n key: \"sourceTypes\",\n value: function sourceTypes(types) {\n if (!types) {\n return this._sourceTypes;\n }\n\n this._sourceTypes = types;\n return this;\n }\n }, {\n key: \"info\",\n value: function info(_info) {\n if (!_info) {\n return this._info;\n }\n\n this._info = _info;\n return this;\n }\n }, {\n key: \"interactionAreas\",\n value: function interactionAreas(_interactionAreas) {\n if (!_interactionAreas) {\n return this._interactionAreas;\n }\n\n this._interactionAreas = _interactionAreas;\n return this;\n }\n }, {\n key: \"sourceTransformation\",\n value: function sourceTransformation(trans) {\n if (!trans) {\n return this._sourceTransformation;\n }\n\n this._sourceTransformation = trans;\n return this;\n }\n }, {\n key: \"poster\",\n value: function poster(publicId) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (!publicId) {\n return this._poster;\n }\n\n if (publicId instanceof _imageSource.default) {\n this._poster = publicId;\n return this;\n }\n\n var _normalizeOptions2 = (0, _common.normalizeOptions)(publicId, options, {\n tolerateMissingId: true\n });\n\n publicId = _normalizeOptions2.publicId;\n options = _normalizeOptions2.options;\n\n if (!publicId) {\n publicId = this.publicId();\n options = (0, _assign.assign)({}, options, _videoSource.DEFAULT_POSTER_PARAMS);\n }\n\n options.cloudinaryConfig = options.cloudinaryConfig || this.cloudinaryConfig();\n this._poster = new _imageSource.default(publicId, options);\n return this;\n }\n }, {\n key: \"contains\",\n value: function contains(source) {\n var sources = this.generateSources();\n return sources.some(function (_source) {\n return (0, _common.isSrcEqual)(_source, source);\n });\n }\n }, {\n key: \"generateSources\",\n value: function generateSources() {\n var _this2 = this;\n\n if (this.isRawUrl) {\n var type = this.sourceTypes().length > 1 ? null : this.sourceTypes()[0];\n return [this.generateRawSource(this.publicId(), type)];\n }\n\n var srcs = this.sourceTypes().map(function (sourceType) {\n var srcTransformation = _this2.sourceTransformation()[sourceType] || _this2.transformation();\n\n var format = (0, _videoSource2.normalizeFormat)(sourceType);\n var isAdaptive = ['mpd', 'm3u8'].indexOf(format) !== -1;\n var opts = {};\n\n if (srcTransformation) {\n opts.transformation = (0, _array.castArray)(srcTransformation);\n }\n\n (0, _assign.assign)(opts, {\n resource_type: 'video',\n format: format\n });\n\n var _formatToMimeTypeAndT = (0, _videoSource2.formatToMimeTypeAndTransformation)(sourceType),\n _formatToMimeTypeAndT2 = _slicedToArray(_formatToMimeTypeAndT, 2),\n type = _formatToMimeTypeAndT2[0],\n codecTrans = _formatToMimeTypeAndT2[1]; // If user's transformation include video_codec then don't add another video codec to transformation\n\n\n if (codecTrans && !(0, _videoSource2.isCodecAlreadyExist)(opts.transformation, _this2._rawTransformation)) {\n opts.transformation.push(codecTrans);\n }\n\n if (opts.format === 'auto') {\n delete opts.format;\n }\n\n var queryString = _this2.queryParams() ? (0, _querystring.objectToQuerystring)(_this2.queryParams()) : '';\n\n var src = _this2.config().url(_this2.publicId(), opts); // if src is a url that already contains query params then replace '?' with '&'\n\n\n var params = src.indexOf('?') > -1 ? queryString.replace('?', '&') : queryString;\n return {\n type: type,\n src: src + params,\n cldSrc: _this2,\n isAdaptive: isAdaptive,\n withCredentials: _this2.withCredentials\n };\n });\n var isIe = typeof navigator !== 'undefined' && (/MSIE/.test(navigator.userAgent) || /Trident\\//.test(navigator.appVersion));\n\n if (isIe) {\n return srcs.filter(function (s) {\n return s.type !== 'video/mp4; codec=\"hev1.1.6.L93.B0\"';\n });\n } else if (_video.default.browser.IS_ANY_SAFARI) {\n // filter out dash on safari\n return srcs.filter(function (s) {\n return s.type.indexOf('application/dash+xml') === -1;\n });\n } else {\n return srcs;\n }\n }\n }, {\n key: \"generateRawSource\",\n value: function generateRawSource(url, type) {\n var t = type || url.split('.').pop();\n var isAdaptive = !!_videoSource.CONTAINER_MIME_TYPES[t];\n\n if (isAdaptive) {\n type = _videoSource.CONTAINER_MIME_TYPES[t][0];\n } else {\n type = type ? \"video/\".concat(type) : null;\n }\n\n return {\n type: type,\n src: url,\n cldSrc: this,\n isAdaptive: isAdaptive,\n withCredentials: this.withCredentials\n };\n }\n }, {\n key: \"getInteractionAreas\",\n value: function getInteractionAreas() {\n return this._interactionAreas;\n }\n }]);\n\n return VideoSource;\n}(_baseSource.default);\n\nvar _default = VideoSource;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./plugins/cloudinary/models/video-source/video-source.js?");
|
|
904
915
|
|
|
905
916
|
/***/ }),
|
|
906
917
|
|
|
@@ -972,7 +983,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
972
983
|
/***/ (function(module, exports, __webpack_require__) {
|
|
973
984
|
|
|
974
985
|
"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.
|
|
986
|
+
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.3\" + '</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
987
|
|
|
977
988
|
/***/ }),
|
|
978
989
|
|
|
@@ -1120,6 +1131,18 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
1120
1131
|
|
|
1121
1132
|
/***/ }),
|
|
1122
1133
|
|
|
1134
|
+
/***/ "./utils/consts.js":
|
|
1135
|
+
/*!*************************!*\
|
|
1136
|
+
!*** ./utils/consts.js ***!
|
|
1137
|
+
\*************************/
|
|
1138
|
+
/*! no static exports found */
|
|
1139
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1140
|
+
|
|
1141
|
+
"use strict";
|
|
1142
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.SOURCE_TYPE = exports.PLAYER_EVENT = void 0;\nvar PLAYER_EVENT = {\n PLAY: 'play',\n PLAYING: 'playing',\n PAUSE: 'pause',\n SEEK: 'seek',\n SEEKING: 'seeking',\n MUTE: 'mute',\n UNMUTE: 'unmute',\n PAUSE_NO_SEEK: 'pausenoseek',\n ERROR: 'error',\n TIME_UPDATE: 'timeupdate',\n RETRY_PLAYLIST: 'retryplaylist',\n CAN_PLAY_THROUGH: 'canplaythrough',\n CLD_SOURCE_CHANGED: 'cldsourcechanged',\n SOURCE_CHANGED: 'sourcechanged',\n LOADED_METADATA: 'loadedmetadata',\n LOADED_DATA: 'loadeddata',\n REFRESH_TEXT_TRACKS: 'refreshTextTracks',\n PLAYLIST_CREATED: 'playlistcreated',\n UP_COMING_VIDEO_SHOW: 'upcomingvideoshow',\n UP_COMING_VIDEO_HIDE: 'upcomingvideohide',\n PLAYLIST_ITEM_CHANGED: 'playlistitemchanged',\n VOLUME_CHANGE: 'volumechange',\n FLUID: 'fluid',\n PLAYLIST_PANEL: 'PlaylistPanel',\n ENDED: 'ended',\n RESIZE: 'resize',\n START: 'start',\n VIDEO_LOAD: 'videoload',\n PRODUCT_BAR_MIN: 'productBarMin',\n SHOW_PRODUCTS_OVERLAY: 'showProductsOverlay',\n SHOPPABLE_ITEM_CHANGED: 'shoppableitemchanged',\n FULL_SCREEN_CHANGE: 'fullscreenchange',\n PERCENTS_PLAYED: 'percentsplayed',\n TIME_PLAYED: 'timeplayed',\n PLAYER_LOAD: 'playerload',\n DISPOSE: 'dispose',\n QUALITY_CHANGED: 'qualitychanged'\n};\nexports.PLAYER_EVENT = PLAYER_EVENT;\nvar SOURCE_TYPE = {\n AUDIO: 'AudioSource',\n VIDEO: 'VideoSource'\n};\nexports.SOURCE_TYPE = SOURCE_TYPE;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./utils/consts.js?");
|
|
1143
|
+
|
|
1144
|
+
/***/ }),
|
|
1145
|
+
|
|
1123
1146
|
/***/ "./utils/css-prefix.js":
|
|
1124
1147
|
/*!*****************************!*\
|
|
1125
1148
|
!*** ./utils/css-prefix.js ***!
|
|
@@ -1216,6 +1239,18 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
1216
1239
|
|
|
1217
1240
|
/***/ }),
|
|
1218
1241
|
|
|
1242
|
+
/***/ "./utils/object.js":
|
|
1243
|
+
/*!*************************!*\
|
|
1244
|
+
!*** ./utils/object.js ***!
|
|
1245
|
+
\*************************/
|
|
1246
|
+
/*! no static exports found */
|
|
1247
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1248
|
+
|
|
1249
|
+
"use strict";
|
|
1250
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.get = void 0;\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\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 _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 _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\n/**\n * a nested value from an object\n * @param {object} value - a object you want to get a nested value from\n * @param {string} path - path to the nested value, key separated by . (dots)\n * @param {any} defaultValue - a default Value in case the value is not defined\n * @returns a nested value from an object / array\n */\nvar get = function get(value, path, defaultValue) {\n if (value && _typeof(value) === 'object') {\n var keysArray = path.split('.');\n var getValue = value;\n\n var _iterator = _createForOfIteratorHelper(keysArray),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var objectValue = _step.value;\n\n if (Object.prototype.hasOwnProperty.call(getValue, objectValue) && getValue[objectValue] !== undefined) {\n getValue = getValue[objectValue];\n } else {\n return defaultValue;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return getValue;\n }\n\n return defaultValue;\n};\n\nexports.get = get;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./utils/object.js?");
|
|
1251
|
+
|
|
1252
|
+
/***/ }),
|
|
1253
|
+
|
|
1219
1254
|
/***/ "./utils/playButton.js":
|
|
1220
1255
|
/*!*****************************!*\
|
|
1221
1256
|
!*** ./utils/playButton.js ***!
|
|
@@ -1368,7 +1403,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
1368
1403
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1369
1404
|
|
|
1370
1405
|
"use strict";
|
|
1371
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\n__webpack_require__(/*! ./components */ \"./components/index.js\");\n\nvar _plugins = _interopRequireDefault(__webpack_require__(/*! ./plugins */ \"./plugins/index.js\"));\n\nvar _utils = _interopRequireDefault(__webpack_require__(/*! ./utils */ \"./utils/index.js\"));\n\nvar _defaults = _interopRequireDefault(__webpack_require__(/*! ./config/defaults */ \"./config/defaults.js\"));\n\nvar _eventable = _interopRequireDefault(__webpack_require__(/*! ./mixins/eventable */ \"./mixins/eventable.js\"));\n\nvar _extendedEvents = _interopRequireDefault(__webpack_require__(/*! ./extended-events */ \"./extended-events.js\"));\n\nvar _playlistWidget = _interopRequireDefault(__webpack_require__(/*! ./components/playlist/playlist-widget */ \"./components/playlist/playlist-widget.js\"));\n\nvar _videoSource = _interopRequireDefault(__webpack_require__(/*! ./plugins/cloudinary/models/video-source/video-source */ \"./plugins/cloudinary/models/video-source/video-source.js\"));\n\nvar _typeInference = __webpack_require__(/*! ./utils/type-inference */ \"./utils/type-inference.js\");\n\nvar _videoPlayer = __webpack_require__(/*! ./video-player.utils */ \"./video-player.utils.js\");\n\nvar _videoPlayer2 = __webpack_require__(/*! ./video-player.const */ \"./video-player.const.js\");\n\nvar _validatorsFunctions = __webpack_require__(/*! ./validators/validators-functions */ \"./validators/validators-functions.js\");\n\nvar _validators = __webpack_require__(/*! ./validators/validators */ \"./validators/validators.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\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\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\n// Register all plugins\nObject.keys(_plugins.default).forEach(function (key) {\n _video.default.registerPlugin(key, _plugins.default[key]);\n});\n(0, _videoPlayer.overrideDefaultVideojsComponents)();\nvar _allowUsageReport = true;\n\nvar VideoPlayer = /*#__PURE__*/function (_Utils$mixin) {\n _inherits(VideoPlayer, _Utils$mixin);\n\n var _super = _createSuper(VideoPlayer);\n\n function VideoPlayer(elem, initOptions, ready) {\n var _this;\n\n _classCallCheck(this, VideoPlayer);\n\n _this = _super.call(this);\n _this._playlistWidget = null;\n _this.nbCalls = 0;\n _this._firstPlayed = false;\n _this.videoElement = (0, _videoPlayer.getResolveVideoElement)(elem);\n _this.options = (0, _videoPlayer.extractOptions)(_this.videoElement, initOptions);\n _this._videojsOptions = _this.options.videojsOptions; // Make sure to add 'video-js' class before creating videojs instance\n\n _this.videoElement.classList.add('video-js'); // Handle WebFont loading\n\n\n _utils.default.fontFace(_this.videoElement, _this.playerOptions); // Handle play button options\n\n\n _utils.default.playButton(_this.videoElement, _this._videojsOptions); // Dash plugin - available in full (not light) build only\n\n\n if (_plugins.default.dashPlugin) {\n _plugins.default.dashPlugin();\n }\n\n _this.videojs = (0, _video.default)(_this.videoElement, _this._videojsOptions); // to do, should be change by isValidConfig\n\n _this._isPlayerConfigValid = true;\n (0, _validatorsFunctions.isValidConfig)(_this.options, _validators.playerValidators);\n\n if (!_this._isPlayerConfigValid) {\n _this.videojs.error('invalid player configuration');\n\n return _possibleConstructorReturn(_this);\n }\n\n if (_this._videojsOptions.muted) {\n _this.videojs.volume(0.4);\n }\n\n if (_this.playerOptions.fluid) {\n _this.fluid(_this.playerOptions.fluid);\n }\n /* global google */\n\n\n var loaded = {\n contribAdsLoaded: (0, _typeInference.isFunction)(_this.videojs.ads),\n imaAdsLoaded: (typeof google === \"undefined\" ? \"undefined\" : _typeof(google)) === 'object' && _typeof(google.ima) === 'object'\n }; // #if (!process.env.WEBPACK_BUILD_LIGHT)\n // this.interactionArea = interactionAreaService(this, this.playerOptions, this._videojsOptions);\n // #endif\n\n _this._setCssClasses();\n\n _this._initPlugins(loaded);\n\n _this._initPlaylistWidget();\n\n _this._initJumpButtons();\n\n _this._setVideoJsListeners(ready);\n\n return _this;\n }\n\n _createClass(VideoPlayer, [{\n key: \"_setVideoJsListeners\",\n value: function _setVideoJsListeners(ready) {\n var _this2 = this;\n\n this.videojs.on('error', function () {\n var error = _this2.videojs.error();\n\n if (error) {\n var type = _this2._isPlayerConfigValid && _this2.videojs.cloudinary.currentSourceType();\n\n if (error.code === 4 && (type === 'VideoSource' || type === 'AudioSource')) {\n _this2.videojs.error(null);\n\n _utils.default.handleCldError(_this2, _this2.playerOptions);\n } else {\n _this2.videojs.clearTimeout(_this2.reTryId);\n }\n }\n });\n this.videojs.on('play', function () {\n _this2.videojs.clearTimeout(_this2.reTryId);\n });\n this.videojs.on('canplaythrough', function () {\n _this2.videojs.clearTimeout(_this2.reTryId);\n });\n this.videojs.ready(function () {\n _this2._onReady();\n\n if (ready) {\n ready(_this2);\n } // #if (!process.env.WEBPACK_BUILD_LIGHT)\n // this.interactionArea.init();\n // #endif\n\n });\n\n if (this.adsEnabled && Object.keys(this.playerOptions.ads).length > 0 && _typeof(this.videojs.ima) === 'object') {\n if (this.playerOptions.ads.adsInPlaylist === 'first-video') {\n this.videojs.one('sourcechanged', function () {\n _this2.videojs.ima.playAd();\n });\n } else {\n this.videojs.on('sourcechanged', function () {\n _this2.videojs.ima.playAd();\n });\n }\n }\n }\n }, {\n key: \"_initPlugins\",\n value: function _initPlugins(loaded) {\n // #if (!process.env.WEBPACK_BUILD_LIGHT)\n // this.adsEnabled = this._initIma(loaded);\n // #endif\n this._initAutoplay();\n\n this._initContextMenu();\n\n this._initPerSrcBehaviors();\n\n this._initCloudinary();\n\n this._initAnalytics();\n\n this._initFloatingPlayer();\n\n this._initColors();\n\n this._initTextTracks();\n\n this._initSeekThumbs();\n }\n }, {\n key: \"_isFullScreen\",\n value: function _isFullScreen() {\n return this.videojs.player().isFullscreen();\n }\n }, {\n key: \"_initIma\",\n value: function _initIma(loaded) {\n if (!loaded.contribAdsLoaded || !loaded.imaAdsLoaded) {\n if (this.playerOptions.ads) {\n if (!loaded.contribAdsLoaded) {\n console.log('contribAds is not loaded');\n }\n\n if (!loaded.imaAdsLoaded) {\n console.log('imaSdk is not loaded');\n }\n }\n\n return false;\n }\n\n if (!this.playerOptions.ads) {\n this.playerOptions.ads = {};\n }\n\n var opts = this.playerOptions.ads;\n\n if (Object.keys(opts).length === 0) {\n return false;\n }\n\n this.videojs.ima({\n id: this.el().id,\n adTagUrl: opts.adTagUrl,\n disableFlashAds: true,\n prerollTimeout: opts.prerollTimeout || 5000,\n postrollTimeout: opts.postrollTimeout || 5000,\n showCountdown: opts.showCountdown !== false,\n adLabel: opts.adLabel || 'Advertisement',\n locale: opts.locale || 'en',\n autoPlayAdBreaks: opts.autoPlayAdBreaks !== false,\n debug: true\n });\n return true;\n }\n }, {\n key: \"setTextTracks\",\n value: function setTextTracks(conf) {\n // remove current text tracks\n var currentTracks = this.videojs.remoteTextTracks();\n\n if (currentTracks) {\n for (var i = currentTracks.tracks_.length - 1; i >= 0; i--) {\n this.videojs.removeRemoteTextTrack(currentTracks.tracks_[i]);\n }\n }\n\n if (conf) {\n var tracks = Object.keys(conf);\n var allTracks = [];\n\n for (var _i = 0, _tracks = tracks; _i < _tracks.length; _i++) {\n var track = _tracks[_i];\n\n if (Array.isArray(conf[track])) {\n var trks = conf[track];\n\n for (var _i2 = 0; _i2 < trks.length; _i2++) {\n allTracks.push(VideoPlayer.buildTextTrackObj(track, trks[_i2]));\n }\n } else {\n allTracks.push(VideoPlayer.buildTextTrackObj(track, conf[track]));\n }\n }\n\n _utils.default.filterAndAddTextTracks(allTracks, this.videojs);\n }\n }\n }, {\n key: \"_initSeekThumbs\",\n value: function _initSeekThumbs() {\n var _this3 = this;\n\n if (this.playerOptions.seekThumbnails) {\n this.videojs.on('cldsourcechanged', function (e, _ref) {\n var source = _ref.source;\n\n // Bail if...\n if (source.getType() === 'AudioSource' || // it's an audio player\n _this3.videojs && _this3.videojs.activePlugins_ && _this3.videojs.activePlugins_.vr // It's a VR (i.e. 360) video\n ) {\n return;\n }\n\n var cloudinaryConfig = source.cloudinaryConfig();\n var publicId = source.publicId();\n var transformations = source.transformation().toOptions();\n\n if (transformations && transformations.streaming_profile) {\n delete transformations.streaming_profile;\n }\n\n transformations.flags = transformations.flags || [];\n transformations.flags.push('sprite'); // build VTT url\n\n var vttSrc = cloudinaryConfig.video_url(publicId + '.vtt', {\n transformation: transformations\n }); // vttThumbnails must be called differently on init and on source update.\n\n if ((0, _typeInference.isFunction)(_this3.videojs.vttThumbnails)) {\n _this3.videojs.vttThumbnails({\n src: vttSrc\n });\n } else {\n _this3.videojs.vttThumbnails.src(vttSrc);\n }\n });\n }\n }\n }, {\n key: \"_initColors\",\n value: function _initColors() {\n this.videojs.colors(this.playerOptions.colors ? {\n 'colors': this.playerOptions.colors\n } : {});\n } // #if (!process.env.WEBPACK_BUILD_LIGHT)\n // _initQualitySelector() {\n // if (this._videojsOptions.controlBar && this.playerOptions.qualitySelector !== false) {\n // if (videojs.browser.IE_VERSION === null) {\n // this.videojs.httpSourceSelector({ default: 'auto' });\n // }\n // \n // this.videojs.on('loadedmetadata', () => {\n // qualitySelector.init(this.videojs);\n // });\n // \n // // Show only if more then one option available\n // this.videojs.on('loadeddata', () => {\n // qualitySelector.setVisibility(this.videojs);\n // });\n // }\n // }\n // #endif\n\n }, {\n key: \"_initTextTracks\",\n value: function _initTextTracks() {\n var _this4 = this;\n\n this.videojs.on('refreshTextTracks', function (e, tracks) {\n _this4.setTextTracks(tracks);\n });\n }\n }, {\n key: \"_initPerSrcBehaviors\",\n value: function _initPerSrcBehaviors() {\n if (this.videojs.perSourceBehaviors) {\n this.videojs.perSourceBehaviors();\n }\n }\n }, {\n key: \"_initJumpButtons\",\n value: function _initJumpButtons() {\n if (!this.playerOptions.showJumpControls && this.videojs.controlBar) {\n this.videojs.controlBar.removeChild('JumpForwardButton');\n this.videojs.controlBar.removeChild('JumpBackButton');\n }\n }\n }, {\n key: \"_initCloudinary\",\n value: function _initCloudinary() {\n var opts = this.playerOptions.cloudinary;\n opts.chainTarget = this;\n\n if (opts.secure !== false) {\n this.playerOptions.cloudinary.cloudinaryConfig.config('secure', true);\n }\n\n this.videojs.cloudinary(this.playerOptions.cloudinary);\n }\n }, {\n key: \"_initAnalytics\",\n value: function _initAnalytics() {\n var analyticsOpts = this.playerOptions.analytics;\n\n if (!window.ga && analyticsOpts) {\n console.error('Google Analytics script is missing');\n return;\n }\n\n if (analyticsOpts) {\n var opts = _typeof(analyticsOpts) === 'object' ? analyticsOpts : {};\n this.videojs.analytics(opts);\n }\n }\n }, {\n key: \"reTryVideo\",\n value: function reTryVideo(maxNumberOfCalls, timeout) {\n var _this5 = this;\n\n if (!this.isVideoReady()) {\n if (this.nbCalls < maxNumberOfCalls) {\n this.nbCalls++;\n this.reTryId = this.videojs.setTimeout(function () {\n return _this5.reTryVideo(maxNumberOfCalls, timeout);\n }, timeout);\n } else {\n var e = new Error('Video is not ready please try later');\n this.videojs.trigger('error', e);\n }\n }\n }\n }, {\n key: \"isVideoReady\",\n value: function isVideoReady() {\n var s = this.videojs.readyState();\n\n if (s >= (/iPad|iPhone|iPod/.test(navigator.userAgent) ? 1 : 4)) {\n this.nbCalls = 0;\n return true;\n }\n\n return false;\n }\n }, {\n key: \"_initPlaylistWidget\",\n value: function _initPlaylistWidget() {\n var _this6 = this;\n\n this.videojs.on('playlistcreated', function () {\n if (_this6._playlistWidget) {\n _this6._playlistWidget.dispose();\n }\n\n var plwOptions = _this6.playerOptions.playlistWidget;\n\n if ((0, _typeInference.isPlainObject)(plwOptions)) {\n if (_this6.playerOptions.fluid) {\n plwOptions.fluid = true;\n }\n\n if (_this6.playerOptions.cloudinary.fontFace) {\n plwOptions.fontFace = _this6.playerOptions.cloudinary.fontFace;\n }\n\n _this6._playlistWidget = new _playlistWidget.default(_this6.videojs, plwOptions);\n }\n });\n }\n }, {\n key: \"playlistWidget\",\n value: function playlistWidget(options) {\n if (!options && !this._playlistWidget) {\n return false;\n }\n\n if (!options && this._playlistWidget) {\n return this._playlistWidget;\n }\n\n if ((0, _typeInference.isPlainObject)(options)) {\n this._playlistWidget.options(options);\n }\n\n return this._playlistWidget;\n }\n }, {\n key: \"_initAutoplay\",\n value: function _initAutoplay() {\n var autoplayMode = this.playerOptions.autoplayMode;\n\n if (autoplayMode === 'on-scroll') {\n this.videojs.autoplayOnScroll();\n }\n }\n }, {\n key: \"_initContextMenu\",\n value: function _initContextMenu() {\n if (!this.playerOptions.hideContextMenu) {\n this.videojs.contextMenu(_defaults.default.contextMenu);\n }\n }\n }, {\n key: \"_initFloatingPlayer\",\n value: function _initFloatingPlayer() {\n if (this.playerOptions.floatingWhenNotVisible !== _videoPlayer2.FLOATING_TO.NONE) {\n this.videojs.floatingPlayer({\n 'floatTo': this.playerOptions.floatingWhenNotVisible\n });\n }\n }\n }, {\n key: \"_setCssClasses\",\n value: function _setCssClasses() {\n this.videojs.addClass(_utils.default.CLASS_PREFIX);\n this.videojs.addClass(_utils.default.playerClassPrefix(this.videojs));\n\n _utils.default.setSkinClassPrefix(this.videojs, _utils.default.skinClassPrefix(this.videojs));\n\n if (_video.default.browser.IE_VERSION === 11) {\n this.videojs.addClass('cld-ie11');\n }\n }\n }, {\n key: \"_onReady\",\n value: function _onReady() {\n this._setExtendedEvents(); // Load first video (mainly to support video tag 'source' and 'public-id' attributes)\n\n\n var source = this.playerOptions.source || this.playerOptions.publicId;\n\n if (source) {\n this.source(source, this.playerOptions);\n }\n }\n }, {\n key: \"_setExtendedEvents\",\n value: function _setExtendedEvents() {\n var _this7 = this;\n\n var events = [];\n\n if (this.playerOptions.playedEventPercents) {\n events.push({\n type: 'percentsplayed',\n percents: this.playerOptions.playedEventPercents\n });\n }\n\n if (this.playerOptions.playedEventTimes) {\n events.push({\n type: 'timeplayed',\n times: this.playerOptions.playedEventTimes\n });\n }\n\n events.push.apply(events, ['seek', 'mute', 'unmute', 'qualitychanged']);\n var extendedEvents = new _extendedEvents.default(this.videojs, {\n events: events\n });\n Object.keys(extendedEvents.events).forEach(function (_event) {\n var handler = function handler(event, data) {\n _this7.videojs.trigger({\n type: _event,\n eventData: data\n });\n };\n\n extendedEvents.on(_event, handler);\n });\n }\n }, {\n key: \"cloudinaryConfig\",\n value: function cloudinaryConfig(config) {\n return this.videojs.cloudinary.cloudinaryConfig(config);\n }\n }, {\n key: \"playerOptions\",\n get: function get() {\n return this.options.playerOptions;\n }\n }, {\n key: \"currentPublicId\",\n value: function currentPublicId() {\n return this.videojs.cloudinary.currentPublicId();\n }\n }, {\n key: \"currentSourceUrl\",\n value: function currentSourceUrl() {\n return this.videojs.currentSource().src;\n }\n }, {\n key: \"currentPoster\",\n value: function currentPoster() {\n return this.videojs.cloudinary.currentPoster();\n }\n }, {\n key: \"source\",\n value: function source(publicId) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (!this._isPlayerConfigValid) {\n return;\n }\n\n var isSourceConfigValid = (0, _validatorsFunctions.isValidConfig)(options, _validators.sourceValidators);\n\n if (!isSourceConfigValid) {\n this.videojs.error('invalid source configuration');\n return;\n }\n\n if (publicId instanceof _videoSource.default) {\n return this.videojs.cloudinary.source(publicId, options);\n } // Interactive plugin - available in full (not light) build only\n\n\n if (this.videojs.interactive) {\n this.videojs.interactive(this.videojs, options);\n }\n\n if (VideoPlayer.allowUsageReport()) {\n options.usageReport = true;\n }\n\n this.setTextTracks(options.textTracks); // #if (!process.env.WEBPACK_BUILD_LIGHT)\n // this._initQualitySelector();\n // #endif\n\n clearTimeout(this.reTryId);\n this.nbCalls = 0;\n var maxTries = this.videojs.options_.maxTries || 3;\n var videoReadyTimeout = this.videojs.options_.videoTimeout || 55000;\n this.reTryVideo(maxTries, videoReadyTimeout);\n return this.videojs.cloudinary.source(publicId, options);\n }\n }, {\n key: \"posterOptions\",\n value: function posterOptions(options) {\n return this.videojs.cloudinary.posterOptions(options);\n }\n }, {\n key: \"skin\",\n value: function skin(name) {\n if (name !== undefined && (0, _typeInference.isString)(name)) {\n _utils.default.setSkinClassPrefix(this.videojs, name);\n\n var playlistWidget = this.playlistWidget();\n\n if (this.playlistWidget()) {\n playlistWidget.setSkin();\n }\n }\n\n return _utils.default.skinClassPrefix(this.videojs);\n }\n }, {\n key: \"playlist\",\n value: function playlist(sources) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return this.videojs.cloudinary.playlist(sources, options);\n }\n }, {\n key: \"playlistByTag\",\n value: function playlistByTag(tag) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return this.videojs.cloudinary.playlistByTag(tag, options);\n }\n }, {\n key: \"sourcesByTag\",\n value: function sourcesByTag(tag) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return this.videojs.cloudinary.sourcesByTag(tag, options);\n }\n }, {\n key: \"fluid\",\n value: function fluid(bool) {\n if (bool === undefined) {\n return this.videojs.fluid();\n }\n\n if (bool) {\n this.videojs.addClass(_videoPlayer2.FLUID_CLASS_NAME);\n } else {\n this.videojs.removeClass(_videoPlayer2.FLUID_CLASS_NAME);\n }\n\n this.videojs.fluid(bool);\n this.videojs.trigger('fluid', bool);\n return this;\n }\n }, {\n key: \"play\",\n value: function play() {\n this.playWasCalled = true;\n this.videojs.play();\n return this;\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.pause();\n this.currentTime(0);\n return this;\n }\n }, {\n key: \"playPrevious\",\n value: function playPrevious() {\n this.playlist().playPrevious();\n return this;\n }\n }, {\n key: \"playNext\",\n value: function playNext() {\n this.playlist().playNext();\n return this;\n }\n }, {\n key: \"transformation\",\n value: function transformation(trans) {\n return this.videojs.cloudinary.transformation(trans);\n }\n }, {\n key: \"sourceTypes\",\n value: function sourceTypes(types) {\n return this.videojs.cloudinary.sourceTypes(types);\n }\n }, {\n key: \"sourceTransformation\",\n value: function sourceTransformation(trans) {\n return this.videojs.cloudinary.sourceTransformation(trans);\n }\n }, {\n key: \"autoShowRecommendations\",\n value: function autoShowRecommendations(autoShow) {\n return this.videojs.cloudinary.autoShowRecommendations(autoShow);\n }\n }, {\n key: \"duration\",\n value: function duration() {\n return this.videojs.duration();\n }\n }, {\n key: \"height\",\n value: function height(dimension) {\n if (!dimension) {\n return this.videojs.height();\n }\n\n this.videojs.height(dimension);\n return this;\n }\n }, {\n key: \"width\",\n value: function width(dimension) {\n if (!dimension) {\n return this.videojs.width();\n }\n\n this.videojs.width(dimension);\n return this;\n }\n }, {\n key: \"volume\",\n value: function volume(_volume) {\n if (!_volume) {\n return this.videojs.volume();\n }\n\n this.videojs.volume(_volume);\n return this;\n }\n }, {\n key: \"mute\",\n value: function mute() {\n if (!this.isMuted()) {\n this.videojs.muted(true);\n }\n\n return this;\n }\n }, {\n key: \"unmute\",\n value: function unmute() {\n if (this.isMuted()) {\n this.videojs.muted(false);\n }\n\n return this;\n }\n }, {\n key: \"isMuted\",\n value: function isMuted() {\n return this.videojs.muted();\n }\n }, {\n key: \"pause\",\n value: function pause() {\n this.videojs.pause();\n return this;\n }\n }, {\n key: \"currentTime\",\n value: function currentTime(offsetSeconds) {\n if (!offsetSeconds && offsetSeconds !== 0) {\n return this.videojs.currentTime();\n }\n\n this.videojs.currentTime(offsetSeconds);\n return this;\n }\n }, {\n key: \"maximize\",\n value: function maximize() {\n if (!this.isMaximized()) {\n this.videojs.requestFullscreen();\n }\n\n return this;\n }\n }, {\n key: \"exitMaximize\",\n value: function exitMaximize() {\n if (this.isMaximized()) {\n this.videojs.exitFullscreen();\n }\n\n return this;\n }\n }, {\n key: \"isMaximized\",\n value: function isMaximized() {\n return this.videojs.isFullscreen();\n }\n }, {\n key: \"dispose\",\n value: function dispose() {\n this.videojs.dispose();\n }\n }, {\n key: \"controls\",\n value: function controls(bool) {\n if (bool === undefined) {\n return this.videojs.controls();\n }\n\n this.videojs.controls(bool);\n return this;\n }\n }, {\n key: \"ima\",\n value: function ima() {\n return {\n playAd: this.videojs.ima.playAd\n };\n }\n }, {\n key: \"loop\",\n value: function loop(bool) {\n if (bool === undefined) {\n return this.videojs.loop();\n }\n\n this.videojs.loop(bool);\n return this;\n }\n }, {\n key: \"el\",\n value: function el() {\n return this.videojs.el();\n }\n }], [{\n key: \"all\",\n value: function all(selector) {\n var nodeList = document.querySelectorAll(selector);\n var players = [];\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n for (var i = 0; i < nodeList.length; i++) {\n players.push(_construct(VideoPlayer, [nodeList[i]].concat(args)));\n }\n\n return players;\n }\n }, {\n key: \"allowUsageReport\",\n value: function allowUsageReport(bool) {\n if (bool === undefined) {\n return _allowUsageReport;\n }\n\n _allowUsageReport = !!bool;\n return _allowUsageReport;\n }\n }, {\n key: \"buildTextTrackObj\",\n value: function buildTextTrackObj(type, conf) {\n return {\n kind: type,\n label: conf.label,\n srclang: conf.language,\n default: !!conf.default,\n src: conf.url\n };\n }\n }]);\n\n return VideoPlayer;\n}(_utils.default.mixin(_eventable.default));\n\nvar _default = VideoPlayer;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./video-player.js?");
|
|
1406
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\n__webpack_require__(/*! ./components */ \"./components/index.js\");\n\nvar _plugins = _interopRequireDefault(__webpack_require__(/*! ./plugins */ \"./plugins/index.js\"));\n\nvar _utils = _interopRequireDefault(__webpack_require__(/*! ./utils */ \"./utils/index.js\"));\n\nvar _defaults = _interopRequireDefault(__webpack_require__(/*! ./config/defaults */ \"./config/defaults.js\"));\n\nvar _eventable = _interopRequireDefault(__webpack_require__(/*! ./mixins/eventable */ \"./mixins/eventable.js\"));\n\nvar _extendedEvents = _interopRequireDefault(__webpack_require__(/*! ./extended-events */ \"./extended-events.js\"));\n\nvar _playlistWidget = _interopRequireDefault(__webpack_require__(/*! ./components/playlist/playlist-widget */ \"./components/playlist/playlist-widget.js\"));\n\nvar _videoSource = _interopRequireDefault(__webpack_require__(/*! ./plugins/cloudinary/models/video-source/video-source */ \"./plugins/cloudinary/models/video-source/video-source.js\"));\n\nvar _typeInference = __webpack_require__(/*! ./utils/type-inference */ \"./utils/type-inference.js\");\n\nvar _videoPlayer = __webpack_require__(/*! ./video-player.utils */ \"./video-player.utils.js\");\n\nvar _videoPlayer2 = __webpack_require__(/*! ./video-player.const */ \"./video-player.const.js\");\n\nvar _validatorsFunctions = __webpack_require__(/*! ./validators/validators-functions */ \"./validators/validators-functions.js\");\n\nvar _validators = __webpack_require__(/*! ./validators/validators */ \"./validators/validators.js\");\n\nvar _object = __webpack_require__(/*! ./utils/object */ \"./utils/object.js\");\n\nvar _consts = __webpack_require__(/*! ./utils/consts */ \"./utils/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\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 _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\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\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n// Register all plugins\nObject.keys(_plugins.default).forEach(function (key) {\n _video.default.registerPlugin(key, _plugins.default[key]);\n});\n(0, _videoPlayer.overrideDefaultVideojsComponents)();\nvar _allowUsageReport = true;\n\nvar VideoPlayer = /*#__PURE__*/function (_Utils$mixin) {\n _inherits(VideoPlayer, _Utils$mixin);\n\n var _super = _createSuper(VideoPlayer);\n\n function VideoPlayer(elem, initOptions, ready) {\n var _this;\n\n _classCallCheck(this, VideoPlayer);\n\n _this = _super.call(this);\n\n _defineProperty(_assertThisInitialized(_this), \"_clearTimeOut\", function () {\n _this.videojs.clearTimeout(_this.reTryId);\n });\n\n _this._playlistWidget = null;\n _this.nbCalls = 0;\n _this.videoElement = (0, _videoPlayer.getResolveVideoElement)(elem);\n _this.options = (0, _videoPlayer.extractOptions)(_this.videoElement, initOptions);\n _this._videojsOptions = _this.options.videojsOptions; // Make sure to add 'video-js' class before creating videojs instance\n\n _this.videoElement.classList.add('video-js'); // Handle WebFont loading\n\n\n _utils.default.fontFace(_this.videoElement, _this.playerOptions); // Handle play button options\n\n\n _utils.default.playButton(_this.videoElement, _this._videojsOptions); // Dash plugin - available in full (not light) build only\n\n\n if (_plugins.default.dashPlugin) {\n _plugins.default.dashPlugin();\n }\n\n _this.videojs = (0, _video.default)(_this.videoElement, _this._videojsOptions); // to do, should be change by isValidConfig\n\n _this._isPlayerConfigValid = true;\n (0, _validatorsFunctions.isValidConfig)(_this.options, _validators.playerValidators);\n\n if (!_this._isPlayerConfigValid) {\n _this.videojs.error('invalid player configuration');\n\n return _possibleConstructorReturn(_this);\n }\n\n if (_this._videojsOptions.muted) {\n _this.videojs.volume(0.4);\n }\n\n if (_this.playerOptions.fluid) {\n _this.fluid(_this.playerOptions.fluid);\n }\n /* global google */\n\n\n var loaded = {\n contribAdsLoaded: (0, _typeInference.isFunction)(_this.videojs.ads),\n imaAdsLoaded: (typeof google === \"undefined\" ? \"undefined\" : _typeof(google)) === 'object' && _typeof(google.ima) === 'object'\n }; // #if (!process.env.WEBPACK_BUILD_LIGHT)\n // this.interactionArea = interactionAreaService(this, this.playerOptions, this._videojsOptions);\n // #endif\n\n _this._setCssClasses();\n\n _this._initPlugins(loaded);\n\n _this._initPlaylistWidget();\n\n _this._initJumpButtons();\n\n _this._setVideoJsListeners(ready);\n\n return _this;\n }\n\n _createClass(VideoPlayer, [{\n key: \"_setVideoJsListeners\",\n value: function _setVideoJsListeners(ready) {\n var _this2 = this;\n\n this.videojs.on(_consts.PLAYER_EVENT.ERROR, function () {\n var error = _this2.videojs.error();\n\n if (error) {\n var type = _this2._isPlayerConfigValid && _this2.videojs.cloudinary.currentSourceType();\n /*\n error codes :\n 3 - media playback was aborted due to a corruption problem\n 4 - media error, media source not supported\n */\n\n\n var isCorrupted = error.code === 3 && _video.default.browser.IS_SAFARI;\n\n if ([isCorrupted, error.code === 4].includes(true) && [_consts.SOURCE_TYPE.AUDIO, _consts.SOURCE_TYPE.VIDEO].includes(type)) {\n _this2.videojs.error(null);\n\n _utils.default.handleCldError(_this2, _this2.playerOptions);\n } else {\n _this2._clearTimeOut();\n }\n }\n });\n this.videojs.tech_.on(_consts.PLAYER_EVENT.RETRY_PLAYLIST, function () {\n var mediaRequestsErrored = (0, _object.get)(_this2.videojs, 'hls.stats.mediaRequestsErrored', 0);\n\n if (mediaRequestsErrored > 0) {\n _this2._clearTimeOut();\n\n _utils.default.handleCldError(_this2, _this2.playerOptions);\n }\n });\n this.videojs.on(_consts.PLAYER_EVENT.PLAY, this._clearTimeOut);\n this.videojs.on(_consts.PLAYER_EVENT.CAN_PLAY_THROUGH, this._clearTimeOut);\n this.videojs.ready(function () {\n _this2._onReady();\n\n if (ready) {\n ready(_this2);\n } // #if (!process.env.WEBPACK_BUILD_LIGHT)\n // this.interactionArea.init();\n // #endif\n\n });\n\n if (this.adsEnabled && Object.keys(this.playerOptions.ads).length > 0 && _typeof(this.videojs.ima) === 'object') {\n if (this.playerOptions.ads.adsInPlaylist === 'first-video') {\n this.videojs.one(_consts.PLAYER_EVENT.SOURCE_CHANGED, function () {\n _this2.videojs.ima.playAd();\n });\n } else {\n this.videojs.on(_consts.PLAYER_EVENT.SOURCE_CHANGED, function () {\n _this2.videojs.ima.playAd();\n });\n }\n }\n }\n }, {\n key: \"_initPlugins\",\n value: function _initPlugins(loaded) {\n // #if (!process.env.WEBPACK_BUILD_LIGHT)\n // this.adsEnabled = this._initIma(loaded);\n // #endif\n this._initAutoplay();\n\n this._initContextMenu();\n\n this._initPerSrcBehaviors();\n\n this._initCloudinary();\n\n this._initAnalytics();\n\n this._initFloatingPlayer();\n\n this._initColors();\n\n this._initTextTracks();\n\n this._initSeekThumbs();\n }\n }, {\n key: \"_isFullScreen\",\n value: function _isFullScreen() {\n return this.videojs.player().isFullscreen();\n }\n }, {\n key: \"_initIma\",\n value: function _initIma(loaded) {\n if (!loaded.contribAdsLoaded || !loaded.imaAdsLoaded) {\n if (this.playerOptions.ads) {\n if (!loaded.contribAdsLoaded) {\n console.log('contribAds is not loaded');\n }\n\n if (!loaded.imaAdsLoaded) {\n console.log('imaSdk is not loaded');\n }\n }\n\n return false;\n }\n\n if (!this.playerOptions.ads) {\n this.playerOptions.ads = {};\n }\n\n var opts = this.playerOptions.ads;\n\n if (Object.keys(opts).length === 0) {\n return false;\n }\n\n this.videojs.ima({\n id: this.el().id,\n adTagUrl: opts.adTagUrl,\n disableFlashAds: true,\n prerollTimeout: opts.prerollTimeout || 5000,\n postrollTimeout: opts.postrollTimeout || 5000,\n showCountdown: opts.showCountdown !== false,\n adLabel: opts.adLabel || 'Advertisement',\n locale: opts.locale || 'en',\n autoPlayAdBreaks: opts.autoPlayAdBreaks !== false,\n debug: true\n });\n return true;\n }\n }, {\n key: \"setTextTracks\",\n value: function setTextTracks(conf) {\n // remove current text tracks\n var currentTracks = this.videojs.remoteTextTracks();\n\n if (currentTracks) {\n for (var i = currentTracks.tracks_.length - 1; i >= 0; i--) {\n this.videojs.removeRemoteTextTrack(currentTracks.tracks_[i]);\n }\n }\n\n if (conf) {\n var tracks = Object.keys(conf);\n var allTracks = [];\n\n for (var _i = 0, _tracks = tracks; _i < _tracks.length; _i++) {\n var track = _tracks[_i];\n\n if (Array.isArray(conf[track])) {\n var trks = conf[track];\n\n for (var _i2 = 0; _i2 < trks.length; _i2++) {\n allTracks.push(VideoPlayer.buildTextTrackObj(track, trks[_i2]));\n }\n } else {\n allTracks.push(VideoPlayer.buildTextTrackObj(track, conf[track]));\n }\n }\n\n _utils.default.filterAndAddTextTracks(allTracks, this.videojs);\n }\n }\n }, {\n key: \"_initSeekThumbs\",\n value: function _initSeekThumbs() {\n var _this3 = this;\n\n if (this.playerOptions.seekThumbnails) {\n this.videojs.on(_consts.PLAYER_EVENT.CLD_SOURCE_CHANGED, function (e, _ref) {\n var source = _ref.source;\n\n if (source.getType() === _consts.SOURCE_TYPE.AUDIO || _this3.videojs && _this3.videojs.activePlugins_ && _this3.videojs.activePlugins_.vr // It's a VR (i.e. 360) video\n ) {\n return;\n }\n\n var cloudinaryConfig = source.cloudinaryConfig();\n var publicId = source.publicId();\n var transformations = source.transformation().toOptions();\n\n if (transformations && transformations.streaming_profile) {\n delete transformations.streaming_profile;\n }\n\n transformations.flags = transformations.flags || [];\n transformations.flags.push('sprite');\n var vttSrc = cloudinaryConfig.video_url(\"\".concat(publicId, \".vtt\"), {\n transformation: transformations\n }); // vttThumbnails must be called differently on init and on source update.\n\n (0, _typeInference.isFunction)(_this3.videojs.vttThumbnails) ? _this3.videojs.vttThumbnails({\n src: vttSrc\n }) : _this3.videojs.vttThumbnails.src(vttSrc);\n });\n }\n }\n }, {\n key: \"_initColors\",\n value: function _initColors() {\n this.videojs.colors(this.playerOptions.colors ? {\n colors: this.playerOptions.colors\n } : {});\n } // #if (!process.env.WEBPACK_BUILD_LIGHT)\n // _initQualitySelector() {\n // if (this._videojsOptions.controlBar && this.playerOptions.qualitySelector !== false) {\n // if (videojs.browser.IE_VERSION === null) {\n // this.videojs.httpSourceSelector({ default: 'auto' });\n // }\n // \n // this.videojs.on(PLAYER_EVENT.LOADED_METADATA, () => {\n // qualitySelector.init(this.videojs);\n // });\n // \n // // Show only if more then one option available\n // this.videojs.on(PLAYER_EVENT.LOADED_DATA, () => {\n // qualitySelector.setVisibility(this.videojs);\n // });\n // }\n // }\n // #endif\n\n }, {\n key: \"_initTextTracks\",\n value: function _initTextTracks() {\n var _this4 = this;\n\n this.videojs.on(_consts.PLAYER_EVENT.REFRESH_TEXT_TRACKS, function (e, tracks) {\n _this4.setTextTracks(tracks);\n });\n }\n }, {\n key: \"_initPerSrcBehaviors\",\n value: function _initPerSrcBehaviors() {\n if (this.videojs.perSourceBehaviors) {\n this.videojs.perSourceBehaviors();\n }\n }\n }, {\n key: \"_initJumpButtons\",\n value: function _initJumpButtons() {\n if (!this.playerOptions.showJumpControls && this.videojs.controlBar) {\n this.videojs.controlBar.removeChild('JumpForwardButton');\n this.videojs.controlBar.removeChild('JumpBackButton');\n }\n }\n }, {\n key: \"_initCloudinary\",\n value: function _initCloudinary() {\n var opts = this.playerOptions.cloudinary;\n opts.chainTarget = this;\n\n if (opts.secure !== false) {\n this.playerOptions.cloudinary.cloudinaryConfig.config('secure', true);\n }\n\n this.videojs.cloudinary(this.playerOptions.cloudinary);\n }\n }, {\n key: \"_initAnalytics\",\n value: function _initAnalytics() {\n var analyticsOpts = this.playerOptions.analytics;\n\n if (!window.ga && analyticsOpts) {\n console.error('Google Analytics script is missing');\n return;\n }\n\n if (analyticsOpts) {\n var opts = _typeof(analyticsOpts) === 'object' ? analyticsOpts : {};\n this.videojs.analytics(opts);\n }\n }\n }, {\n key: \"reTryVideo\",\n value: function reTryVideo(maxNumberOfCalls, timeout) {\n var _this5 = this;\n\n if (!this.isVideoReady()) {\n if (this.nbCalls < maxNumberOfCalls) {\n this.nbCalls++;\n this.reTryId = this.videojs.setTimeout(function () {\n return _this5.reTryVideo(maxNumberOfCalls, timeout);\n }, timeout);\n } else {\n var e = new Error('Video is not ready please try later');\n this.videojs.trigger('error', e);\n }\n }\n }\n }, {\n key: \"isVideoReady\",\n value: function isVideoReady() {\n var s = this.videojs.readyState();\n\n if (s >= (/iPad|iPhone|iPod/.test(navigator.userAgent) ? 1 : 4)) {\n this.nbCalls = 0;\n return true;\n }\n\n return false;\n }\n }, {\n key: \"_initPlaylistWidget\",\n value: function _initPlaylistWidget() {\n var _this6 = this;\n\n this.videojs.on(_consts.PLAYER_EVENT.PLAYLIST_CREATED, function () {\n if (_this6._playlistWidget) {\n _this6._playlistWidget.dispose();\n }\n\n var plwOptions = _this6.playerOptions.playlistWidget;\n\n if ((0, _typeInference.isPlainObject)(plwOptions)) {\n if (_this6.playerOptions.fluid) {\n plwOptions.fluid = true;\n }\n\n if (_this6.playerOptions.cloudinary.fontFace) {\n plwOptions.fontFace = _this6.playerOptions.cloudinary.fontFace;\n }\n\n _this6._playlistWidget = new _playlistWidget.default(_this6.videojs, plwOptions);\n }\n });\n }\n }, {\n key: \"playlistWidget\",\n value: function playlistWidget(options) {\n if (!options && !this._playlistWidget) {\n return false;\n }\n\n if (!options && this._playlistWidget) {\n return this._playlistWidget;\n }\n\n if ((0, _typeInference.isPlainObject)(options)) {\n this._playlistWidget.options(options);\n }\n\n return this._playlistWidget;\n }\n }, {\n key: \"_initAutoplay\",\n value: function _initAutoplay() {\n var autoplayMode = this.playerOptions.autoplayMode;\n\n if (autoplayMode === 'on-scroll') {\n this.videojs.autoplayOnScroll();\n }\n }\n }, {\n key: \"_initContextMenu\",\n value: function _initContextMenu() {\n if (!this.playerOptions.hideContextMenu) {\n this.videojs.contextMenu(_defaults.default.contextMenu);\n }\n }\n }, {\n key: \"_initFloatingPlayer\",\n value: function _initFloatingPlayer() {\n if (this.playerOptions.floatingWhenNotVisible !== _videoPlayer2.FLOATING_TO.NONE) {\n this.videojs.floatingPlayer({\n floatTo: this.playerOptions.floatingWhenNotVisible\n });\n }\n }\n }, {\n key: \"_setCssClasses\",\n value: function _setCssClasses() {\n this.videojs.addClass(_utils.default.CLASS_PREFIX);\n this.videojs.addClass(_utils.default.playerClassPrefix(this.videojs));\n\n _utils.default.setSkinClassPrefix(this.videojs, _utils.default.skinClassPrefix(this.videojs));\n\n if (_video.default.browser.IE_VERSION === 11) {\n this.videojs.addClass('cld-ie11');\n }\n }\n }, {\n key: \"_onReady\",\n value: function _onReady() {\n this._setExtendedEvents(); // Load first video (mainly to support video tag 'source' and 'public-id' attributes)\n\n\n var source = this.playerOptions.source || this.playerOptions.publicId;\n\n if (source) {\n this.source(source, this.playerOptions);\n }\n }\n }, {\n key: \"_setExtendedEvents\",\n value: function _setExtendedEvents() {\n var _this7 = this;\n\n var events = [];\n\n if (this.playerOptions.playedEventPercents) {\n events.push({\n type: _consts.PLAYER_EVENT.PERCENTS_PLAYED,\n percents: this.playerOptions.playedEventPercents\n });\n }\n\n if (this.playerOptions.playedEventTimes) {\n events.push({\n type: _consts.PLAYER_EVENT.TIME_PLAYED,\n times: this.playerOptions.playedEventTimes\n });\n }\n\n events.push.apply(events, [_consts.PLAYER_EVENT.SEEK, _consts.PLAYER_EVENT.MUTE, _consts.PLAYER_EVENT.UNMUTE, _consts.PLAYER_EVENT.QUALITY_CHANGED]);\n var extendedEvents = new _extendedEvents.default(this.videojs, {\n events: events\n });\n Object.keys(extendedEvents.events).forEach(function (_event) {\n var handler = function handler(event, data) {\n _this7.videojs.trigger({\n type: _event,\n eventData: data\n });\n };\n\n extendedEvents.on(_event, handler);\n });\n }\n }, {\n key: \"cloudinaryConfig\",\n value: function cloudinaryConfig(config) {\n return this.videojs.cloudinary.cloudinaryConfig(config);\n }\n }, {\n key: \"playerOptions\",\n get: function get() {\n return this.options.playerOptions;\n }\n }, {\n key: \"currentPublicId\",\n value: function currentPublicId() {\n return this.videojs.cloudinary.currentPublicId();\n }\n }, {\n key: \"currentSourceUrl\",\n value: function currentSourceUrl() {\n return this.videojs.currentSource().src;\n }\n }, {\n key: \"currentPoster\",\n value: function currentPoster() {\n return this.videojs.cloudinary.currentPoster();\n }\n }, {\n key: \"source\",\n value: function source(publicId) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (!this._isPlayerConfigValid) {\n return;\n }\n\n var isSourceConfigValid = (0, _validatorsFunctions.isValidConfig)(options, _validators.sourceValidators);\n\n if (!isSourceConfigValid) {\n this.videojs.error('invalid source configuration');\n return;\n }\n\n if (publicId instanceof _videoSource.default) {\n return this.videojs.cloudinary.source(publicId, options);\n } // Interactive plugin - available in full (not light) build only\n\n\n if (this.videojs.interactive) {\n this.videojs.interactive(this.videojs, options);\n }\n\n if (VideoPlayer.allowUsageReport()) {\n options.usageReport = true;\n }\n\n this.setTextTracks(options.textTracks); // #if (!process.env.WEBPACK_BUILD_LIGHT)\n // this._initQualitySelector();\n // #endif\n\n clearTimeout(this.reTryId);\n this.nbCalls = 0;\n var maxTries = this.videojs.options_.maxTries || 3;\n var videoReadyTimeout = this.videojs.options_.videoTimeout || 55000;\n this.reTryVideo(maxTries, videoReadyTimeout);\n return this.videojs.cloudinary.source(publicId, options);\n }\n }, {\n key: \"posterOptions\",\n value: function posterOptions(options) {\n return this.videojs.cloudinary.posterOptions(options);\n }\n }, {\n key: \"skin\",\n value: function skin(name) {\n if (name !== undefined && (0, _typeInference.isString)(name)) {\n _utils.default.setSkinClassPrefix(this.videojs, name);\n\n var playlistWidget = this.playlistWidget();\n\n if (this.playlistWidget()) {\n playlistWidget.setSkin();\n }\n }\n\n return _utils.default.skinClassPrefix(this.videojs);\n }\n }, {\n key: \"playlist\",\n value: function playlist(sources) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return this.videojs.cloudinary.playlist(sources, options);\n }\n }, {\n key: \"playlistByTag\",\n value: function playlistByTag(tag) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return this.videojs.cloudinary.playlistByTag(tag, options);\n }\n }, {\n key: \"sourcesByTag\",\n value: function sourcesByTag(tag) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return this.videojs.cloudinary.sourcesByTag(tag, options);\n }\n }, {\n key: \"fluid\",\n value: function fluid(bool) {\n if (bool === undefined) {\n return this.videojs.fluid();\n }\n\n if (bool) {\n this.videojs.addClass(_videoPlayer2.FLUID_CLASS_NAME);\n } else {\n this.videojs.removeClass(_videoPlayer2.FLUID_CLASS_NAME);\n }\n\n this.videojs.fluid(bool);\n this.videojs.trigger(_consts.PLAYER_EVENT.FLUID, bool);\n return this;\n }\n }, {\n key: \"play\",\n value: function play() {\n this.playWasCalled = true;\n this.videojs.play();\n return this;\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.pause();\n this.currentTime(0);\n return this;\n }\n }, {\n key: \"playPrevious\",\n value: function playPrevious() {\n this.playlist().playPrevious();\n return this;\n }\n }, {\n key: \"playNext\",\n value: function playNext() {\n this.playlist().playNext();\n return this;\n }\n }, {\n key: \"transformation\",\n value: function transformation(trans) {\n return this.videojs.cloudinary.transformation(trans);\n }\n }, {\n key: \"sourceTypes\",\n value: function sourceTypes(types) {\n return this.videojs.cloudinary.sourceTypes(types);\n }\n }, {\n key: \"sourceTransformation\",\n value: function sourceTransformation(trans) {\n return this.videojs.cloudinary.sourceTransformation(trans);\n }\n }, {\n key: \"autoShowRecommendations\",\n value: function autoShowRecommendations(autoShow) {\n return this.videojs.cloudinary.autoShowRecommendations(autoShow);\n }\n }, {\n key: \"duration\",\n value: function duration() {\n return this.videojs.duration();\n }\n }, {\n key: \"height\",\n value: function height(dimension) {\n if (!dimension) {\n return this.videojs.height();\n }\n\n this.videojs.height(dimension);\n return this;\n }\n }, {\n key: \"width\",\n value: function width(dimension) {\n if (!dimension) {\n return this.videojs.width();\n }\n\n this.videojs.width(dimension);\n return this;\n }\n }, {\n key: \"volume\",\n value: function volume(_volume) {\n if (!_volume) {\n return this.videojs.volume();\n }\n\n this.videojs.volume(_volume);\n return this;\n }\n }, {\n key: \"mute\",\n value: function mute() {\n if (!this.isMuted()) {\n this.videojs.muted(true);\n }\n\n return this;\n }\n }, {\n key: \"unmute\",\n value: function unmute() {\n if (this.isMuted()) {\n this.videojs.muted(false);\n }\n\n return this;\n }\n }, {\n key: \"isMuted\",\n value: function isMuted() {\n return this.videojs.muted();\n }\n }, {\n key: \"pause\",\n value: function pause() {\n this.videojs.pause();\n return this;\n }\n }, {\n key: \"currentTime\",\n value: function currentTime(offsetSeconds) {\n if (!offsetSeconds && offsetSeconds !== 0) {\n return this.videojs.currentTime();\n }\n\n this.videojs.currentTime(offsetSeconds);\n return this;\n }\n }, {\n key: \"maximize\",\n value: function maximize() {\n if (!this.isMaximized()) {\n this.videojs.requestFullscreen();\n }\n\n return this;\n }\n }, {\n key: \"exitMaximize\",\n value: function exitMaximize() {\n if (this.isMaximized()) {\n this.videojs.exitFullscreen();\n }\n\n return this;\n }\n }, {\n key: \"isMaximized\",\n value: function isMaximized() {\n return this.videojs.isFullscreen();\n }\n }, {\n key: \"dispose\",\n value: function dispose() {\n this.videojs.dispose();\n }\n }, {\n key: \"controls\",\n value: function controls(bool) {\n if (bool === undefined) {\n return this.videojs.controls();\n }\n\n this.videojs.controls(bool);\n return this;\n }\n }, {\n key: \"ima\",\n value: function ima() {\n return {\n playAd: this.videojs.ima.playAd\n };\n }\n }, {\n key: \"loop\",\n value: function loop(bool) {\n if (bool === undefined) {\n return this.videojs.loop();\n }\n\n this.videojs.loop(bool);\n return this;\n }\n }, {\n key: \"el\",\n value: function el() {\n return this.videojs.el();\n }\n }], [{\n key: \"all\",\n value: function all(selector) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var nodeList = document.querySelectorAll(selector);\n return _toConsumableArray(nodeList).map(function (node) {\n return _construct(VideoPlayer, [node].concat(args));\n });\n }\n }, {\n key: \"allowUsageReport\",\n value: function allowUsageReport(bool) {\n if (bool === undefined) {\n return _allowUsageReport;\n }\n\n _allowUsageReport = !!bool;\n return _allowUsageReport;\n }\n }, {\n key: \"buildTextTrackObj\",\n value: function buildTextTrackObj(type, conf) {\n return {\n kind: type,\n label: conf.label,\n srclang: conf.language,\n default: !!conf.default,\n src: conf.url\n };\n }\n }]);\n\n return VideoPlayer;\n}(_utils.default.mixin(_eventable.default));\n\nvar _default = VideoPlayer;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./video-player.js?");
|
|
1372
1407
|
|
|
1373
1408
|
/***/ }),
|
|
1374
1409
|
|
|
@@ -1380,7 +1415,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
1380
1415
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1381
1416
|
|
|
1382
1417
|
"use strict";
|
|
1383
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.overrideDefaultVideojsComponents = exports.extractOptions = exports.normalizeAutoplay = exports.getResolveVideoElement = exports.isLight = exports.addMetadataTrack = void 0;\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\nvar _utils = _interopRequireDefault(__webpack_require__(/*! ./utils */ \"./utils/index.js\"));\n\nvar _defaults = _interopRequireDefault(__webpack_require__(/*! ./config/defaults */ \"./config/defaults.js\"));\n\nvar _videoPlayer = __webpack_require__(/*! ./video-player.const */ \"./video-player.const.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 _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\nvar addMetadataTrack = function addMetadataTrack(videoJs, vttSource) {\n return videoJs.addRemoteTextTrack({\n kind: 'metadata',\n srclang: 'en',\n src: vttSource,\n default: true\n }, true).track;\n};\n\nexports.addMetadataTrack = addMetadataTrack;\n\nvar isLight = function isLight(opts) {\n return opts.class.indexOf('cld-video-player-skin-light') > -1 || opts.skin === 'light';\n};\n\nexports.isLight = isLight;\n\nvar getResolveVideoElement = function getResolveVideoElement(elem) {\n if ((0, _typeInference.isString)(elem)) {\n var id = elem; // Adjust for jQuery ID syntax\n\n if (id.indexOf('#') === 0) {\n id = id.slice(1);\n }\n\n try {\n elem = document.querySelector(\"#\".concat(id)) || _video.default.getPlayer(id);\n } catch (e) {\n elem = null;\n }\n\n if (!elem) {\n throw new Error(\"Could not find element with id \".concat(id));\n }\n }\n\n if (!elem.tagName) {\n throw new Error('Must specify either an element or an element id.');\n } else if (elem.tagName !== 'VIDEO') {\n throw new Error('Element is not a video tag.');\n }\n\n return elem;\n};\n\nexports.getResolveVideoElement = getResolveVideoElement;\n\nvar normalizeAutoplay = function normalizeAutoplay(options) {\n var autoplayMode = options.autoplayMode;\n\n if (autoplayMode) {\n switch (autoplayMode) {\n case _videoPlayer.AUTO_PLAY_MODE.ALWAYS:\n options.autoplay = true;\n break;\n\n case _videoPlayer.AUTO_PLAY_MODE.ON_SCROLL:\n case _videoPlayer.AUTO_PLAY_MODE.NEVER:\n default:\n options.autoplay = false;\n }\n }\n};\n\nexports.normalizeAutoplay = normalizeAutoplay;\n\nvar extractOptions = function extractOptions(elem, options) {\n var elemOptions = _utils.default.normalizeAttributes(elem);\n\n if (_video.default.dom.hasClass(elem, _videoPlayer.FLUID_CLASS_NAME) || _video.default.dom.hasClass(elem, 'vjs-fluid')) {\n options.fluid = true;\n } // Default HLS options < Default options < Markup options < Player options\n\n\n options = _utils.default.assign({}, _videoPlayer.DEFAULT_HLS_OPTIONS, _defaults.default, elemOptions, options); // In case of 'autoplay on scroll', we need to make sure normal HTML5 autoplay is off\n\n normalizeAutoplay(options); // VideoPlayer specific options\n\n var playerOptions = _utils.default.sliceAndUnsetProperties.apply(_utils.default, [options].concat(_toConsumableArray(_videoPlayer.PLAYER_PARAMS))); // Cloudinary plugin specific options\n\n\n playerOptions.cloudinary = _utils.default.sliceAndUnsetProperties.apply(_utils.default, [playerOptions].concat(_toConsumableArray(_videoPlayer.CLOUDINARY_PARAMS))); // Allow explicitly passing options to videojs using the `videojs` namespace, in order\n // to avoid param name conflicts:\n // VideoPlayer.new({ controls: true, videojs: { controls: false })\n\n if (options.videojs) {\n _utils.default.assign(options, options.videojs);\n\n delete options.videojs;\n }\n\n return {\n playerOptions: playerOptions,\n videojsOptions: options\n };\n};\n\nexports.extractOptions = extractOptions;\n\nvar overrideDefaultVideojsComponents = function overrideDefaultVideojsComponents() {\n var Player = _video.default.getComponent('Player');\n\n var children = Player.prototype.options_.children; // Add TitleBar as default\n\n children.push('titleBar');\n children.push('upcomingVideoOverlay');\n children.push('recommendationsOverlay');\n\n var ControlBar = _video.default.getComponent('ControlBar');\n\n if (ControlBar) {\n children = ControlBar.prototype.options_.children; // Add space instead of the progress control (which we deattached from the controlBar, and absolutely positioned it above it)\n // Also add a blank div underneath the progress control to stop bubbling up pointer events.\n\n children.splice(children.indexOf('progressControl'), 0, 'spacer', 'progressControlEventsBlocker'); // Add 'play-previous' and 'play-next' buttons around the 'play-toggle'\n\n children.splice(children.indexOf('playToggle'), 1, 'playlistPreviousButton', 'JumpBackButton', 'playToggle', 'JumpForwardButton', 'playlistNextButton'); // Position the 'logo-button' button right next to 'fullscreenToggle'\n\n children.splice(children.indexOf('fullscreenToggle'), 1, 'logoButton', 'fullscreenToggle');\n }\n};\n\nexports.overrideDefaultVideojsComponents = overrideDefaultVideojsComponents;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./video-player.utils.js?");
|
|
1418
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.overrideDefaultVideojsComponents = exports.extractOptions = exports.normalizeAutoplay = exports.getResolveVideoElement = exports.isLight = exports.addMetadataTrack = void 0;\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/alt/video.core.js-exposed\"));\n\nvar _utils = _interopRequireDefault(__webpack_require__(/*! ./utils */ \"./utils/index.js\"));\n\nvar _defaults = _interopRequireDefault(__webpack_require__(/*! ./config/defaults */ \"./config/defaults.js\"));\n\nvar _videoPlayer = __webpack_require__(/*! ./video-player.const */ \"./video-player.const.js\");\n\nvar _typeInference = __webpack_require__(/*! ./utils/type-inference */ \"./utils/type-inference.js\");\n\nvar _css = _interopRequireDefault(__webpack_require__(/*! css.escape */ \"../node_modules/css.escape/css.escape.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\nvar addMetadataTrack = function addMetadataTrack(videoJs, vttSource) {\n return videoJs.addRemoteTextTrack({\n kind: 'metadata',\n srclang: 'en',\n src: vttSource,\n default: true\n }, true).track;\n};\n\nexports.addMetadataTrack = addMetadataTrack;\n\nvar isLight = function isLight(opts) {\n return opts.class.indexOf('cld-video-player-skin-light') > -1 || opts.skin === 'light';\n};\n\nexports.isLight = isLight;\n\nvar getResolveVideoElement = function getResolveVideoElement(elem) {\n if ((0, _typeInference.isString)(elem)) {\n var id = elem; // Adjust for jQuery ID syntax\n\n if (id.indexOf('#') === 0) {\n id = id.slice(1);\n }\n\n try {\n elem = document.querySelector(\"#\".concat((0, _css.default)(id))) || _video.default.getPlayer(id);\n } catch (e) {\n elem = null;\n }\n\n if (!elem) {\n throw new Error(\"Could not find element with id \".concat(id));\n }\n }\n\n if (!elem.tagName) {\n throw new Error('Must specify either an element or an element id.');\n } else if (elem.tagName !== 'VIDEO') {\n throw new Error('Element is not a video tag.');\n }\n\n return elem;\n};\n\nexports.getResolveVideoElement = getResolveVideoElement;\n\nvar normalizeAutoplay = function normalizeAutoplay(options) {\n var autoplayMode = options.autoplayMode;\n\n if (autoplayMode) {\n switch (autoplayMode) {\n case _videoPlayer.AUTO_PLAY_MODE.ALWAYS:\n options.autoplay = true;\n break;\n\n case _videoPlayer.AUTO_PLAY_MODE.ON_SCROLL:\n case _videoPlayer.AUTO_PLAY_MODE.NEVER:\n default:\n options.autoplay = false;\n }\n }\n};\n\nexports.normalizeAutoplay = normalizeAutoplay;\n\nvar extractOptions = function extractOptions(elem, options) {\n var elemOptions = _utils.default.normalizeAttributes(elem);\n\n if (_video.default.dom.hasClass(elem, _videoPlayer.FLUID_CLASS_NAME) || _video.default.dom.hasClass(elem, 'vjs-fluid')) {\n options.fluid = true;\n } // Default HLS options < Default options < Markup options < Player options\n\n\n options = _utils.default.assign({}, _videoPlayer.DEFAULT_HLS_OPTIONS, _defaults.default, elemOptions, options); // In case of 'autoplay on scroll', we need to make sure normal HTML5 autoplay is off\n\n normalizeAutoplay(options); // VideoPlayer specific options\n\n var playerOptions = _utils.default.sliceAndUnsetProperties.apply(_utils.default, [options].concat(_toConsumableArray(_videoPlayer.PLAYER_PARAMS))); // Cloudinary plugin specific options\n\n\n playerOptions.cloudinary = _utils.default.sliceAndUnsetProperties.apply(_utils.default, [playerOptions].concat(_toConsumableArray(_videoPlayer.CLOUDINARY_PARAMS))); // Allow explicitly passing options to videojs using the `videojs` namespace, in order\n // to avoid param name conflicts:\n // VideoPlayer.new({ controls: true, videojs: { controls: false })\n\n if (options.videojs) {\n _utils.default.assign(options, options.videojs);\n\n delete options.videojs;\n }\n\n return {\n playerOptions: playerOptions,\n videojsOptions: options\n };\n};\n\nexports.extractOptions = extractOptions;\n\nvar overrideDefaultVideojsComponents = function overrideDefaultVideojsComponents() {\n var Player = _video.default.getComponent('Player');\n\n var children = Player.prototype.options_.children; // Add TitleBar as default\n\n children.push('titleBar');\n children.push('upcomingVideoOverlay');\n children.push('recommendationsOverlay');\n\n var ControlBar = _video.default.getComponent('ControlBar');\n\n if (ControlBar) {\n children = ControlBar.prototype.options_.children; // Add space instead of the progress control (which we deattached from the controlBar, and absolutely positioned it above it)\n // Also add a blank div underneath the progress control to stop bubbling up pointer events.\n\n children.splice(children.indexOf('progressControl'), 0, 'spacer', 'progressControlEventsBlocker'); // Add 'play-previous' and 'play-next' buttons around the 'play-toggle'\n\n children.splice(children.indexOf('playToggle'), 1, 'playlistPreviousButton', 'JumpBackButton', 'playToggle', 'JumpForwardButton', 'playlistNextButton'); // Position the 'logo-button' button right next to 'fullscreenToggle'\n\n children.splice(children.indexOf('fullscreenToggle'), 1, 'logoButton', 'fullscreenToggle');\n }\n};\n\nexports.overrideDefaultVideojsComponents = overrideDefaultVideojsComponents;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./video-player.utils.js?");
|
|
1384
1419
|
|
|
1385
1420
|
/***/ }),
|
|
1386
1421
|
|