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
package/dist/cld-video-player.js
CHANGED
|
@@ -385,6 +385,17 @@ eval("/* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. an
|
|
|
385
385
|
|
|
386
386
|
/***/ }),
|
|
387
387
|
|
|
388
|
+
/***/ "../node_modules/css.escape/css.escape.js":
|
|
389
|
+
/*!************************************************!*\
|
|
390
|
+
!*** ../node_modules/css.escape/css.escape.js ***!
|
|
391
|
+
\************************************************/
|
|
392
|
+
/*! no static exports found */
|
|
393
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
394
|
+
|
|
395
|
+
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?");
|
|
396
|
+
|
|
397
|
+
/***/ }),
|
|
398
|
+
|
|
388
399
|
/***/ "../node_modules/dashjs/build/es5/externals/base64.js":
|
|
389
400
|
/*!************************************************************!*\
|
|
390
401
|
!*** ../node_modules/dashjs/build/es5/externals/base64.js ***!
|
|
@@ -3901,7 +3912,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
3901
3912
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3902
3913
|
|
|
3903
3914
|
"use strict";
|
|
3904
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.interactionAreaService = void 0;\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/video.es.js-exposed\"));\n\nvar _interactionArea = __webpack_require__(/*! ./interaction-area.const */ \"./components/interaction-area/interaction-area.const.js\");\n\nvar _interactionArea2 = __webpack_require__(/*! ./interaction-area.utils */ \"./components/interaction-area/interaction-area.utils.js\");\n\nvar _dom = __webpack_require__(/*! ../../utils/dom */ \"./utils/dom.js\");\n\nvar _time = __webpack_require__(/*! ../../utils/time */ \"./utils/time.js\");\n\nvar _object = __webpack_require__(/*! ../../utils/object */ \"./utils/object.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\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar interactionAreaService = function interactionAreaService(player, playerOptions, videojsOptions) {\n var
|
|
3915
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.interactionAreaService = void 0;\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/video.es.js-exposed\"));\n\nvar _interactionArea = __webpack_require__(/*! ./interaction-area.const */ \"./components/interaction-area/interaction-area.const.js\");\n\nvar _interactionArea2 = __webpack_require__(/*! ./interaction-area.utils */ \"./components/interaction-area/interaction-area.utils.js\");\n\nvar _dom = __webpack_require__(/*! ../../utils/dom */ \"./utils/dom.js\");\n\nvar _time = __webpack_require__(/*! ../../utils/time */ \"./utils/time.js\");\n\nvar _object = __webpack_require__(/*! ../../utils/object */ \"./utils/object.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 _consts = __webpack_require__(/*! ../../utils/consts */ \"./utils/consts.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar interactionAreaService = function interactionAreaService(player, playerOptions, videojsOptions) {\n var isZoomed = false;\n var currentTrack = null;\n var unZoom = _typeInference.noop;\n\n var shouldLayoutMessage = function shouldLayoutMessage() {\n return (0, _interactionArea2.shouldShowAreaLayoutMessage)(videojsOptions.interactionDisplay);\n };\n\n function isInteractionAreasEnabled() {\n var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var interactionAreasConfig = getInteractionAreasConfig();\n return enabled || interactionAreasConfig && interactionAreasConfig.enable;\n }\n\n function setAreasPositionListener() {\n currentTrack && player.videojs.removeRemoteTextTrack(currentTrack);\n var isEnabled = isInteractionAreasEnabled();\n var interactionAreasConfig = getInteractionAreasConfig();\n\n if (!isEnabled || isZoomed) {\n return null;\n }\n\n if (Array.isArray(interactionAreasConfig.template)) {\n addInteractionAreasItems(interactionAreasConfig.template);\n setContainerSize();\n } else {\n var vttUrl = interactionAreasConfig.vttUrl || _interactionArea.TEMPLATE_INTERACTION_AREAS_VTT[interactionAreasConfig.template];\n\n if (vttUrl) {\n currentTrack = (0, _videoPlayer.addMetadataTrack)(player.videojs, vttUrl);\n addCueListener(currentTrack);\n }\n }\n }\n\n function setGoBackButton() {\n var button = (0, _dom.createElement)('div', {\n 'class': 'go-back-button'\n });\n button.addEventListener('click', function () {\n unZoom();\n }, false);\n var tracksContainer = (0, _dom.createElement)('div', {\n 'class': _interactionArea.INTERACTION_AREAS_CONTAINER_CLASS_NAME\n }, button);\n (0, _interactionArea2.setInteractionAreasContainer)(player.videojs, tracksContainer);\n }\n\n function getInteractionAreasConfig() {\n var _player$videojs$curre = player.videojs.currentSource(),\n cldSrc = _player$videojs$curre.cldSrc;\n\n return cldSrc && cldSrc.getInteractionAreas();\n }\n\n function removeLayoutMessage() {\n (0, _interactionArea2.removeInteractionAreasContainer)(player.videojs);\n setAreasPositionListener();\n player.play();\n }\n\n function setLayoutMessage() {\n if (!isInteractionAreasEnabled()) {\n return;\n }\n\n if (shouldLayoutMessage()) {\n var layoutMessageTimout = null;\n var showItAgainCheckbox = (0, _object.get)(videojsOptions, 'interactionDisplay.layout.showAgain', false);\n player.pause();\n (0, _interactionArea2.createInteractionAreaLayoutMessage)(player.videojs, function () {\n clearTimeout(layoutMessageTimout);\n removeLayoutMessage();\n }, showItAgainCheckbox);\n\n if (!showItAgainCheckbox) {\n layoutMessageTimout = setTimeout(removeLayoutMessage, _interactionArea.CLOSE_INTERACTION_AREA_LAYOUT_DELAY);\n }\n } else {\n removeLayoutMessage();\n }\n }\n\n function init() {\n if (isInteractionAreasEnabled()) {\n player.videojs.el().classList.add('interaction-areas');\n player.videojs.one(_consts.PLAYER_EVENT.PLAY, function () {\n setLayoutMessage();\n });\n\n var _setInteractionAreasContainerSize = (0, _time.throttle)(setContainerSize, 100);\n\n player.videojs.on(_consts.PLAYER_EVENT.FULL_SCREEN_CHANGE, function () {\n // waiting for fullscreen will end\n setTimeout(_setInteractionAreasContainerSize, 100);\n });\n var resizeDestroy = (0, _dom.addEventListener)(window, 'resize', setContainerSize, false);\n player.videojs.on(_consts.PLAYER_EVENT.DISPOSE, resizeDestroy);\n }\n\n player.videojs.on(_consts.PLAYER_EVENT.ENDED, function () {\n unZoom();\n });\n player.videojs.on(_consts.PLAYER_EVENT.ERROR, function () {\n player.pause();\n });\n }\n\n function onZoom(src, newOption, item) {\n var currentSource = player.videojs.currentSource();\n var cldSrc = currentSource.cldSrc;\n var currentSrcOptions = cldSrc.getInitOptions();\n var option = newOption || {\n transformation: currentSrcOptions.transformation.toOptions()\n };\n var transformation = !src && (0, _interactionArea2.getZoomTransformation)(player.videoElement, item);\n var sourceOptions = transformation ? _video.default.mergeOptions({\n transformation: transformation\n }, option) : option;\n var newSource = cldSrc.isRawUrl ? currentSource.src : {\n publicId: cldSrc.publicId()\n };\n player.source(transformation ? {\n publicId: cldSrc.publicId()\n } : src, sourceOptions).play();\n isZoomed = true;\n setGoBackButton();\n\n unZoom = function unZoom() {\n if (isZoomed) {\n isZoomed = false;\n player.source(newSource, currentSrcOptions).play();\n setAreasPositionListener();\n }\n };\n }\n\n function onInteractionAreasClick(_ref) {\n var event = _ref.event,\n item = _ref.item,\n index = _ref.index;\n var interactionAreasConfig = getInteractionAreasConfig();\n interactionAreasConfig.onClick && interactionAreasConfig.onClick({\n item: item,\n index: index,\n event: event,\n zoom: function zoom(source, option) {\n onZoom(source, option, item);\n }\n });\n }\n\n function addInteractionAreasItems(interactionAreasData, previousInteractionAreasData) {\n var durationTime = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var configs = {\n playerOptions: playerOptions,\n videojsOptions: videojsOptions\n };\n\n if (previousInteractionAreasData) {\n (0, _interactionArea2.updateInteractionAreasItem)(player.videojs, configs, interactionAreasData, previousInteractionAreasData, durationTime, onInteractionAreasClick);\n } else {\n var interactionAreasItems = interactionAreasData.map(function (item, index) {\n return (0, _interactionArea2.getInteractionAreaItem)(configs, item, index, durationTime, function (event) {\n onInteractionAreasClick({\n event: event,\n item: item,\n index: index\n });\n });\n });\n (0, _interactionArea2.setInteractionAreasContainer)(player.videojs, (0, _dom.createElement)('div', {\n 'class': _interactionArea.INTERACTION_AREAS_CONTAINER_CLASS_NAME\n }, interactionAreasItems));\n }\n }\n\n function setContainerSize() {\n if (isInteractionAreasEnabled()) {\n (0, _interactionArea2.setInteractionAreasContainerSize)(player.videojs, player.videoElement);\n }\n }\n\n function addCueListener(track) {\n if (!track) {\n return;\n }\n\n var previousTracksData = null;\n track.addEventListener('cuechange', function () {\n var activeCue = track.activeCues && track.activeCues[0];\n\n if (activeCue) {\n var durationTime = Math.max(Math.floor((activeCue.endTime - activeCue.startTime) * 1000), _interactionArea.DEFAULT_INTERACTION_ARE_TRANSITION);\n var tracksData = JSON.parse(activeCue.text);\n addInteractionAreasItems(tracksData, previousTracksData, durationTime);\n !previousTracksData && setContainerSize();\n previousTracksData = tracksData;\n } else {\n (0, _interactionArea2.removeInteractionAreasContainer)(player.videojs);\n previousTracksData = null;\n }\n });\n }\n\n return {\n init: init\n };\n};\n\nexports.interactionAreaService = interactionAreaService;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./components/interaction-area/interaction-area.service.js?");
|
|
3905
3916
|
|
|
3906
3917
|
/***/ }),
|
|
3907
3918
|
|
|
@@ -3985,7 +3996,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
3985
3996
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3986
3997
|
|
|
3987
3998
|
"use strict";
|
|
3988
|
-
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/video.es.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?");
|
|
3999
|
+
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/video.es.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?");
|
|
3989
4000
|
|
|
3990
4001
|
/***/ }),
|
|
3991
4002
|
|
|
@@ -4045,7 +4056,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol
|
|
|
4045
4056
|
/***/ (function(module, exports, __webpack_require__) {
|
|
4046
4057
|
|
|
4047
4058
|
"use strict";
|
|
4048
|
-
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/video.es.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(
|
|
4059
|
+
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/video.es.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?");
|
|
4049
4060
|
|
|
4050
4061
|
/***/ }),
|
|
4051
4062
|
|
|
@@ -4069,7 +4080,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol
|
|
|
4069
4080
|
/***/ (function(module, exports, __webpack_require__) {
|
|
4070
4081
|
|
|
4071
4082
|
"use strict";
|
|
4072
|
-
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/video.es.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(
|
|
4083
|
+
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/video.es.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?");
|
|
4073
4084
|
|
|
4074
4085
|
/***/ }),
|
|
4075
4086
|
|
|
@@ -4081,7 +4092,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol
|
|
|
4081
4092
|
/***/ (function(module, exports, __webpack_require__) {
|
|
4082
4093
|
|
|
4083
4094
|
"use strict";
|
|
4084
|
-
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/video.es.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(
|
|
4095
|
+
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/video.es.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?");
|
|
4085
4096
|
|
|
4086
4097
|
/***/ }),
|
|
4087
4098
|
|
|
@@ -4273,7 +4284,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
4273
4284
|
/***/ (function(module, exports, __webpack_require__) {
|
|
4274
4285
|
|
|
4275
4286
|
"use strict";
|
|
4276
|
-
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/video.es.js-exposed\"));\n\nvar _matches = __webpack_require__(/*! utils/matches */ \"./utils/matches.js\");\n\nvar _shoppableProductsOverlay = _interopRequireDefault(__webpack_require__(/*! ./shoppable-products-overlay */ \"./components/shoppable-bar/layout/shoppable-products-overlay.js\"));\n\nvar _shoppablePanelToggle = _interopRequireDefault(__webpack_require__(/*! ./shoppable-panel-toggle */ \"./components/shoppable-bar/layout/shoppable-panel-toggle.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 _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 ShoppableBarLayout = /*#__PURE__*/function (_Component) {\n _inherits(ShoppableBarLayout, _Component);\n\n var _super = _createSuper(ShoppableBarLayout);\n\n function ShoppableBarLayout(player, options) {\n var _thisSuper, _this;\n\n _classCallCheck(this, ShoppableBarLayout);\n\n _this = _super.call(this, player, options);\n _this.player_ = player;\n\n _this.player().addClass('cld-shoppable-panel');\n\n _this.player().addClass(_shoppableWidget.SHOPPABLE_PANEL_HIDDEN_CLASS);\n\n _this.contentWrpEl_ = dom.createEl('div', {\n className: 'cld-spbl-bar'\n });\n _this.contentBannerEl_ = dom.createEl('div', {\n className: 'cld-spbl-banner-msg base-color-text'\n }, {}, _this.options_.bannerMsg || 'Shop the Video');\n\n _this.contentWrpEl_.appendChild(_this.contentBannerEl_);\n\n var productsOverlay = new _shoppableProductsOverlay.default(_this.player_, _this.options_);\n\n _this.contentWrpEl_.appendChild(productsOverlay.el_);\n\n _this.contentEl_ = dom.createEl('div', {\n className: _shoppableWidget.CLD_SPBL_INNER_BAR\n });\n\n _this.contentWrpEl_.appendChild(_this.contentEl_);\n\n _this.player().el().appendChild(_this.contentWrpEl_);\n\n _this.addChild(new _shoppablePanelToggle.default(_this.player_, {\n toggleIcon: _this.options_.toggleIcon,\n clickHandler: function clickHandler() {\n _this.togglePanel();\n }\n }));\n\n _this.addChild('ShoppablePanel', _this.options_);\n\n _this.dispose = function () {\n _this.removeLayout();\n\n _get((_thisSuper = _assertThisInitialized(_this), _getPrototypeOf(ShoppableBarLayout.prototype)), \"dispose\", _thisSuper).call(_thisSuper);\n };\n\n _this.togglePanel = function (open) {\n if (open === true) {\n // Open\n _this.player().removeClass(_shoppableWidget.SHOPPABLE_PANEL_HIDDEN_CLASS);\n\n _this.player().addClass(_shoppableWidget.SHOPPABLE_PANEL_VISIBLE_CLASS);\n } else if (open === false) {\n // Close\n _this.player().removeClass(_shoppableWidget.SHOPPABLE_PANEL_VISIBLE_CLASS);\n\n _this.player().addClass(_shoppableWidget.SHOPPABLE_PANEL_HIDDEN_CLASS);\n } else {\n // Toggle\n _this.player().toggleClass(_shoppableWidget.SHOPPABLE_PANEL_HIDDEN_CLASS);\n\n _this.player().toggleClass(_shoppableWidget.SHOPPABLE_PANEL_VISIBLE_CLASS);\n }\n\n var eventName = _this.player().hasClass(_shoppableWidget.SHOPPABLE_PANEL_VISIBLE_CLASS) ? 'productBarMax' : 'productBarMin';\n\n _this.player().trigger(eventName);\n }; // Open shoppable\n\n\n if (_this.options_.startState === 'open') {\n _this.togglePanel(true);\n } // On play start\n\n\n _this.player_.on(
|
|
4287
|
+
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/video.es.js-exposed\"));\n\nvar _matches = __webpack_require__(/*! utils/matches */ \"./utils/matches.js\");\n\nvar _shoppableProductsOverlay = _interopRequireDefault(__webpack_require__(/*! ./shoppable-products-overlay */ \"./components/shoppable-bar/layout/shoppable-products-overlay.js\"));\n\nvar _shoppablePanelToggle = _interopRequireDefault(__webpack_require__(/*! ./shoppable-panel-toggle */ \"./components/shoppable-bar/layout/shoppable-panel-toggle.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 _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 ShoppableBarLayout = /*#__PURE__*/function (_Component) {\n _inherits(ShoppableBarLayout, _Component);\n\n var _super = _createSuper(ShoppableBarLayout);\n\n function ShoppableBarLayout(player, options) {\n var _thisSuper, _this;\n\n _classCallCheck(this, ShoppableBarLayout);\n\n _this = _super.call(this, player, options);\n _this.player_ = player;\n\n _this.player().addClass('cld-shoppable-panel');\n\n _this.player().addClass(_shoppableWidget.SHOPPABLE_PANEL_HIDDEN_CLASS);\n\n _this.contentWrpEl_ = dom.createEl('div', {\n className: 'cld-spbl-bar'\n });\n _this.contentBannerEl_ = dom.createEl('div', {\n className: 'cld-spbl-banner-msg base-color-text'\n }, {}, _this.options_.bannerMsg || 'Shop the Video');\n\n _this.contentWrpEl_.appendChild(_this.contentBannerEl_);\n\n var productsOverlay = new _shoppableProductsOverlay.default(_this.player_, _this.options_);\n\n _this.contentWrpEl_.appendChild(productsOverlay.el_);\n\n _this.contentEl_ = dom.createEl('div', {\n className: _shoppableWidget.CLD_SPBL_INNER_BAR\n });\n\n _this.contentWrpEl_.appendChild(_this.contentEl_);\n\n _this.player().el().appendChild(_this.contentWrpEl_);\n\n _this.addChild(new _shoppablePanelToggle.default(_this.player_, {\n toggleIcon: _this.options_.toggleIcon,\n clickHandler: function clickHandler() {\n _this.togglePanel();\n }\n }));\n\n _this.addChild('ShoppablePanel', _this.options_);\n\n _this.dispose = function () {\n _this.removeLayout();\n\n _get((_thisSuper = _assertThisInitialized(_this), _getPrototypeOf(ShoppableBarLayout.prototype)), \"dispose\", _thisSuper).call(_thisSuper);\n };\n\n _this.togglePanel = function (open) {\n if (open === true) {\n // Open\n _this.player().removeClass(_shoppableWidget.SHOPPABLE_PANEL_HIDDEN_CLASS);\n\n _this.player().addClass(_shoppableWidget.SHOPPABLE_PANEL_VISIBLE_CLASS);\n } else if (open === false) {\n // Close\n _this.player().removeClass(_shoppableWidget.SHOPPABLE_PANEL_VISIBLE_CLASS);\n\n _this.player().addClass(_shoppableWidget.SHOPPABLE_PANEL_HIDDEN_CLASS);\n } else {\n // Toggle\n _this.player().toggleClass(_shoppableWidget.SHOPPABLE_PANEL_HIDDEN_CLASS);\n\n _this.player().toggleClass(_shoppableWidget.SHOPPABLE_PANEL_VISIBLE_CLASS);\n }\n\n var eventName = _this.player().hasClass(_shoppableWidget.SHOPPABLE_PANEL_VISIBLE_CLASS) ? 'productBarMax' : 'productBarMin';\n\n _this.player().trigger(eventName);\n }; // Open shoppable\n\n\n if (_this.options_.startState === 'open') {\n _this.togglePanel(true);\n } // On play start\n\n\n _this.player_.on(_consts.PLAYER_EVENT.PLAY, function () {\n if (_this.player_.currentTime() < 0.01) {\n // Open shoppable on-play\n if (_this.options_.startState === 'openOnPlay') {\n _this.togglePanel(true, _this.options_.autoClose);\n } // Auto-close shoppable\n\n\n if (_this.options_.autoClose && _this.options_.startState.indexOf('open') !== -1) {\n setTimeout(function () {\n // Keep it open while hovered\n if (!(0, _matches.elMatches)(_this.contentEl_, ':hover')) {\n _this.togglePanel(false);\n } else {\n _this.contentEl_.addEventListener('mouseleave', function () {\n _this.togglePanel(false);\n }, {\n once: true\n });\n }\n }, _this.options_.autoClose * 1000);\n }\n }\n });\n\n return _this;\n }\n\n _createClass(ShoppableBarLayout, [{\n key: \"createEl\",\n value: function createEl() {\n var el = _get(_getPrototypeOf(ShoppableBarLayout.prototype), \"createEl\", this).call(this, 'div');\n\n return el;\n }\n }]);\n\n return ShoppableBarLayout;\n}(Component);\n\n_video.default.registerComponent('shoppableBarLayout', ShoppableBarLayout);\n\nvar _default = ShoppableBarLayout;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./components/shoppable-bar/layout/bar-layout.js?");
|
|
4277
4288
|
|
|
4278
4289
|
/***/ }),
|
|
4279
4290
|
|
|
@@ -4285,7 +4296,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol
|
|
|
4285
4296
|
/***/ (function(module, exports, __webpack_require__) {
|
|
4286
4297
|
|
|
4287
4298
|
"use strict";
|
|
4288
|
-
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/video.es.js-exposed\"));\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 _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\nvar dom = _video.default.dom || _video.default;\n\nvar ClickableComponent = _video.default.getComponent('ClickableComponent');\n\nvar ShoppablePanelToggle = /*#__PURE__*/function (_ClickableComponent) {\n _inherits(ShoppablePanelToggle, _ClickableComponent);\n\n var _super = _createSuper(ShoppablePanelToggle);\n\n function ShoppablePanelToggle(player, options) {\n var _this;\n\n _classCallCheck(this, ShoppablePanelToggle);\n\n _this = _super.call(this, player, options);\n _this.options_ = options;\n return _this;\n }\n\n _createClass(ShoppablePanelToggle, [{\n key: \"handleClick\",\n value: function handleClick(event) {\n event.preventDefault();\n event.stopPropagation();\n this.options_.clickHandler();\n }\n }, {\n key: \"createEl\",\n value: function createEl() {\n var iconProps = {};\n var iconAttrs = {};\n\n if (this.options_.toggleIcon) {\n iconProps = {\n className: \"\".concat(_shoppableWidget.CLD_SPBL_TOGGLE_ICON_CLASS, \" \").concat(_shoppableWidget.CLD_SPBL_TOGGLE_CUSTOM_ICON_CLASS, \" \").concat(_shoppableWidget.CLOSE_ICON_CLASS)\n };\n iconAttrs = {\n style: \"background-image: url(\".concat(this.options_.toggleIcon, \")\")\n };\n } else {\n iconProps = {\n className: \"\".concat(_shoppableWidget.CLD_SPBL_TOGGLE_ICON_CLASS, \" \").concat(_shoppableWidget.ICON_CART_CLASS)\n };\n }\n\n var icon = dom.createEl('span', iconProps, iconAttrs);\n\n var el = _get(_getPrototypeOf(ShoppablePanelToggle.prototype), \"createEl\", this).call(this, 'a', {\n className: \"\".concat(_shoppableWidget.CLD_SPBL_TOGGLE_CLASS, \" base-color-bg\")\n });\n\n el.appendChild(icon);\n this.player_.on(
|
|
4299
|
+
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/video.es.js-exposed\"));\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 _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\nvar dom = _video.default.dom || _video.default;\n\nvar ClickableComponent = _video.default.getComponent('ClickableComponent');\n\nvar ShoppablePanelToggle = /*#__PURE__*/function (_ClickableComponent) {\n _inherits(ShoppablePanelToggle, _ClickableComponent);\n\n var _super = _createSuper(ShoppablePanelToggle);\n\n function ShoppablePanelToggle(player, options) {\n var _this;\n\n _classCallCheck(this, ShoppablePanelToggle);\n\n _this = _super.call(this, player, options);\n _this.options_ = options;\n return _this;\n }\n\n _createClass(ShoppablePanelToggle, [{\n key: \"handleClick\",\n value: function handleClick(event) {\n event.preventDefault();\n event.stopPropagation();\n this.options_.clickHandler();\n }\n }, {\n key: \"createEl\",\n value: function createEl() {\n var iconProps = {};\n var iconAttrs = {};\n\n if (this.options_.toggleIcon) {\n iconProps = {\n className: \"\".concat(_shoppableWidget.CLD_SPBL_TOGGLE_ICON_CLASS, \" \").concat(_shoppableWidget.CLD_SPBL_TOGGLE_CUSTOM_ICON_CLASS, \" \").concat(_shoppableWidget.CLOSE_ICON_CLASS)\n };\n iconAttrs = {\n style: \"background-image: url(\".concat(this.options_.toggleIcon, \")\")\n };\n } else {\n iconProps = {\n className: \"\".concat(_shoppableWidget.CLD_SPBL_TOGGLE_ICON_CLASS, \" \").concat(_shoppableWidget.ICON_CART_CLASS)\n };\n }\n\n var icon = dom.createEl('span', iconProps, iconAttrs);\n\n var el = _get(_getPrototypeOf(ShoppablePanelToggle.prototype), \"createEl\", this).call(this, 'a', {\n className: \"\".concat(_shoppableWidget.CLD_SPBL_TOGGLE_CLASS, \" base-color-bg\")\n });\n\n el.appendChild(icon);\n this.player_.on(_consts.PLAYER_EVENT.PRODUCT_BAR_MIN, function () {\n setTimeout(function () {\n icon.classList.add(_shoppableWidget.SHOPPABLE_ANIMATION_CLASS);\n setTimeout(function () {\n icon.classList.remove(_shoppableWidget.SHOPPABLE_ANIMATION_CLASS);\n }, 1000);\n }, 500);\n });\n return el;\n }\n }]);\n\n return ShoppablePanelToggle;\n}(ClickableComponent);\n\n_video.default.registerComponent('shoppablePanelToggle', ShoppablePanelToggle);\n\nvar _default = ShoppablePanelToggle;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./components/shoppable-bar/layout/shoppable-panel-toggle.js?");
|
|
4289
4300
|
|
|
4290
4301
|
/***/ }),
|
|
4291
4302
|
|
|
@@ -4297,7 +4308,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol
|
|
|
4297
4308
|
/***/ (function(module, exports, __webpack_require__) {
|
|
4298
4309
|
|
|
4299
4310
|
"use strict";
|
|
4300
|
-
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/video.es.js-exposed\"));\n\nvar _time = __webpack_require__(/*! utils/time */ \"./utils/time.js\");\n\nvar _find = __webpack_require__(/*! utils/find */ \"./utils/find.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 _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 dom = _video.default.dom || _video.default;\n\nvar Component = _video.default.getComponent('Component');\n\nvar ShoppableProductsOverlay = /*#__PURE__*/function (_Component) {\n _inherits(ShoppableProductsOverlay, _Component);\n\n var _super = _createSuper(ShoppableProductsOverlay);\n\n function ShoppableProductsOverlay(player) {\n var _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, ShoppableProductsOverlay);\n\n _this = _super.call(this, player, options);\n
|
|
4311
|
+
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/video.es.js-exposed\"));\n\nvar _time = __webpack_require__(/*! utils/time */ \"./utils/time.js\");\n\nvar _find = __webpack_require__(/*! utils/find */ \"./utils/find.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 _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\nvar dom = _video.default.dom || _video.default;\n\nvar Component = _video.default.getComponent('Component');\n\nvar ShoppableProductsOverlay = /*#__PURE__*/function (_Component) {\n _inherits(ShoppableProductsOverlay, _Component);\n\n var _super = _createSuper(ShoppableProductsOverlay);\n\n function ShoppableProductsOverlay(player) {\n var _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, ShoppableProductsOverlay);\n\n _this = _super.call(this, player, options);\n\n _defineProperty(_assertThisInitialized(_this), \"renderProducts\", function () {\n // Close products side-panel\n _this.player_.removeClass(_shoppableWidget.SHOPPABLE_PANEL_VISIBLE_CLASS);\n\n _this.player_.addClass(_shoppableWidget.SHOPPABLE_PANEL_HIDDEN_CLASS);\n\n _this.player_.addClass(_shoppableWidget.SHOPPABLE_PRODUCTS_OVERLAY_CLASS);\n\n _this.layout_.innerHTML = ''; // Filter products with appearance on currentTime\n\n var currentTime = _this.player_.currentTime();\n\n var currentProducts = _this.options_.products.filter(function (product) {\n return product.hotspots && product.hotspots.some(function (a) {\n return (0, _time.parseTime)(a.time) === currentTime;\n });\n });\n\n currentProducts.forEach(function (product) {\n var hotspot = (0, _find.find)(product.hotspots, function (hs) {\n return (0, _time.parseTime)(hs.time) === currentTime;\n });\n var productName = dom.createEl('div', {\n className: 'cld-spbl-product-hotspot-name'\n }, {}, product.productName);\n var productTooltip = dom.createEl('div', {\n className: 'cld-spbl-product-tooltip cld-spbl-product-tooltip-' + hotspot.tooltipPosition\n }, {}, productName);\n var productHotSpot = dom.createEl('a', {\n className: 'cld-spbl-product-hotspot accent-color-text',\n href: hotspot.clickUrl,\n target: '_blank'\n }, {\n style: 'left:' + hotspot.x + '; top:' + hotspot.y + ';'\n }, productTooltip);\n\n _this.layout_.appendChild(productHotSpot);\n }); // Remove\n\n _this.player_.one(_consts.PLAYER_EVENT.SEEKING, _this.clearLayout);\n\n _this.player_.one(_consts.PLAYER_EVENT.PLAY, _this.clearLayout);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"clearLayout\", function () {\n _this.layout_.innerHTML = '';\n\n _this.player_.removeClass(_shoppableWidget.SHOPPABLE_PRODUCTS_OVERLAY_CLASS);\n });\n\n _this.options_ = options;\n _this.player_ = player;\n\n _this.player_.on(_consts.PLAYER_EVENT.SHOW_PRODUCTS_OVERLAY, _this.renderProducts);\n\n _this.dispose = function () {\n _this.layout_.dispose();\n };\n\n return _this;\n }\n\n _createClass(ShoppableProductsOverlay, [{\n key: \"createEl\",\n value: function createEl() {\n this.layout_ = dom.createEl('div', {\n className: 'cld-spbl-products-overlay'\n });\n return this.layout_;\n }\n }]);\n\n return ShoppableProductsOverlay;\n}(Component);\n\n_video.default.registerComponent('ShoppableProductsOverlay', ShoppableProductsOverlay);\n\nvar _default = ShoppableProductsOverlay;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./components/shoppable-bar/layout/shoppable-products-overlay.js?");
|
|
4301
4312
|
|
|
4302
4313
|
/***/ }),
|
|
4303
4314
|
|
|
@@ -4321,7 +4332,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol
|
|
|
4321
4332
|
/***/ (function(module, exports, __webpack_require__) {
|
|
4322
4333
|
|
|
4323
4334
|
"use strict";
|
|
4324
|
-
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/video.es.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?");
|
|
4335
|
+
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/video.es.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?");
|
|
4325
4336
|
|
|
4326
4337
|
/***/ }),
|
|
4327
4338
|
|
|
@@ -4357,7 +4368,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
4357
4368
|
/***/ (function(module, exports, __webpack_require__) {
|
|
4358
4369
|
|
|
4359
4370
|
"use strict";
|
|
4360
|
-
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/video.es.js-exposed\"));\n\nvar _barLayout = _interopRequireDefault(__webpack_require__(/*! ./layout/bar-layout */ \"./components/shoppable-bar/layout/bar-layout.js\"));\n\nvar _shoppablePostWidget = _interopRequireDefault(__webpack_require__(/*! ./shoppable-post-widget */ \"./components/shoppable-bar/shoppable-post-widget.js\"));\n\n__webpack_require__(/*! ./shoppable-widget.scss */ \"./components/shoppable-bar/shoppable-widget.scss\");\n\nvar _shoppableWidget2 = __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 _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 _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 _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(_e2) { throw _e2; }, 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(_e3) { didErr = true; err = _e3; }, 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 _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 ShoppableWidget = /*#__PURE__*/function () {\n function ShoppableWidget(player) {\n var _this = this;\n\n var initOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, ShoppableWidget);\n\n this.options_ = _video.default.mergeOptions(_shoppableWidget2.SHOPPABLE_WIDGET_OPTIONS_DEFAULTS, initOptions);\n this.player_ = player;\n\n if (this.options_.showPostPlayOverlay) {\n this.player_.on(
|
|
4371
|
+
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/video.es.js-exposed\"));\n\nvar _barLayout = _interopRequireDefault(__webpack_require__(/*! ./layout/bar-layout */ \"./components/shoppable-bar/layout/bar-layout.js\"));\n\nvar _shoppablePostWidget = _interopRequireDefault(__webpack_require__(/*! ./shoppable-post-widget */ \"./components/shoppable-bar/shoppable-post-widget.js\"));\n\n__webpack_require__(/*! ./shoppable-widget.scss */ \"./components/shoppable-bar/shoppable-widget.scss\");\n\nvar _shoppableWidget2 = __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 _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 _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 _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(_e2) { throw _e2; }, 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(_e3) { didErr = true; err = _e3; }, 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 _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 ShoppableWidget = /*#__PURE__*/function () {\n function ShoppableWidget(player) {\n var _this = this;\n\n var initOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, ShoppableWidget);\n\n this.options_ = _video.default.mergeOptions(_shoppableWidget2.SHOPPABLE_WIDGET_OPTIONS_DEFAULTS, initOptions);\n this.player_ = player;\n\n if (this.options_.showPostPlayOverlay) {\n this.player_.on(_consts.PLAYER_EVENT.ENDED, function () {\n _this.player_.addChild(new _shoppablePostWidget.default(_this.player_, _this.options_)); // Handle responsive images.\n\n\n _this.player_.player_.cloudinary.cloudinaryConfig().responsive({\n responsive_class: _shoppableWidget2.SHOPPABLE_WIDGET_RESPONSIVE_CLASS\n });\n });\n }\n\n var width = this.options_.width;\n\n this._injectCSS(\"\\n .\".concat(_shoppableWidget2.CLD_SPBL_INNER_BAR, \" {\\n transform: translateX(\").concat(width, \");\\n }\\n .\").concat(_shoppableWidget2.SHOPPABLE_PANEL_VISIBLE_CLASS, \" .vjs-control-bar {\\n width: calc(100% - \").concat(width, \");\\n }\\n .\").concat(_shoppableWidget2.CLD_SPBL_TOGGLE_CLASS, \" {\\n right: \").concat(width, \";\\n }\\n .\").concat(_shoppableWidget2.CLD_SPBL_PANEL_CLASS, \"{\\n width: \").concat(width, \";\\n }\\n \"));\n\n this._setListeners();\n }\n\n _createClass(ShoppableWidget, [{\n key: \"_setListeners\",\n value: function _setListeners() {\n var _this2 = this;\n\n var resizeHandler = this._resizeHandler.bind(this);\n\n this.player_.on(_consts.PLAYER_EVENT.RESIZE, resizeHandler);\n window.addEventListener('resize', resizeHandler);\n\n this.dispose = function () {\n _this2.player_.off(_consts.PLAYER_EVENT.RESIZE, resizeHandler);\n\n window.removeEventListener('resize', resizeHandler);\n\n _this2.layout_.dispose();\n };\n }\n }, {\n key: \"_injectCSS\",\n value: function _injectCSS(css) {\n var style = document.createElement('style');\n style.innerHTML = css;\n this.player_.el_.appendChild(style);\n }\n }, {\n key: \"_resizeHandler\",\n value: function _resizeHandler() {\n var shoppableBarBreakpoints = [['sm', 0, 80], ['md', 81, 110], ['lg', 111, 170]];\n var shoppableBarWidth = parseFloat(this.options_.width) / 100.0 * this.player_.el_.clientWidth;\n var inRange = false;\n\n if (shoppableBarWidth) {\n var _iterator = _createForOfIteratorHelper(shoppableBarBreakpoints),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _step$value = _slicedToArray(_step.value, 3),\n name = _step$value[0],\n min = _step$value[1],\n max = _step$value[2];\n\n if (shoppableBarWidth > min && shoppableBarWidth <= max) {\n this.layout_.contentWrpEl_.setAttribute('size', name);\n inRange = name;\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n if (!inRange) {\n this.layout_.contentWrpEl_.removeAttribute('size');\n }\n }\n }\n }, {\n key: \"init\",\n value: function init() {\n this.render();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this3 = this;\n\n this.layout_ = new _barLayout.default(this.player_, this.options_);\n this.player_.on(_consts.PLAYER_EVENT.LOADED_DATA, function () {\n // Handle responsive images.\n _this3.player_.player_.cloudinary.cloudinaryConfig().responsive({\n responsive_class: _shoppableWidget2.SHOPPABLE_WIDGET_RESPONSIVE_CLASS\n });\n });\n }\n }]);\n\n return ShoppableWidget;\n}();\n\nvar _default = ShoppableWidget;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./components/shoppable-bar/shoppable-widget.js?");
|
|
4361
4372
|
|
|
4362
4373
|
/***/ }),
|
|
4363
4374
|
|
|
@@ -4429,7 +4440,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
4429
4440
|
/***/ (function(module, exports, __webpack_require__) {
|
|
4430
4441
|
|
|
4431
4442
|
"use strict";
|
|
4432
|
-
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/video.es.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?");
|
|
4443
|
+
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/video.es.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?");
|
|
4433
4444
|
|
|
4434
4445
|
/***/ }),
|
|
4435
4446
|
|
|
@@ -4477,7 +4488,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol
|
|
|
4477
4488
|
/***/ (function(module, exports, __webpack_require__) {
|
|
4478
4489
|
|
|
4479
4490
|
"use strict";
|
|
4480
|
-
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/video.es.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?");
|
|
4491
|
+
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/video.es.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?");
|
|
4481
4492
|
|
|
4482
4493
|
/***/ }),
|
|
4483
4494
|
|
|
@@ -4525,7 +4536,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
4525
4536
|
/***/ (function(module, exports, __webpack_require__) {
|
|
4526
4537
|
|
|
4527
4538
|
"use strict";
|
|
4528
|
-
eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nexports.CONSTRUCTOR_PARAMS = void 0;\n\nvar _cloudinaryCore = _interopRequireDefault(__webpack_require__(/*! cloudinary-core */ \"cloudinary-core\"));\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/video.es.js-exposed\"));\n\nvar _mixin2 = __webpack_require__(/*! utils/mixin */ \"./utils/mixin.js\");\n\nvar _applyWithProps = __webpack_require__(/*! utils/apply-with-props */ \"./utils/apply-with-props.js\");\n\nvar _slicing = __webpack_require__(/*! utils/slicing */ \"./utils/slicing.js\");\n\nvar _cloudinary = __webpack_require__(/*! utils/cloudinary */ \"./utils/cloudinary.js\");\n\nvar _assign = __webpack_require__(/*! utils/assign */ \"./utils/assign.js\");\n\nvar _common = __webpack_require__(/*! ./common */ \"./plugins/cloudinary/common.js\");\n\nvar _playlistable = _interopRequireDefault(__webpack_require__(/*! mixins/playlistable */ \"./mixins/playlistable.js\"));\n\nvar _videoSource = _interopRequireDefault(__webpack_require__(/*! ./models/video-source/video-source */ \"./plugins/cloudinary/models/video-source/video-source.js\"));\n\nvar _eventHandlerRegistry = _interopRequireDefault(__webpack_require__(/*! ./event-handler-registry */ \"./plugins/cloudinary/event-handler-registry.js\"));\n\nvar _audioSource = _interopRequireDefault(__webpack_require__(/*! ./models/audio-source/audio-source */ \"./plugins/cloudinary/models/audio-source/audio-source.js\"));\n\nvar _typeInference = __webpack_require__(/*! ../../utils/type-inference */ \"./utils/type-inference.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar DEFAULT_PARAMS = {\n transformation: {},\n sourceTypes: [],\n sourceTransformation: [],\n posterOptions: {}\n};\nvar CONSTRUCTOR_PARAMS = ['cloudinaryConfig', 'transformation', 'sourceTypes', 'sourceTransformation', 'posterOptions', 'autoShowRecommendations'];\nexports.CONSTRUCTOR_PARAMS = CONSTRUCTOR_PARAMS;\n\nvar CloudinaryContext = /*#__PURE__*/function (_mixin) {\n _inherits(CloudinaryContext, _mixin);\n\n var _super = _createSuper(CloudinaryContext);\n\n function CloudinaryContext(player) {\n var _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, CloudinaryContext);\n\n _this = _super.call(this, player, options);\n _this.player = player;\n options = (0, _assign.assign)({}, DEFAULT_PARAMS, options);\n var _source = null;\n var _sources = null;\n var _lastSource = null;\n var _lastPlaylist = null;\n var _posterOptions = null;\n var _cloudinaryConfig = null;\n var _transformation = null;\n var _sourceTypes = null;\n var _sourceTransformation = null;\n var _chainTarget = options.chainTarget;\n var _playerEvents = null;\n var _recommendations = null;\n var _autoShowRecommendations = false;\n\n _this.source = function (source) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n options = (0, _assign.assign)({}, options);\n\n if (!source) {\n return _source;\n }\n\n var src = null;\n\n if (source instanceof _videoSource.default) {\n src = source;\n } else {\n var _normalizeOptions = (0, _common.normalizeOptions)(source, options),\n publicId = _normalizeOptions.publicId,\n _options = _normalizeOptions.options;\n\n src = _this.buildSource(publicId, _options);\n }\n\n if (src.recommendations()) {\n var recommendations = src.recommendations();\n var itemBuilder = null;\n var disableAutoShow = false;\n\n if (options.recommendationOptions) {\n var _sliceAndUnsetPropert = (0, _slicing.sliceAndUnsetProperties)(options.recommendationOptions, 'disableAutoShow', 'itemBuilder');\n\n disableAutoShow = _sliceAndUnsetPropert.disableAutoShow;\n itemBuilder = _sliceAndUnsetPropert.itemBuilder;\n }\n\n setRecommendations(recommendations, {\n disableAutoShow: disableAutoShow,\n itemBuilder: itemBuilder\n });\n } else {\n unsetRecommendations();\n }\n\n _source = src;\n\n if (!options.skipRefresh) {\n refresh();\n }\n\n _this.player.trigger('cldsourcechanged', {\n source: src\n });\n\n return _chainTarget;\n };\n\n _this.buildSource = function (publicId) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var builtSrc = null;\n\n var _normalizeOptions2 = (0, _common.normalizeOptions)(publicId, options);\n\n publicId = _normalizeOptions2.publicId;\n options = _normalizeOptions2.options;\n options.cloudinaryConfig = (0, _common.mergeCloudinaryConfig)(_this.cloudinaryConfig(), options.cloudinaryConfig || {});\n options.transformation = (0, _common.mergeTransformation)(_this.transformation(), options.transformation || {});\n options.sourceTransformation = options.sourceTransformation || _this.sourceTransformation();\n options.sourceTypes = options.sourceTypes || _this.sourceTypes();\n options.poster = options.poster || posterOptionsForCurrent();\n options.queryParams = options.usageReport ? {\n _s: \"vp-\".concat(\"1.6.4-edge.2\")\n } : {};\n\n if (options.sourceTypes.indexOf('audio') > -1) {\n builtSrc = new _audioSource.default(publicId, options);\n } else {\n builtSrc = new _videoSource.default(publicId, options);\n }\n\n return builtSrc;\n };\n\n _this.posterOptions = function (options) {\n if (!options) {\n return _posterOptions;\n }\n\n _posterOptions = options;\n return _chainTarget;\n };\n\n _this.cloudinaryConfig = function (config) {\n if (!config) {\n return _cloudinaryConfig;\n }\n\n _cloudinaryConfig = (0, _cloudinary.getCloudinaryInstanceOf)(_cloudinaryCore.default.Cloudinary, config);\n return _chainTarget;\n };\n\n _this.transformation = function (trans) {\n if (!trans) {\n return _transformation;\n }\n\n _transformation = (0, _cloudinary.getCloudinaryInstanceOf)(_cloudinaryCore.default.Transformation, trans);\n return _chainTarget;\n };\n\n _this.sourceTypes = function (types) {\n if (!types) {\n return _sourceTypes;\n }\n\n _sourceTypes = types;\n return _chainTarget;\n };\n\n _this.getCurrentSources = function () {\n return _sources;\n };\n\n _this.sourceTransformation = function (trans) {\n if (!trans) {\n return _sourceTransformation;\n }\n\n _sourceTransformation = trans;\n return _chainTarget;\n };\n\n _this.on = function () {\n var _playerEvents2;\n\n return (_playerEvents2 = _playerEvents).on.apply(_playerEvents2, arguments);\n };\n\n _this.one = function () {\n var _playerEvents3;\n\n return (_playerEvents3 = _playerEvents).one.apply(_playerEvents3, arguments);\n };\n\n _this.off = function () {\n var _playerEvents4;\n\n return (_playerEvents4 = _playerEvents).off.apply(_playerEvents4, arguments);\n };\n\n _this.autoShowRecommendations = function (autoShow) {\n if (autoShow === undefined) {\n return _autoShowRecommendations;\n }\n\n _autoShowRecommendations = autoShow;\n return _chainTarget;\n };\n\n _this.dispose = function () {\n if (_this.playlist()) {\n _this.disposePlaylist();\n }\n\n unsetRecommendations();\n _source = undefined;\n\n _playerEvents.removeAllListeners();\n };\n\n var setRecommendations = function setRecommendations(recommendations, _ref) {\n var _ref$disableAutoShow = _ref.disableAutoShow,\n disableAutoShow = _ref$disableAutoShow === void 0 ? false : _ref$disableAutoShow,\n _ref$itemBuilder = _ref.itemBuilder,\n itemBuilder = _ref$itemBuilder === void 0 ? null : _ref$itemBuilder;\n unsetRecommendations();\n\n if (!Array.isArray(recommendations) && typeof recommendations !== 'function' && !recommendations.then) {\n throw new Error('\"recommendations\" must be either an array or a function');\n }\n\n _recommendations = {};\n\n itemBuilder = itemBuilder || function (source) {\n return {\n source: source instanceof _videoSource.default ? source : _this.buildSource(source),\n action: function action() {\n return _this.source(source);\n }\n };\n };\n\n _recommendations.sourceChangedHandler = function () {\n var trigger = function trigger(sources) {\n if (typeof sources !== 'undefined' && sources.length > 0) {\n var items = sources.map(function (_source) {\n return itemBuilder(_source);\n });\n\n _this.player.trigger('recommendationschanged', {\n items: items\n });\n } else {\n _this.player.trigger('recommendationsnoshow');\n }\n\n _recommendations.sources = sources;\n };\n\n if ((0, _typeInference.isFunction)(recommendations)) {\n trigger(recommendations());\n } else if (recommendations.then) {\n recommendations.then(trigger);\n } else {\n trigger(recommendations);\n }\n };\n\n _this.one('cldsourcechanged', _recommendations.sourceChangedHandler);\n\n _recommendations.endedHandler = function () {\n if (!disableAutoShow && _this.autoShowRecommendations()) {\n _this.player.trigger('recommendationsshow');\n }\n };\n\n _this.on('ended', _recommendations.endedHandler);\n };\n\n var unsetRecommendations = function unsetRecommendations() {\n if (_recommendations) {\n _this.off('cldsourcechanged', _recommendations.sourceChangedHandler);\n\n _this.off('ended', _recommendations.endedHandler);\n\n delete _recommendations.endedHandler;\n delete _recommendations.sourceChangedHandler;\n }\n\n _recommendations = null;\n };\n\n var refresh = function refresh() {\n var src = _this.source();\n\n if (src.poster()) {\n _this.player.poster(src.poster().url());\n }\n\n _sources = src.generateSources().reduce(function (srcs, src) {\n if (src.isAdaptive) {\n var codec = src.type.split('; ')[1] || null;\n\n if (codec && 'MediaSource' in window) {\n var parts = src.type.split('; ');\n var typeStr = \"video/mp4; \".concat(parts[1] || '');\n var canPlay = testCanPlayTypeAndTypeSupported(typeStr);\n\n if (_video.default.browser.IS_ANY_SAFARI) {\n // work around safari saying it cant play h265\n src.type = \"\".concat(parts[0], \"; \").concat((0, _common.codecShorthandTrans)('h264'));\n }\n\n if (canPlay) {\n srcs.push(src);\n }\n } else {\n srcs.push(src);\n }\n } else {\n srcs.push(src);\n }\n\n return srcs;\n }, []);\n\n _this.player.src(_sources);\n\n _lastSource = src;\n _lastPlaylist = _this.playlist();\n };\n\n var testCanPlayTypeAndTypeSupported = function testCanPlayTypeAndTypeSupported(codec) {\n var v = document.createElement('video');\n return v.canPlayType(codec) || 'MediaSource' in window && MediaSource.isTypeSupported(codec);\n };\n\n var posterOptionsForCurrent = function posterOptionsForCurrent() {\n var opts = (0, _assign.assign)({}, _this.posterOptions());\n\n if (opts.transformation) {\n if ((opts.transformation.width || opts.transformation.height) && !opts.transformation.crop) {\n opts.transformation.crop = 'scale';\n }\n }\n\n opts.transformation = (0, _cloudinary.getCloudinaryInstanceOf)(_cloudinaryCore.default.Transformation, opts.transformation || {}); // Set poster dimensions to player actual size.\n // (unless they were explicitly set via `posterOptions`)\n\n var playerEl = _this.player.el();\n\n if (playerEl && playerEl.clientWidth && playerEl.clientHeight && !(0, _cloudinary.isKeyInTransformation)(opts.transformation, 'width') && !(0, _cloudinary.isKeyInTransformation)(opts.transformation, 'height')) {\n var roundUp100 = function roundUp100(val) {\n return 100 * Math.ceil(val / 100);\n };\n\n opts.transformation.width(roundUp100(playerEl.clientWidth)).height(roundUp100(playerEl.clientHeight)).crop('limit');\n }\n\n return opts;\n }; // Handle external (non-cloudinary plugin) source changes (e.g. by ad plugins)\n\n\n var syncState = function syncState(_, data) {\n var src = data.to; // When source is cloudinary's\n\n if (_lastSource && _lastSource.contains(src)) {\n // If plugin state doesn't have an active VideoSource\n if (!_this.source()) {\n // We might have been running a playlist, reset playlist's state.\n if (_lastPlaylist) {\n _this.playlist(_lastPlaylist);\n } // Rebuild last source state without calling vjs's 'src' and 'poster'\n\n\n _this.source(_lastSource, {\n skipRefresh: true\n });\n }\n } else {\n // Used by cloudinary-only components\n _this.player.trigger('cldsourcechanged', {}); // When source isn't cloudinary's - reset the plugin's state.\n\n\n _this.dispose();\n }\n };\n\n _playerEvents = new _eventHandlerRegistry.default(_this.player);\n\n var constructorParams = _slicing.sliceAndUnsetProperties.apply(void 0, [options].concat(CONSTRUCTOR_PARAMS));\n\n (0, _applyWithProps.applyWithProps)(_assertThisInitialized(_this), constructorParams);\n\n _this.on('sourcechanged', syncState);\n\n return _this;\n }\n\n _createClass(CloudinaryContext, [{\n key: \"currentSourceType\",\n value: function currentSourceType() {\n return this.source().getType();\n }\n }, {\n key: \"currentPublicId\",\n value: function currentPublicId() {\n return this.source() && this.source().publicId();\n }\n }, {\n key: \"currentPoster\",\n value: function currentPoster() {\n return this.source() && this.source().poster();\n }\n }]);\n\n return CloudinaryContext;\n}((0, _mixin2.mixin)(_playlistable.default));\n\nfunction _default() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n options.chainTarget = options.chainTarget || this;\n this.cloudinary = new CloudinaryContext(this, options);\n}\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./plugins/cloudinary/index.js?");
|
|
4539
|
+
eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nexports.CONSTRUCTOR_PARAMS = void 0;\n\nvar _cloudinaryCore = _interopRequireDefault(__webpack_require__(/*! cloudinary-core */ \"cloudinary-core\"));\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/video.es.js-exposed\"));\n\nvar _mixin2 = __webpack_require__(/*! utils/mixin */ \"./utils/mixin.js\");\n\nvar _applyWithProps = __webpack_require__(/*! utils/apply-with-props */ \"./utils/apply-with-props.js\");\n\nvar _slicing = __webpack_require__(/*! utils/slicing */ \"./utils/slicing.js\");\n\nvar _cloudinary = __webpack_require__(/*! utils/cloudinary */ \"./utils/cloudinary.js\");\n\nvar _assign = __webpack_require__(/*! utils/assign */ \"./utils/assign.js\");\n\nvar _common = __webpack_require__(/*! ./common */ \"./plugins/cloudinary/common.js\");\n\nvar _playlistable = _interopRequireDefault(__webpack_require__(/*! mixins/playlistable */ \"./mixins/playlistable.js\"));\n\nvar _videoSource = _interopRequireDefault(__webpack_require__(/*! ./models/video-source/video-source */ \"./plugins/cloudinary/models/video-source/video-source.js\"));\n\nvar _eventHandlerRegistry = _interopRequireDefault(__webpack_require__(/*! ./event-handler-registry */ \"./plugins/cloudinary/event-handler-registry.js\"));\n\nvar _audioSource = _interopRequireDefault(__webpack_require__(/*! ./models/audio-source/audio-source */ \"./plugins/cloudinary/models/audio-source/audio-source.js\"));\n\nvar _typeInference = __webpack_require__(/*! ../../utils/type-inference */ \"./utils/type-inference.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar DEFAULT_PARAMS = {\n transformation: {},\n sourceTypes: [],\n sourceTransformation: [],\n posterOptions: {}\n};\nvar CONSTRUCTOR_PARAMS = ['cloudinaryConfig', 'transformation', 'sourceTypes', 'sourceTransformation', 'posterOptions', 'autoShowRecommendations'];\nexports.CONSTRUCTOR_PARAMS = CONSTRUCTOR_PARAMS;\n\nvar CloudinaryContext = /*#__PURE__*/function (_mixin) {\n _inherits(CloudinaryContext, _mixin);\n\n var _super = _createSuper(CloudinaryContext);\n\n function CloudinaryContext(player) {\n var _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, CloudinaryContext);\n\n _this = _super.call(this, player, options);\n _this.player = player;\n options = (0, _assign.assign)({}, DEFAULT_PARAMS, options);\n var _source = null;\n var _sources = null;\n var _lastSource = null;\n var _lastPlaylist = null;\n var _posterOptions = null;\n var _cloudinaryConfig = null;\n var _transformation = null;\n var _sourceTypes = null;\n var _sourceTransformation = null;\n var _chainTarget = options.chainTarget;\n var _playerEvents = null;\n var _recommendations = null;\n var _autoShowRecommendations = false;\n\n _this.source = function (source) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n options = (0, _assign.assign)({}, options);\n\n if (!source) {\n return _source;\n }\n\n var src = null;\n\n if (source instanceof _videoSource.default) {\n src = source;\n } else {\n var _normalizeOptions = (0, _common.normalizeOptions)(source, options),\n publicId = _normalizeOptions.publicId,\n _options = _normalizeOptions.options;\n\n src = _this.buildSource(publicId, _options);\n }\n\n if (src.recommendations()) {\n var recommendations = src.recommendations();\n var itemBuilder = null;\n var disableAutoShow = false;\n\n if (options.recommendationOptions) {\n var _sliceAndUnsetPropert = (0, _slicing.sliceAndUnsetProperties)(options.recommendationOptions, 'disableAutoShow', 'itemBuilder');\n\n disableAutoShow = _sliceAndUnsetPropert.disableAutoShow;\n itemBuilder = _sliceAndUnsetPropert.itemBuilder;\n }\n\n setRecommendations(recommendations, {\n disableAutoShow: disableAutoShow,\n itemBuilder: itemBuilder\n });\n } else {\n unsetRecommendations();\n }\n\n _source = src;\n\n if (!options.skipRefresh) {\n refresh();\n }\n\n _this.player.trigger('cldsourcechanged', {\n source: src\n });\n\n return _chainTarget;\n };\n\n _this.buildSource = function (publicId) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var builtSrc = null;\n\n var _normalizeOptions2 = (0, _common.normalizeOptions)(publicId, options);\n\n publicId = _normalizeOptions2.publicId;\n options = _normalizeOptions2.options;\n options.cloudinaryConfig = (0, _common.mergeCloudinaryConfig)(_this.cloudinaryConfig(), options.cloudinaryConfig || {});\n options.transformation = (0, _common.mergeTransformation)(_this.transformation(), options.transformation || {});\n options.sourceTransformation = options.sourceTransformation || _this.sourceTransformation();\n options.sourceTypes = options.sourceTypes || _this.sourceTypes();\n options.poster = options.poster || posterOptionsForCurrent();\n options.queryParams = options.usageReport ? {\n _s: \"vp-\".concat(\"1.7.0-edge.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?");
|
|
4529
4540
|
|
|
4530
4541
|
/***/ }),
|
|
4531
4542
|
|
|
@@ -4549,7 +4560,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
4549
4560
|
/***/ (function(module, exports, __webpack_require__) {
|
|
4550
4561
|
|
|
4551
4562
|
"use strict";
|
|
4552
|
-
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 =
|
|
4563
|
+
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?");
|
|
4553
4564
|
|
|
4554
4565
|
/***/ }),
|
|
4555
4566
|
|
|
@@ -4597,7 +4608,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
4597
4608
|
/***/ (function(module, exports, __webpack_require__) {
|
|
4598
4609
|
|
|
4599
4610
|
"use strict";
|
|
4600
|
-
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/video.es.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?");
|
|
4611
|
+
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/video.es.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?");
|
|
4601
4612
|
|
|
4602
4613
|
/***/ }),
|
|
4603
4614
|
|
|
@@ -4669,7 +4680,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
4669
4680
|
/***/ (function(module, exports, __webpack_require__) {
|
|
4670
4681
|
|
|
4671
4682
|
"use strict";
|
|
4672
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar contextMenuContent = function contextMenuContent(player) {\n var isLooping = player.loop();\n var isPaused = player.paused();\n var isMuted = player.muted();\n var isFullscreen = player.isFullscreen();\n var aboutMenuItem = {\n label: '<span class=\"player-version\">Cloudinary Player v' + \"1.
|
|
4683
|
+
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?");
|
|
4673
4684
|
|
|
4674
4685
|
/***/ }),
|
|
4675
4686
|
|
|
@@ -4729,7 +4740,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
4729
4740
|
/***/ (function(module, exports, __webpack_require__) {
|
|
4730
4741
|
|
|
4731
4742
|
"use strict";
|
|
4732
|
-
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _window = _interopRequireDefault(__webpack_require__(/*! global/window */ \"../node_modules/global/window.js\"));\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/video.es.js-exposed\"));\n\nvar _dashjs = _interopRequireDefault(__webpack_require__(/*! dashjs */ \"../node_modules/dashjs/build/es5/index.js\"));\n\nvar _setupAudioTracks = _interopRequireDefault(__webpack_require__(/*! ./setup-audio-tracks */ \"./plugins/dash/setup-audio-tracks.js\"));\n\nvar _setupTextTracks = _interopRequireDefault(__webpack_require__(/*! ./setup-text-tracks */ \"./plugins/dash/setup-text-tracks.js\"));\n\nvar _document = _interopRequireDefault(__webpack_require__(/*! global/document */ \"../node_modules/global/document.js\"));\n\nvar _assign = __webpack_require__(/*! ../../utils/assign */ \"./utils/assign.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * videojs-contrib-dash\n *\n * Use Dash.js to playback DASH content inside of Video.js via a SourceHandler\n */\nvar Html5DashJS = /*#__PURE__*/function () {\n function Html5DashJS(source, tech, options) {\n var _this = this;\n\n _classCallCheck(this, Html5DashJS);\n\n // Get options from tech if not provided for backwards compatibility\n options = options || tech.options_;\n this.player = (0, _video.default)(options.playerId);\n this.player.dash = this.player.dash || {};\n this.tech_ = tech;\n this.el_ = tech.el();\n this.elParent_ = this.el_.parentNode;\n this.hasFiniteDuration_ = false; // Do nothing if the src is falsey\n\n if (!source.src) {\n return;\n } // While the manifest is loading and Dash.js has not finished initializing\n // we must defer events and functions calls with isReady_ and then `triggerReady`\n // again later once everything is setup\n\n\n tech.isReady_ = false;\n\n if (Html5DashJS.updateSourceData) {\n _video.default.log.warn('updateSourceData has been deprecated.' + ' Please switch to using hook(\"updatesource\", callback).');\n\n source = Html5DashJS.updateSourceData(source);\n } // call updatesource hooks\n\n\n Html5DashJS.hooks('updatesource').forEach(function (hook) {\n source = hook(source);\n });\n var manifestSource = source.src;\n this.keySystemOptions_ = Html5DashJS.buildDashJSProtData(source.keySystemOptions); // eslint-disable-next-line new-cap\n\n this.player.dash.mediaPlayer = _dashjs.default.MediaPlayer().create();\n this.mediaPlayer_ = this.player.dash.mediaPlayer; // For whatever reason, we need to call setTextDefaultEnabled(false) to get\n // VTT captions to show, even though we're doing virtually the same thing\n // in setup-text-tracks.js\n\n this.mediaPlayer_.setTextDefaultEnabled(false); // Log MedaPlayer messages through video.js\n\n if (Html5DashJS.useVideoJSDebug) {\n _video.default.log.warn('useVideoJSDebug has been deprecated.' + ' Please switch to using hook(\"beforeinitialize\", callback).');\n\n Html5DashJS.useVideoJSDebug(this.mediaPlayer_);\n }\n\n if (Html5DashJS.beforeInitialize) {\n _video.default.log.warn('beforeInitialize has been deprecated.' + ' Please switch to using hook(\"beforeinitialize\", callback).');\n\n Html5DashJS.beforeInitialize(this.player, this.mediaPlayer_);\n }\n\n Html5DashJS.hooks('beforeinitialize').forEach(function (hook) {\n hook(_this.player, _this.mediaPlayer_);\n }); // Must run controller before these two lines or else there is no\n // element to bind to.\n\n this.mediaPlayer_.initialize(); // Retrigger a dash.js-specific error event as a player error\n // See src/streaming/utils/ErrorHandler.js in dash.js code\n // Handled with error (playback is stopped):\n // - capabilityError\n // - downloadError\n // - manifestError\n // - mediaSourceError\n // - mediaKeySessionError\n // Not handled:\n // - timedTextError (video can still play)\n // - mediaKeyMessageError (only fires under 'might not work' circumstances)\n // eslint-disable-next-line complexity\n\n this.retriggerError_ = function (event) {\n if (event.type === 'error') {\n /* initialize errros for ref https://cdn.dashjs.org/latest/jsdoc/core_errors_Errors.js.html\n map to general init error\n */\n if (event.error.code >= 10 && event.error.code <= 35) {\n _this.player.error({\n code: 4,\n dashjsErrorCode: event.error.code,\n message: event.error.message\n });\n } else if (event.error.code < 10) {\n // network errors\n _this.player.error({\n code: event.error.code,\n dashjsErrorCode: event.error.code,\n message: event.error.message\n });\n } else if (event.error.code >= 100 && event.error.code <= 114) {\n // Protection Errors https://cdn.dashjs.org/latest/jsdoc/streaming_protection_errors_ProtectionErrors.js.html\n _this.player.error({\n code: 5,\n dashjsErrorCode: event.error.code,\n message: event.error.message\n });\n } else {\n _this.player.error({\n code: event.error.code,\n message: event.error.message\n });\n }\n } // only reset the dash player in 10ms async, so that the rest of the\n // calling function finishes\n\n\n setTimeout(function () {\n _this.mediaPlayer_.reset();\n }, 10);\n };\n\n this.mediaPlayer_.on(_dashjs.default.MediaPlayer.events.ERROR, this.retriggerError_);\n\n this.getDuration_ = function (event) {\n var periods = event.data.Period_asArray;\n var oldHasFiniteDuration = _this.hasFiniteDuration_;\n\n if (event.data.mediaPresentationDuration || periods[periods.length - 1].duration) {\n _this.hasFiniteDuration_ = true;\n } else {\n // in case we run into a weird situation where we're VOD but then\n // switch to live\n _this.hasFiniteDuration_ = false;\n }\n\n if (_this.hasFiniteDuration_ !== oldHasFiniteDuration) {\n _this.player.trigger('durationchange');\n }\n };\n\n this.mediaPlayer_.on(_dashjs.default.MediaPlayer.events.MANIFEST_LOADED, this.getDuration_); // Apply all dash options that are set\n\n if (options.dash) {\n Object.keys(options.dash).forEach(function (key) {\n var _this$mediaPlayer_;\n\n var dashOptionsKey = 'set' + key.charAt(0).toUpperCase() + key.slice(1);\n var value = options.dash[key]; // eslint-disable-next-line no-prototype-builtins\n\n if (_this.mediaPlayer_.hasOwnProperty(dashOptionsKey)) {\n // Providing a key without `set` prefix is now deprecated.\n _video.default.log.warn('Using dash options in videojs-contrib-dash without the set prefix ' + \"has been deprecated. Change '\".concat(key, \"' to '\").concat(dashOptionsKey, \"'\")); // Set key so it will still work\n\n\n key = dashOptionsKey;\n } // eslint-disable-next-line no-prototype-builtins\n\n\n if (!_this.mediaPlayer_.hasOwnProperty(key)) {\n _video.default.log.warn(\"Warning: dash configuration option unrecognized: \".concat(key));\n\n return;\n } // Guarantee `value` is an array\n\n\n if (!Array.isArray(value)) {\n value = [value];\n }\n\n (_this$mediaPlayer_ = _this.mediaPlayer_)[key].apply(_this$mediaPlayer_, _toConsumableArray(value));\n });\n }\n\n this.mediaPlayer_.attachView(this.el_); // Dash.js autoplays by default, video.js will handle autoplay\n\n this.mediaPlayer_.setAutoPlay(false); // Setup audio tracks\n // eslint-disable-next-line no-useless-call\n\n _setupAudioTracks.default.call(null, this.player, tech); // Setup text tracks\n // eslint-disable-next-line no-useless-call\n\n\n _setupTextTracks.default.call(null, this.player, tech, options); // Attach the source with any protection data\n\n\n this.mediaPlayer_.setProtectionData(this.keySystemOptions_);\n this.mediaPlayer_.attachSource(manifestSource);\n this.tech_.triggerReady(); // map videojs seek\n\n this.player.on(this.tech_, 'seeking', function () {\n // handle seek the same way as in dash.js\n _this.mediaPlayer_.seek((_this.tech_.currentTime() - 8).toFixed(2));\n });\n }\n /*\n * Iterate over the `keySystemOptions` array and convert each object into\n * the type of object Dash.js expects in the `protData` argument.\n *\n * Also rename 'licenseUrl' property in the options to an 'serverURL' property\n */\n\n\n _createClass(Html5DashJS, [{\n key: \"dispose\",\n value: function dispose() {\n if (this.mediaPlayer_) {\n this.mediaPlayer_.off(_dashjs.default.MediaPlayer.events.ERROR, this.retriggerError_);\n this.mediaPlayer_.off(_dashjs.default.MediaPlayer.events.MANIFEST_LOADED, this.getDuration_);\n this.mediaPlayer_.reset();\n }\n\n if (this.player.dash) {\n delete this.player.dash;\n }\n }\n }, {\n key: \"duration\",\n value: function duration() {\n if (this.mediaPlayer_.isDynamic() && !this.hasFiniteDuration_) {\n return Infinity;\n }\n\n return this.mediaPlayer_.duration();\n }\n /**\n * Get a list of hooks for a specific lifecycle\n *\n * @param {string} type the lifecycle to get hooks from\n * @param {Function=|Function[]=} hook Optionally add a hook tothe lifecycle\n * @return {Array} an array of hooks or epty if none\n * @method hooks\n */\n\n }], [{\n key: \"buildDashJSProtData\",\n value: function buildDashJSProtData(keySystemOptions) {\n var output = {};\n\n if (!keySystemOptions || !Array.isArray(keySystemOptions)) {\n return null;\n }\n\n for (var i = 0; i < keySystemOptions.length; i++) {\n var keySystem = keySystemOptions[i];\n\n var options = _video.default.mergeOptions({}, keySystem.options);\n\n if (options.licenseUrl) {\n options.serverURL = options.licenseUrl;\n delete options.licenseUrl;\n }\n\n output[keySystem.name] = options;\n }\n\n return output;\n }\n }, {\n key: \"hooks\",\n value: function hooks(type, hook) {\n Html5DashJS.hooks_[type] = Html5DashJS.hooks_[type] || [];\n\n if (hook) {\n Html5DashJS.hooks_[type] = Html5DashJS.hooks_[type].concat(hook);\n }\n\n return Html5DashJS.hooks_[type];\n }\n /**\n * Add a function hook to a specific dash lifecycle\n *\n * @param {string} type the lifecycle to hook the function to\n * @param {Function|Function[]} hook the function or array of functions to attach\n * @method hook\n */\n\n }, {\n key: \"hook\",\n value: function hook(type, _hook) {\n Html5DashJS.hooks(type, _hook);\n }\n /**\n * Remove a hook from a specific dash lifecycle.\n *\n * @param {string} type the lifecycle that the function hooked to\n * @param {Function} hook The hooked function to remove\n * @return {boolean} True if the function was removed, false if not found\n * @method removeHook\n */\n\n }, {\n key: \"removeHook\",\n value: function removeHook(type, hook) {\n var index = Html5DashJS.hooks(type).indexOf(hook);\n\n if (index === -1) {\n return false;\n }\n\n Html5DashJS.hooks_[type] = Html5DashJS.hooks_[type].slice();\n Html5DashJS.hooks_[type].splice(index, 1);\n return true;\n }\n }]);\n\n return Html5DashJS;\n}();\n\nHtml5DashJS.hooks_ = {};\n\nvar canHandleKeySystems = function canHandleKeySystems(source) {\n // copy the source\n source = (0, _assign.assign)({}, source);\n\n if (Html5DashJS.updateSourceData) {\n _video.default.log.warn('updateSourceData has been deprecated.' + ' Please switch to using hook(\"updatesource\", callback).');\n\n source = Html5DashJS.updateSourceData(source);\n } // call updatesource hooks\n\n\n Html5DashJS.hooks('updatesource').forEach(function (hook) {\n source = hook(source);\n });\n\n var videoEl = _document.default.createElement('video');\n\n if (source.keySystemOptions && !(_window.default.navigator.requestMediaKeySystemAccess || // IE11 Win 8.1\n videoEl.msSetMediaKeys)) {\n return false;\n }\n\n return true;\n};\n\n_video.default.DashSourceHandler = function () {\n return {\n canHandleSource: function canHandleSource(source) {\n var dashExtRE = /\\.mpd/i;\n\n if (!canHandleKeySystems(source)) {\n return '';\n }\n\n if (_video.default.DashSourceHandler.canPlayType(source.type)) {\n return 'probably';\n } else if (dashExtRE.test(source.src)) {\n return 'maybe';\n }\n\n return '';\n },\n handleSource: function handleSource(source, tech, options) {\n return new Html5DashJS(source, tech, options);\n },\n canPlayType: function canPlayType(type) {\n return _video.default.DashSourceHandler.canPlayType(type);\n }\n };\n};\n\n_video.default.DashSourceHandler.canPlayType = function (type) {\n var dashTypeRE = /^application\\/dash\\+xml/i;\n\n if (dashTypeRE.test(type)) {\n return 'probably';\n }\n\n return '';\n}; // Only add the SourceHandler if the browser supports MediaSourceExtensions\n\n\nif (_window.default.MediaSource) {\n // eslint-disable-next-line new-cap\n _video.default.getTech('Html5').registerSourceHandler(_video.default.DashSourceHandler(), 0);\n}\n\n_video.default.Html5DashJS = Html5DashJS;\nvar _default = Html5DashJS;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./plugins/dash/videojs-dash.js?");
|
|
4743
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _window = _interopRequireDefault(__webpack_require__(/*! global/window */ \"../node_modules/global/window.js\"));\n\nvar _video = _interopRequireDefault(__webpack_require__(/*! video.js */ \"../node_modules/video.js/dist/video.es.js-exposed\"));\n\nvar _dashjs = _interopRequireDefault(__webpack_require__(/*! dashjs */ \"../node_modules/dashjs/build/es5/index.js\"));\n\nvar _setupAudioTracks = _interopRequireDefault(__webpack_require__(/*! ./setup-audio-tracks */ \"./plugins/dash/setup-audio-tracks.js\"));\n\nvar _setupTextTracks = _interopRequireDefault(__webpack_require__(/*! ./setup-text-tracks */ \"./plugins/dash/setup-text-tracks.js\"));\n\nvar _document = _interopRequireDefault(__webpack_require__(/*! global/document */ \"../node_modules/global/document.js\"));\n\nvar _assign = __webpack_require__(/*! ../../utils/assign */ \"./utils/assign.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * videojs-contrib-dash\n *\n * Use Dash.js to playback DASH content inside of Video.js via a SourceHandler\n */\nvar Html5DashJS = /*#__PURE__*/function () {\n function Html5DashJS(source, tech, options) {\n var _this = this;\n\n _classCallCheck(this, Html5DashJS);\n\n // Get options from tech if not provided for backwards compatibility\n options = options || tech.options_;\n this.player = (0, _video.default)(options.playerId);\n this.player.dash = this.player.dash || {};\n this.tech_ = tech;\n this.el_ = tech.el();\n this.elParent_ = this.el_.parentNode;\n this.hasFiniteDuration_ = false; // Do nothing if the src is falsey\n\n if (!source.src) {\n return;\n } // While the manifest is loading and Dash.js has not finished initializing\n // we must defer events and functions calls with isReady_ and then `triggerReady`\n // again later once everything is setup\n\n\n tech.isReady_ = false;\n\n if (Html5DashJS.updateSourceData) {\n _video.default.log.warn('updateSourceData has been deprecated.' + ' Please switch to using hook(\"updatesource\", callback).');\n\n source = Html5DashJS.updateSourceData(source);\n } // call updatesource hooks\n\n\n Html5DashJS.hooks('updatesource').forEach(function (hook) {\n source = hook(source);\n });\n var manifestSource = source.src;\n this.keySystemOptions_ = Html5DashJS.buildDashJSProtData(source.keySystemOptions); // eslint-disable-next-line new-cap\n\n this.player.dash.mediaPlayer = _dashjs.default.MediaPlayer().create();\n this.mediaPlayer_ = this.player.dash.mediaPlayer; // For whatever reason, we need to call setTextDefaultEnabled(false) to get\n // VTT captions to show, even though we're doing virtually the same thing\n // in setup-text-tracks.js\n\n this.mediaPlayer_.setTextDefaultEnabled(false); // Log MedaPlayer messages through video.js\n\n if (Html5DashJS.useVideoJSDebug) {\n _video.default.log.warn('useVideoJSDebug has been deprecated.' + ' Please switch to using hook(\"beforeinitialize\", callback).');\n\n Html5DashJS.useVideoJSDebug(this.mediaPlayer_);\n }\n\n if (Html5DashJS.beforeInitialize) {\n _video.default.log.warn('beforeInitialize has been deprecated.' + ' Please switch to using hook(\"beforeinitialize\", callback).');\n\n Html5DashJS.beforeInitialize(this.player, this.mediaPlayer_);\n }\n\n Html5DashJS.hooks('beforeinitialize').forEach(function (hook) {\n hook(_this.player, _this.mediaPlayer_);\n }); // Must run controller before these two lines or else there is no\n // element to bind to.\n\n this.mediaPlayer_.initialize(); // Retrigger a dash.js-specific error event as a player error\n // See src/streaming/utils/ErrorHandler.js in dash.js code\n // Handled with error (playback is stopped):\n // - capabilityError\n // - downloadError\n // - manifestError\n // - mediaSourceError\n // - mediaKeySessionError\n // Not handled:\n // - timedTextError (video can still play)\n // - mediaKeyMessageError (only fires under 'might not work' circumstances)\n // eslint-disable-next-line complexity\n\n this.retriggerError_ = function (event) {\n if (event.type === 'error') {\n /* initialize errros for ref https://cdn.dashjs.org/latest/jsdoc/core_errors_Errors.js.html\n map to general init error\n */\n if (event.error.code >= 10 && event.error.code <= 35) {\n _this.player.error({\n code: 4,\n dashjsErrorCode: event.error.code,\n message: event.error.message\n });\n } else if (event.error.code < 10) {\n // network errors\n _this.player.error({\n code: event.error.code,\n dashjsErrorCode: event.error.code,\n message: event.error.message\n });\n } else if (event.error.code >= 100 && event.error.code <= 114) {\n // Protection Errors https://cdn.dashjs.org/latest/jsdoc/streaming_protection_errors_ProtectionErrors.js.html\n _this.player.error({\n code: 5,\n dashjsErrorCode: event.error.code,\n message: event.error.message\n });\n } else {\n _this.player.error({\n code: event.error.code,\n message: event.error.message\n });\n }\n } // only reset the dash player in 10ms async, so that the rest of the\n // calling function finishes\n\n\n setTimeout(function () {\n _this.mediaPlayer_.reset();\n }, 10);\n };\n\n this.mediaPlayer_.on(_dashjs.default.MediaPlayer.events.ERROR, this.retriggerError_);\n\n this.getDuration_ = function (event) {\n var periods = event.data.Period_asArray;\n var oldHasFiniteDuration = _this.hasFiniteDuration_;\n\n if (event.data.mediaPresentationDuration || periods[periods.length - 1].duration) {\n _this.hasFiniteDuration_ = true;\n } else {\n // in case we run into a weird situation where we're VOD but then\n // switch to live\n _this.hasFiniteDuration_ = false;\n }\n\n if (_this.hasFiniteDuration_ !== oldHasFiniteDuration) {\n _this.player.trigger('durationchange');\n }\n };\n\n this.mediaPlayer_.on(_dashjs.default.MediaPlayer.events.MANIFEST_LOADED, this.getDuration_); // Apply all dash options that are set\n\n if (options.dash) {\n Object.keys(options.dash).forEach(function (key) {\n var _this$mediaPlayer_;\n\n var dashOptionsKey = 'set' + key.charAt(0).toUpperCase() + key.slice(1);\n var value = options.dash[key]; // eslint-disable-next-line no-prototype-builtins\n\n if (_this.mediaPlayer_.hasOwnProperty(dashOptionsKey)) {\n // Providing a key without `set` prefix is now deprecated.\n _video.default.log.warn('Using dash options in videojs-contrib-dash without the set prefix ' + \"has been deprecated. Change '\".concat(key, \"' to '\").concat(dashOptionsKey, \"'\")); // Set key so it will still work\n\n\n key = dashOptionsKey;\n } // eslint-disable-next-line no-prototype-builtins\n\n\n if (!_this.mediaPlayer_.hasOwnProperty(key)) {\n _video.default.log.warn(\"Warning: dash configuration option unrecognized: \".concat(key));\n\n return;\n } // Guarantee `value` is an array\n\n\n if (!Array.isArray(value)) {\n value = [value];\n }\n\n (_this$mediaPlayer_ = _this.mediaPlayer_)[key].apply(_this$mediaPlayer_, _toConsumableArray(value));\n });\n }\n\n this.mediaPlayer_.attachView(this.el_); // Dash.js autoplays by default, video.js will handle autoplay\n\n this.mediaPlayer_.setAutoPlay(false); // Setup audio tracks\n // eslint-disable-next-line no-useless-call\n\n _setupAudioTracks.default.call(null, this.player, tech); // Setup text tracks\n // eslint-disable-next-line no-useless-call\n\n\n _setupTextTracks.default.call(null, this.player, tech, options); // Attach the source with any protection data\n\n\n this.mediaPlayer_.setProtectionData(this.keySystemOptions_);\n this.mediaPlayer_.attachSource(manifestSource);\n this.tech_.triggerReady(); // map videojs seek\n\n this.player.on(this.tech_, 'seeking', function () {\n // handle seek the same way as in dash.js\n _this.mediaPlayer_.seek((_this.tech_.currentTime() - 8).toFixed(2));\n });\n }\n /*\n * Iterate over the `keySystemOptions` array and convert each object into\n * the type of object Dash.js expects in the `protData` argument.\n *\n * Also rename 'licenseUrl' property in the options to an 'serverURL' property\n */\n\n\n _createClass(Html5DashJS, [{\n key: \"dispose\",\n value: function dispose() {\n if (this.mediaPlayer_) {\n this.mediaPlayer_.off(_dashjs.default.MediaPlayer.events.ERROR, this.retriggerError_);\n this.mediaPlayer_.off(_dashjs.default.MediaPlayer.events.MANIFEST_LOADED, this.getDuration_);\n this.mediaPlayer_.reset();\n }\n\n if (this.player.dash) {\n delete this.player.dash;\n }\n }\n }, {\n key: \"duration\",\n value: function duration() {\n if (this.mediaPlayer_.isDynamic() && !this.hasFiniteDuration_) {\n return Infinity;\n }\n\n return this.mediaPlayer_.duration();\n }\n /**\n * Get a list of hooks for a specific lifecycle\n *\n * @param {string} type the lifecycle to get hooks from\n * @param {Function=|Function[]=} hook Optionally add a hook tothe lifecycle\n * @return {Array} an array of hooks or epty if none\n * @method hooks\n */\n\n }], [{\n key: \"buildDashJSProtData\",\n value: function buildDashJSProtData(keySystemOptions) {\n var output = {};\n\n if (!keySystemOptions || !Array.isArray(keySystemOptions)) {\n return null;\n }\n\n for (var i = 0; i < keySystemOptions.length; i++) {\n var keySystem = keySystemOptions[i];\n\n var options = _video.default.mergeOptions({}, keySystem.options);\n\n if (options.licenseUrl) {\n options.serverURL = options.licenseUrl;\n delete options.licenseUrl;\n }\n\n output[keySystem.name] = options;\n }\n\n return output;\n }\n }, {\n key: \"hooks\",\n value: function hooks(type, hook) {\n Html5DashJS.hooks_[type] = Html5DashJS.hooks_[type] || [];\n\n if (hook) {\n Html5DashJS.hooks_[type] = Html5DashJS.hooks_[type].concat(hook);\n }\n\n return Html5DashJS.hooks_[type];\n }\n /**\n * Add a function hook to a specific dash lifecycle\n *\n * @param {string} type the lifecycle to hook the function to\n * @param {Function|Function[]} hook the function or array of functions to attach\n * @method hook\n */\n\n }, {\n key: \"hook\",\n value: function hook(type, _hook) {\n Html5DashJS.hooks(type, _hook);\n }\n /**\n * Remove a hook from a specific dash lifecycle.\n *\n * @param {string} type the lifecycle that the function hooked to\n * @param {Function} hook The hooked function to remove\n * @return {boolean} True if the function was removed, false if not found\n * @method removeHook\n */\n\n }, {\n key: \"removeHook\",\n value: function removeHook(type, hook) {\n var index = Html5DashJS.hooks(type).indexOf(hook);\n\n if (index === -1) {\n return false;\n }\n\n Html5DashJS.hooks_[type] = Html5DashJS.hooks_[type].slice();\n Html5DashJS.hooks_[type].splice(index, 1);\n return true;\n }\n }]);\n\n return Html5DashJS;\n}();\n\nHtml5DashJS.hooks_ = {};\n\nvar canHandleKeySystems = function canHandleKeySystems(source) {\n // copy the source\n source = JSON.parse(JSON.stringify(source));\n\n if (Html5DashJS.updateSourceData) {\n _video.default.log.warn('updateSourceData has been deprecated.' + ' Please switch to using hook(\"updatesource\", callback).');\n\n source = Html5DashJS.updateSourceData(source);\n } // call updatesource hooks\n\n\n Html5DashJS.hooks('updatesource').forEach(function (hook) {\n source = hook(source);\n });\n\n var videoEl = _document.default.createElement('video');\n\n if (source.keySystemOptions && !(_window.default.navigator.requestMediaKeySystemAccess || // IE11 Win 8.1\n videoEl.msSetMediaKeys)) {\n return false;\n }\n\n return true;\n};\n\n_video.default.DashSourceHandler = function () {\n return {\n canHandleSource: function canHandleSource(source) {\n var dashExtRE = /\\.mpd/i;\n\n if (!canHandleKeySystems(source)) {\n return '';\n }\n\n if (_video.default.DashSourceHandler.canPlayType(source.type)) {\n return 'probably';\n } else if (dashExtRE.test(source.src)) {\n return 'maybe';\n }\n\n return '';\n },\n handleSource: function handleSource(source, tech, options) {\n return new Html5DashJS(source, tech, options);\n },\n canPlayType: function canPlayType(type) {\n return _video.default.DashSourceHandler.canPlayType(type);\n }\n };\n};\n\n_video.default.DashSourceHandler.canPlayType = function (type) {\n var dashTypeRE = /^application\\/dash\\+xml/i;\n\n if (dashTypeRE.test(type)) {\n return 'probably';\n }\n\n return '';\n}; // Only add the SourceHandler if the browser supports MediaSourceExtensions\n\n\nif (_window.default.MediaSource) {\n // eslint-disable-next-line new-cap\n _video.default.getTech('Html5').registerSourceHandler(_video.default.DashSourceHandler(), 0);\n}\n\n_video.default.Html5DashJS = Html5DashJS;\nvar _default = Html5DashJS;\nexports.default = _default;\n\n//# sourceURL=webpack://cloudinaryVideoPlayer/./plugins/dash/videojs-dash.js?");
|
|
4733
4744
|
|
|
4734
4745
|
/***/ }),
|
|
4735
4746
|
|
|
@@ -4925,6 +4936,18 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
4925
4936
|
|
|
4926
4937
|
/***/ }),
|
|
4927
4938
|
|
|
4939
|
+
/***/ "./utils/consts.js":
|
|
4940
|
+
/*!*************************!*\
|
|
4941
|
+
!*** ./utils/consts.js ***!
|
|
4942
|
+
\*************************/
|
|
4943
|
+
/*! no static exports found */
|
|
4944
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
4945
|
+
|
|
4946
|
+
"use strict";
|
|
4947
|
+
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?");
|
|
4948
|
+
|
|
4949
|
+
/***/ }),
|
|
4950
|
+
|
|
4928
4951
|
/***/ "./utils/css-prefix.js":
|
|
4929
4952
|
/*!*****************************!*\
|
|
4930
4953
|
!*** ./utils/css-prefix.js ***!
|
|
@@ -5185,7 +5208,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
5185
5208
|
/***/ (function(module, exports, __webpack_require__) {
|
|
5186
5209
|
|
|
5187
5210
|
"use strict";
|
|
5188
|
-
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/video.es.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 _qualitySelector = _interopRequireDefault(__webpack_require__(/*! ./components/qualitySelector/qualitySelector.js */ \"./components/qualitySelector/qualitySelector.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 _interactionArea = __webpack_require__(/*! ./components/interaction-area/interaction-area.service */ \"./components/interaction-area/interaction-area.service.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\n _this.interactionArea = (0, _interactionArea.interactionAreaService)(_assertThisInitialized(_this), _this.playerOptions, _this._videojsOptions); // #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\n\n _this2.interactionArea.init(); // #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); // #endif\n\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\n }, {\n key: \"_initQualitySelector\",\n value: function _initQualitySelector() {\n var _this4 = this;\n\n if (this._videojsOptions.controlBar && this.playerOptions.qualitySelector !== false) {\n if (_video.default.browser.IE_VERSION === null) {\n this.videojs.httpSourceSelector({\n default: 'auto'\n });\n }\n\n this.videojs.on('loadedmetadata', function () {\n _qualitySelector.default.init(_this4.videojs);\n }); // Show only if more then one option available\n\n this.videojs.on('loadeddata', function () {\n _qualitySelector.default.setVisibility(_this4.videojs);\n });\n }\n } // #endif\n\n }, {\n key: \"_initTextTracks\",\n value: function _initTextTracks() {\n var _this5 = this;\n\n this.videojs.on('refreshTextTracks', function (e, tracks) {\n _this5.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 _this6 = this;\n\n if (!this.isVideoReady()) {\n if (this.nbCalls < maxNumberOfCalls) {\n this.nbCalls++;\n this.reTryId = this.videojs.setTimeout(function () {\n return _this6.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 _this7 = this;\n\n this.videojs.on('playlistcreated', function () {\n if (_this7._playlistWidget) {\n _this7._playlistWidget.dispose();\n }\n\n var plwOptions = _this7.playerOptions.playlistWidget;\n\n if ((0, _typeInference.isPlainObject)(plwOptions)) {\n if (_this7.playerOptions.fluid) {\n plwOptions.fluid = true;\n }\n\n if (_this7.playerOptions.cloudinary.fontFace) {\n plwOptions.fontFace = _this7.playerOptions.cloudinary.fontFace;\n }\n\n _this7._playlistWidget = new _playlistWidget.default(_this7.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 _this8 = 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 _this8.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\n this._initQualitySelector(); // #endif\n\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?");
|
|
5211
|
+
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/video.es.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 _qualitySelector = _interopRequireDefault(__webpack_require__(/*! ./components/qualitySelector/qualitySelector.js */ \"./components/qualitySelector/qualitySelector.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 _interactionArea = __webpack_require__(/*! ./components/interaction-area/interaction-area.service */ \"./components/interaction-area/interaction-area.service.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\n _this.interactionArea = (0, _interactionArea.interactionAreaService)(_assertThisInitialized(_this), _this.playerOptions, _this._videojsOptions); // #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\n\n _this2.interactionArea.init(); // #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); // #endif\n\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\n }, {\n key: \"_initQualitySelector\",\n value: function _initQualitySelector() {\n var _this4 = this;\n\n if (this._videojsOptions.controlBar && this.playerOptions.qualitySelector !== false) {\n if (_video.default.browser.IE_VERSION === null) {\n this.videojs.httpSourceSelector({\n default: 'auto'\n });\n }\n\n this.videojs.on(_consts.PLAYER_EVENT.LOADED_METADATA, function () {\n _qualitySelector.default.init(_this4.videojs);\n }); // Show only if more then one option available\n\n this.videojs.on(_consts.PLAYER_EVENT.LOADED_DATA, function () {\n _qualitySelector.default.setVisibility(_this4.videojs);\n });\n }\n } // #endif\n\n }, {\n key: \"_initTextTracks\",\n value: function _initTextTracks() {\n var _this5 = this;\n\n this.videojs.on(_consts.PLAYER_EVENT.REFRESH_TEXT_TRACKS, function (e, tracks) {\n _this5.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 _this6 = this;\n\n if (!this.isVideoReady()) {\n if (this.nbCalls < maxNumberOfCalls) {\n this.nbCalls++;\n this.reTryId = this.videojs.setTimeout(function () {\n return _this6.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 _this7 = this;\n\n this.videojs.on(_consts.PLAYER_EVENT.PLAYLIST_CREATED, function () {\n if (_this7._playlistWidget) {\n _this7._playlistWidget.dispose();\n }\n\n var plwOptions = _this7.playerOptions.playlistWidget;\n\n if ((0, _typeInference.isPlainObject)(plwOptions)) {\n if (_this7.playerOptions.fluid) {\n plwOptions.fluid = true;\n }\n\n if (_this7.playerOptions.cloudinary.fontFace) {\n plwOptions.fontFace = _this7.playerOptions.cloudinary.fontFace;\n }\n\n _this7._playlistWidget = new _playlistWidget.default(_this7.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 _this8 = 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 _this8.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\n this._initQualitySelector(); // #endif\n\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?");
|
|
5189
5212
|
|
|
5190
5213
|
/***/ }),
|
|
5191
5214
|
|
|
@@ -5197,7 +5220,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n
|
|
|
5197
5220
|
/***/ (function(module, exports, __webpack_require__) {
|
|
5198
5221
|
|
|
5199
5222
|
"use strict";
|
|
5200
|
-
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/video.es.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?");
|
|
5223
|
+
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/video.es.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?");
|
|
5201
5224
|
|
|
5202
5225
|
/***/ }),
|
|
5203
5226
|
|