cloudinary-video-player 3.4.0 → 3.4.1-edge.1

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * Cloudinary Video Player v3.4.0
3
- * Built on 2025-09-02T06:02:58.292Z
2
+ * Cloudinary Video Player v3.4.1-edge.1
3
+ * Built on 2025-09-03T07:54:15.331Z
4
4
  * https://github.com/cloudinary/cloudinary-video-player
5
5
  */
6
6
  /*
@@ -53,7 +53,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
53
53
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
54
54
 
55
55
  "use strict";
56
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var hls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! hls.js */ \"../node_modules/hls.js/dist/hls.mjs\");\n\n\n\n\n/**\n * hls.js source handler\n * Source: https://github.com/Peer5/videojs-contrib-hls.js\n * @param source\n * @param tech\n * @constructor\n */\nfunction Html5HlsJS(source, tech) {\n var options = tech.options_;\n var el = tech.el();\n var duration = null;\n var hls = this.hls = new hls_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](options.hlsjsConfig);\n\n /**\n * creates an error handler function\n * @returns {Function}\n */\n function errorHandlerFactory() {\n var _recoverDecodingErrorDate = null;\n var _recoverAudioCodecErrorDate = null;\n return function () {\n var now = Date.now();\n if (!_recoverDecodingErrorDate || now - _recoverDecodingErrorDate > 2000) {\n _recoverDecodingErrorDate = now;\n hls.recoverMediaError();\n } else if (!_recoverAudioCodecErrorDate || now - _recoverAudioCodecErrorDate > 2000) {\n _recoverAudioCodecErrorDate = now;\n hls.swapAudioCodec();\n hls.recoverMediaError();\n } else {\n console.error('Error loading media: File could not be played');\n }\n };\n }\n\n // create separate error handlers for hlsjs and the video tag\n var hlsjsErrorHandler = errorHandlerFactory();\n var videoTagErrorHandler = errorHandlerFactory();\n\n // listen to error events coming from the video tag\n el.addEventListener('error', function (e) {\n var mediaError = e.currentTarget.error;\n if (mediaError.code === mediaError.MEDIA_ERR_DECODE) {\n videoTagErrorHandler();\n } else {\n console.error('Error loading media: File could not be played');\n }\n });\n\n /**\n * Destroys the Hls instance\n */\n this.dispose = function () {\n hls.destroy();\n };\n\n /**\n * returns the duration of the stream, or Infinity if live video\n * @returns {Infinity|number}\n */\n this.duration = function () {\n return duration || el.duration || 0;\n };\n\n // update live status on level load\n hls.on(hls_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Events.LEVEL_LOADED, function (event, data) {\n duration = data.details.live ? Infinity : data.details.totalduration;\n });\n\n // try to recover on fatal errors\n hls.on(hls_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Events.ERROR, function (event, data) {\n if (data.fatal) {\n switch (data.type) {\n case hls_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].ErrorTypes.NETWORK_ERROR:\n hls.startLoad();\n break;\n case hls_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].ErrorTypes.MEDIA_ERROR:\n hlsjsErrorHandler();\n break;\n default:\n console.error('Error loading media: File could not be played');\n break;\n }\n }\n });\n Object.keys(hls_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Events).forEach(function (key) {\n var eventName = hls_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Events[key];\n hls.on(eventName, function (event, data) {\n tech.trigger(eventName, data);\n });\n });\n\n // Intercept native TextTrack calls and route to video.js directly only\n // if native text tracks are not supported on this browser.\n if (!tech.featuresNativeTextTracks) {\n Object.defineProperty(el, 'textTracks', {\n value: tech.textTracks,\n writable: false\n });\n el.addTextTrack = function () {\n return tech.addTextTrack.apply(tech, arguments);\n };\n }\n\n // attach hlsjs to videotag\n hls.attachMedia(el);\n hls.loadSource(source.src);\n}\nvar hlsTypeRE = /^application\\/(x-mpegURL|vnd\\.apple\\.mpegURL)$/i;\nvar hlsExtRE = /\\.m3u8/i;\nvar HlsSourceHandler = {\n canHandleSource: function (source) {\n if (source.skipContribHlsJs) {\n return '';\n } else if (hlsTypeRE.test(source.type)) {\n return 'probably';\n } else if (hlsExtRE.test(source.src)) {\n return 'maybe';\n } else {\n return '';\n }\n },\n handleSource: function (source, tech) {\n return new Html5HlsJS(source, tech);\n },\n canPlayType: function (type) {\n if (hlsTypeRE.test(type)) {\n return 'probably';\n }\n return '';\n }\n};\nif (hls_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isSupported()) {\n var videojs = window.videojs;\n\n // support es6 style import\n videojs = videojs && videojs.default || videojs;\n if (videojs) {\n var html5Tech = videojs.getTech && videojs.getTech('Html5'); // videojs6 (partially on videojs5 too)\n html5Tech = html5Tech || videojs.getComponent && videojs.getComponent('Html5'); // videojs5\n\n if (html5Tech) {\n html5Tech.registerSourceHandler(HlsSourceHandler, 0);\n }\n } else {\n console.warn('videojs-contrib-hls.js: Couldn\\'t find find window.videojs nor require(\\'video.js\\')');\n }\n}\n\n//# sourceURL=webpack://cloudinary-video-player/./plugins/adaptive-streaming/videojs-contrib-hlsjs.js?");
56
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var hls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! hls.js */ \"../node_modules/hls.js/dist/hls.mjs\");\n\n\n\n\n/**\n * hls.js source handler\n * Source: https://github.com/Peer5/videojs-contrib-hls.js\n * @param source\n * @param tech\n * @constructor\n */\nfunction Html5HlsJS(source, tech) {\n var options = tech.options_;\n var el = tech.el();\n var duration = null;\n var hls = this.hls = new hls_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](options.hlsjsConfig);\n\n /**\n * creates an error handler function\n * @returns {Function}\n */\n function errorHandlerFactory() {\n var _recoverDecodingErrorDate = null;\n var _recoverAudioCodecErrorDate = null;\n return function () {\n var now = Date.now();\n if (!_recoverDecodingErrorDate || now - _recoverDecodingErrorDate > 2000) {\n _recoverDecodingErrorDate = now;\n hls.recoverMediaError();\n } else if (!_recoverAudioCodecErrorDate || now - _recoverAudioCodecErrorDate > 2000) {\n _recoverAudioCodecErrorDate = now;\n hls.swapAudioCodec();\n hls.recoverMediaError();\n } else {\n console.error('Error loading media: File could not be played');\n }\n };\n }\n\n // create separate error handlers for hlsjs and the video tag\n var hlsjsErrorHandler = errorHandlerFactory();\n var videoTagErrorHandler = errorHandlerFactory();\n\n // listen to error events coming from the video tag\n el.addEventListener('error', function (e) {\n var mediaError = e.currentTarget.error;\n if (mediaError.code === mediaError.MEDIA_ERR_DECODE) {\n videoTagErrorHandler();\n } else {\n console.error('Error loading media: File could not be played');\n }\n });\n\n /**\n * Destroys the Hls instance\n */\n this.dispose = function () {\n hls.destroy();\n };\n\n /**\n * returns the duration of the stream, or Infinity if live video\n * @returns {Infinity|number}\n */\n this.duration = function () {\n return duration || el.duration || 0;\n };\n\n // update live status on level load\n hls.on(hls_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Events.LEVEL_LOADED, function (event, data) {\n duration = data.details.live ? Infinity : data.details.totalduration;\n });\n\n // try to recover on fatal errors\n hls.on(hls_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Events.ERROR, function (event, data) {\n if (data.fatal) {\n switch (data.type) {\n case hls_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].ErrorTypes.NETWORK_ERROR:\n hls.startLoad();\n break;\n case hls_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].ErrorTypes.MEDIA_ERROR:\n hlsjsErrorHandler();\n break;\n default:\n console.error('Error loading media: File could not be played');\n break;\n }\n }\n });\n Object.keys(hls_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Events).forEach(function (key) {\n var eventName = hls_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Events[key];\n hls.on(eventName, function (event, data) {\n tech.trigger(eventName, data);\n });\n });\n\n // Intercept native TextTrack calls and route to video.js directly only\n // if native text tracks are not supported on this browser.\n if (!tech.featuresNativeTextTracks) {\n Object.defineProperty(el, 'textTracks', {\n get: function () {\n try {\n return typeof tech.textTracks === 'function' ? tech.textTracks() : tech.textTracks;\n } catch {\n return [];\n }\n }\n });\n el.addTextTrack = function () {\n return tech.addTextTrack.apply(tech, arguments);\n };\n }\n\n // attach hlsjs to videotag\n hls.attachMedia(el);\n hls.loadSource(source.src);\n}\nvar hlsTypeRE = /^application\\/(x-mpegURL|vnd\\.apple\\.mpegURL)$/i;\nvar hlsExtRE = /\\.m3u8/i;\nvar HlsSourceHandler = {\n canHandleSource: function (source) {\n if (source.skipContribHlsJs) {\n return '';\n } else if (hlsTypeRE.test(source.type)) {\n return 'probably';\n } else if (hlsExtRE.test(source.src)) {\n return 'maybe';\n } else {\n return '';\n }\n },\n handleSource: function (source, tech) {\n return new Html5HlsJS(source, tech);\n },\n canPlayType: function (type) {\n if (hlsTypeRE.test(type)) {\n return 'probably';\n }\n return '';\n }\n};\nif (hls_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isSupported()) {\n var videojs = window.videojs;\n\n // support es6 style import\n videojs = videojs && videojs.default || videojs;\n if (videojs) {\n var html5Tech = videojs.getTech && videojs.getTech('Html5'); // videojs6 (partially on videojs5 too)\n html5Tech = html5Tech || videojs.getComponent && videojs.getComponent('Html5'); // videojs5\n\n if (html5Tech) {\n html5Tech.registerSourceHandler(HlsSourceHandler, 0);\n }\n } else {\n console.warn('videojs-contrib-hls.js: Couldn\\'t find find window.videojs nor require(\\'video.js\\')');\n }\n}\n\n//# sourceURL=webpack://cloudinary-video-player/./plugins/adaptive-streaming/videojs-contrib-hlsjs.js?");
57
57
 
58
58
  /***/ }),
59
59