cloudinary-video-player 4.1.1-edge.1 → 4.1.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.
Files changed (51) hide show
  1. package/dist/309.min.js +2 -2
  2. package/dist/526.min.js +3 -3
  3. package/dist/689.min.js +2 -2
  4. package/dist/801.min.js +3 -3
  5. package/dist/adaptive-streaming.js +3 -3
  6. package/dist/adaptive-streaming.min.js +3 -3
  7. package/dist/chapters.js +2 -2
  8. package/dist/chapters.min.js +2 -2
  9. package/dist/cld-player-core.js +6 -6
  10. package/dist/cld-player-core.min.js +3 -3
  11. package/dist/cld-poster-url.js +2 -2
  12. package/dist/cld-poster-url.min.js +2 -2
  13. package/dist/cld-video-player.css +2 -2
  14. package/dist/cld-video-player.js +6 -6
  15. package/dist/cld-video-player.light.js +6 -6
  16. package/dist/cld-video-player.light.min.js +3 -3
  17. package/dist/cld-video-player.min.css +2 -2
  18. package/dist/cld-video-player.min.js +3 -3
  19. package/dist/colors.js +2 -2
  20. package/dist/colors.min.js +2 -2
  21. package/dist/dash.js +2 -2
  22. package/dist/dash.min.js +2 -2
  23. package/dist/debug.js +2 -2
  24. package/dist/debug.min.js +2 -2
  25. package/dist/ima.js +2 -2
  26. package/dist/ima.min.js +2 -2
  27. package/dist/interaction-areas.js +2 -2
  28. package/dist/interaction-areas.min.js +2 -2
  29. package/dist/node_modules_lodash_throttle_js.js +2 -2
  30. package/dist/player-full.js +6 -6
  31. package/dist/player-full.min.js +3 -3
  32. package/dist/player.css +2 -2
  33. package/dist/player.js +2 -2
  34. package/dist/player.min.css +2 -2
  35. package/dist/player.min.js +2 -2
  36. package/dist/playlist.js +2 -2
  37. package/dist/playlist.min.js +2 -2
  38. package/dist/recommendations-overlay.js +2 -2
  39. package/dist/recommendations-overlay.min.js +2 -2
  40. package/dist/share.js +2 -2
  41. package/dist/share.min.js +2 -2
  42. package/dist/shoppable.js +2 -2
  43. package/dist/shoppable.min.js +2 -2
  44. package/dist/utils_fetch-config_js.js +2 -2
  45. package/dist/utils_schedule_js.js +2 -2
  46. package/lib/cld-video-player.min.css +2 -2
  47. package/lib/index2.js +1 -1
  48. package/lib/player.min.css +2 -2
  49. package/lib/video-player.js +3 -3
  50. package/lib/videojs-contrib-hlsjs.js +1 -0
  51. package/package.json +1 -1
package/dist/689.min.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * Cloudinary Video Player v4.1.1-edge.1
3
- * Built on 2026-09-02T09:17:13.889Z
2
+ * Cloudinary Video Player v4.1.1
3
+ * Built on 2026-09-14T07:42:41.234Z
4
4
  * https://github.com/cloudinary/cloudinary-video-player
5
5
  */
6
6
  "use strict";(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[689],{5689(e,t,o){o.d(t,{scheduleBootstrap:()=>u,shouldUseScheduleBootstrap:()=>n});var r=o(9606);const n=e=>{const t=e?.schedule,o=t?.weekly;return Array.isArray(o)&&o.length>0&&!l(t,new Date)},u=async(e,t,n)=>{const u=(0,r.yn)(e),s=(e=>e?.cloudName||e?.cloud_name||e?.cloudinaryConfig?.cloud_name)(t),a=(e=>e?.publicId||e?.sourceOptions?.publicId)(t);if(!s||!a)throw new Error("schedule.weekly requires cloudName and publicId when outside schedule");const{buildPosterUrl:i}=await o.e(172).then(o.bind(o,4705)),l=i(s,a,t?.cloudinaryConfig||{cloud_name:s}),d=!1!==t?.fluid,{videoElement:c,hadControls:y}=(0,r.cm)(u,l,{fluid:d,width:t?.width,height:t?.height,cropMode:t?.sourceOptions?.cropMode,sourceOptions:t?.sourceOptions,aspectRatio:t?.aspectRatio});(e=>{if(!1!==(e?.sourceOptions?.allowUsageReport??e?.allowUsageReport))try{const t=new URLSearchParams({scheduleImageRendered:"true",cloudName:e?.cloudName||e?.cloudinaryConfig?.cloud_name||""}).toString();fetch(`https://analytics-api-s.cloudinary.com/video_player_source?${t}`)}catch{}})(t);const h={source:()=>h,loadPlayer:()=>(y&&c.setAttribute("controls",""),(0,r.Yx)({videoElement:c,options:t,ready:n}))};return h},s={sunday:0,sun:0,monday:1,mon:1,tuesday:2,tue:2,tues:2,wednesday:3,wed:3,thursday:4,thu:4,thur:4,thurs:4,friday:5,fri:5,saturday:6,sat:6},a=e=>{if("string"!=typeof e)return null;const t=e.toLowerCase().trim();return s[t]??null},i=e=>{if("string"!=typeof e)return null;const t=e.trim().match(/^(\d{1,2}):(\d{2})$/);if(!t)return null;const o=parseInt(t[1],10),r=parseInt(t[2],10);return o<0||o>23||r<0||r>59?null:60*o+r},l=(e,t)=>{const o=e?.weekly;if(!Array.isArray(o)||0===o.length)return!0;const r=1440*t.getDay()+60*t.getHours()+t.getMinutes();for(const e of o){const t=a(e.day);if(null===t)continue;const o=i(e.start);if(null===o||"number"!=typeof e.duration||e.duration<=0)continue;if((r-(1440*t+o)+10080)%10080<60*e.duration)return!0}return!1}}}]);
package/dist/801.min.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * Cloudinary Video Player v4.1.1-edge.1
3
- * Built on 2026-09-02T09:17:13.889Z
2
+ * Cloudinary Video Player v4.1.1
3
+ * Built on 2026-09-14T07:42:41.234Z
4
4
  * https://github.com/cloudinary/cloudinary-video-player
5
5
  */
6
- "use strict";(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[76,801],{6801(i,t,e){e.r(t),e.d(t,{createPlayerWithConfig:()=>k,createVideoPlayer:()=>D,default:()=>L});var s=e(6673),o=e.n(s),r=e(1698),n=e(5685),a=e.n(n),l=e(2832),h=e.n(l),d=e(7171),u=e.n(d),c=e(8446),p=e.n(c),v=e(8953),y=e.n(v),j=e(7571),g=e.n(j),_=(e(223),e(8273)),f=e(5104),O=e(7668),m=e(3105),T=e(8513),S=e(5381),C=e(8838),A=e(608),I=e(5779),P=e(1104),b=e(918),E=e(5770),R=e(4242),V=e(7311);Object.keys(_.A).forEach(i=>{o().registerPlugin(i,_.A[i])}),(0,C.go)();class w{static all(i){for(var t=arguments.length,e=new Array(t>1?t-1:0),s=1;s<t;s++)e[s-1]=arguments[s];return[...document.querySelectorAll(i)].map(i=>new w(i,...e))}get playerOptions(){return this.options.playerOptions}constructor(i,t,e){this.videoElement=i,this.options=(0,C.DS)(t),this._videojsOptions=this.options.videojsOptions,this.videoElement.classList.add("video-js"),f.A.fontFace(this.videoElement,this.playerOptions.fontFace),"init"===this._videojsOptions.bigPlayButton&&(this.videoElement.classList.add("vjs-big-play-button-init-only"),this._videojsOptions.bigPlayButton=!0),this.videojs=o()(this.videoElement,this._videojsOptions),(0,m.A)(this,this.videojs),this._isPlayerConfigValid=!0,this.playerOptions.debug&&(0,I.I6)(this.options).then(i=>{if(!i)return this._isPlayerConfigValid=!1,void this.videojs.error("invalid player configuration")}),this._videojsOptions.muted&&this.videojs.volume(.4),this.playerOptions.fluid&&this.fluid(this.playerOptions.fluid),this._setCssClasses(),this._initPlugins(),this._initJumpButtons(),this._initPictureInPicture(),this._initBigPauseButton(),this._setVideoJsListeners(e)}getVPInstanceId(){return this.vpInstanceId||(this.vpInstanceId=(0,r.A)()),this.vpInstanceId}_sendInternalAnalytics(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Object.assign({},this.playerOptions,this.options.videojsOptions,i);if(t.sourceOptions?.allowUsageReport)try{const i=t._internalAnalyticsMetadata??{},e=(0,b.o)(t),s=new URLSearchParams(e).toString(),o=new URLSearchParams({vpVersion:"4.1.1-edge.1",vpInstanceId:this.getVPInstanceId(),cloudName:t.cloudinary.cloud_name,...i}).toString();fetch(`https://analytics-api-s.cloudinary.com/video_player_source?${s}&${o}`)}catch(i){console.warn(i)}}_resetReTryVideoState=()=>{this.reTryVideoStateRetriesCount=0,this.videojs.clearTimeout(this.reTryVideoStateTimeoutId)};_handleRefresh=()=>{this.videojs.error(null);const i=this.currentPublicId()||this.currentSourceUrl();i&&this.source(i,this.playerOptions.sourceOptions||{})};_setVideoJsListeners(i){this.videojs.on(P.f.ERROR,()=>{const i=this.videojs.error();if(i){const t=this._isPlayerConfigValid&&this.videojs.cloudinary.currentSourceType();[3===i.code&&o().browser.IS_SAFARI,4===i.code].includes(!0)&&[P.x.AUDIO,P.x.VIDEO].includes(t)?this.isLiveStream?(this.videojs.error({code:E.bo.CUSTOM,message:"Live Stream not started"}),this.reloadVideoUntilAvailable()):(this.videojs.error(null),f.A.handleCldError(this,this.playerOptions)):this._resetReTryVideoState()}}),this.videojs.tech_.on(P.f.RETRY_PLAYLIST,()=>{h()(this.videojs,"hls.stats.mediaRequestsErrored",0)>0&&(this._resetReTryVideoState(),f.A.handleCldError(this,this.playerOptions))}),this.videojs.on(P.f.PLAY,this._resetReTryVideoState),this.videojs.on(P.f.CAN_PLAY_THROUGH,this._resetReTryVideoState),this.videojs.on(P.f.CLD_SOURCE_CHANGED,this._onSourceChange.bind(this)),this.videojs.on(P.f.REFRESH,this._handleRefresh.bind(this)),this.videojs.ready(()=>{this._onReady(),this._applyVolumeBarAriaLiveFix(),i&&i(this)})}_initPlugins(){this._initIma(),this._initAutoplay(),this._initContextMenu(),this._initPerSrcBehaviors(),this._initCloudinary(),this._initAnalytics(),this._initCloudinaryAnalytics(),this._initFloatingPlayer(),this._initShare(),this._initColors(),this._initTextTracks(),this._initHighlightsGraph(),this._initSeekThumbs(),this._initChapters(),this._initInteractionAreas(),this._initSourceSwitcher()}_isFullScreen(){return this.videojs.player().isFullscreen()}_initIma(){this.playerOptions.ads&&0!==Object.keys(this.playerOptions.ads).length&&_.A.imaPlugin(this.videojs,this.playerOptions)}setTextTracks(i){if(this.textTracksManager.removeAllTextTracks(),i){const t=Object.keys(i),e=[];for(const s of t)if("options"!==s){const t=Array.isArray(i[s])?i[s]:[i[s]];for(const i of t)e.push({...i,kind:s,label:i.label,srclang:i.language,default:!!i.default,src:i.url})}this.textTracksManager.addTextTracks(e),i.options&&this.videojs.styledTextTracks&&this.videojs.styledTextTracks(i.options)}}_initSeekThumbs(){this.playerOptions.seekThumbnails&&this.videojs.on(P.f.CLD_SOURCE_CHANGED,(i,t)=>{let{source:e}=t;if(!e||e.getType()===P.x.AUDIO||"live"===e.resourceConfig().type||(0,E.iT)(e.publicId())||this.videojs.activePlugins_&&this.videojs.activePlugins_.vr)return;const s=e.publicId(),o=(0,E.hS)(Object.assign({},e.transformation())),r=[...Array.isArray(o)?o:[o],{flags:["sprite"]}],n=e.config().url(`${s}.vtt`,{transformation:r}).replace(/\.json$/,""),a=(0,V.N)(n,e.queryParams());p()(this.videojs.vttThumbnails)?this.videojs.vttThumbnails({src:a}):this.videojs.vttThumbnails.src(a)})}_initHighlightsGraph(){this.playerOptions.aiHighlightsGraph&&this.videojs.on(P.f.CLD_SOURCE_CHANGED,(i,t)=>{let{source:e}=t;if(!e||e.getType()===P.x.AUDIO||(0,E.iT)(e.publicId()))return;const s=e.publicId(),o=u()(e.transformation(),["start_offset","end_offset","duration"]),r=Object.assign({},o);r.effect="preview",r.flags=r.flags||[],r.flags.push("getinfo");const n=e.config().url(`${s}`,{transformation:r}).replace(/\.json$/,""),a=(0,V.N)(n,e.queryParams());p()(this.videojs.aiHighlightsGraph)?this.videojs.aiHighlightsGraph({src:a}):this.videojs.aiHighlightsGraph.src(a)})}_initChapters(){!this.playerOptions.chaptersButton&&this.videojs.controlBar&&this.videojs.controlBar.removeChild("chaptersButton"),this.videojs.on(P.f.CLD_SOURCE_CHANGED,(i,t)=>{let{source:e}=t;a()(e?._chapters)&&!0!==e?._chapters||!this.videojs.chapters?this.videojs.chapters?.resetPlugin&&this.videojs.chapters.resetPlugin():p()(this.videojs.chapters)?this.videojs.chapters(e._chapters):this.videojs.chapters.src(e._chapters)})}_initInteractionAreas(){this.videojs.on(P.f.READY,async()=>{this.options.videojsOptions.interactionDisplay&&this.videojs.interactionAreas&&this.videojs.interactionAreas(this,this.playerOptions,this._videojsOptions)})}_initShare(){this.videojs.on(P.f.CLD_SOURCE_CHANGED,(i,t)=>{let{source:e}=t;this.videojs.share&&(e?._download&&p()(this.videojs.share)&&this.videojs.share({download:!0}),p()(this.videojs.share)||(e?._download?this.videojs.share.addDownloadButton?.():this.videojs.share.removeDownloadButton?.()))})}_initColors(){this.playerOptions.colors&&this.videojs.colors({colors:this.playerOptions.colors})}_initTextTracks(){this.textTracksManager=this.videojs.textTracksManager(),this.videojs.on(P.f.CLD_SOURCE_CHANGED,(i,t)=>{let{source:e}=t;e?._textTracks&&this.setTextTracks(e._textTracks)})}_initPerSrcBehaviors(){this.videojs.perSourceBehaviors&&this.videojs.perSourceBehaviors()}_initJumpButtons(){!this.playerOptions.showJumpControls&&this.videojs.controlBar&&(this.videojs.controlBar.removeChild("JumpForwardButton"),this.videojs.controlBar.removeChild("JumpBackButton"))}_initPictureInPicture(){!this.playerOptions.pictureInPictureToggle&&this.videojs.controlBar&&this.videojs.controlBar.removeChild("pictureInPictureToggle")}_initBigPauseButton(){(o().browser.IS_IOS||o().browser.IS_ANDROID)&&this.videojs.addChild("BigPauseButton")}_initCloudinary(){const i=this.playerOptions.cloudinary;i.chainTarget=this,!1!==i.secure&&(0,E.lP)(i,{secure:!0});const t={cloudinaryConfig:i,...this.playerOptions.sourceOptions};this.videojs.cloudinary(t)}_initAnalytics(){const i=this.playerOptions.analytics;if(window.gtag||!i){if(i){const t="object"==typeof i?i:{};this.videojs.analytics(t)}}else console.error("Google Analytics script (gtag) is missing.")}_initCloudinaryAnalytics(){if(!!this.playerOptions.cloudinaryAnalytics){this.videojs.videoElement=this.videoElement;const i=y()(this.playerOptions.cloudinaryAnalytics)?this.playerOptions.cloudinaryAnalytics:{};this.videojs.cloudinaryAnalytics(i)}}_initSourceSwitcher(){if(this.sourceSwitcher=this.videojs.sourceSwitcher(),this.videojs.on(P.f.CLD_SOURCE_CHANGED,(i,t)=>{let{source:e}=t;const s=e.videoSources?.(),o=!!Array.isArray(s)&&!!s.length;if(this.videojs.controlBar){const i=o?"show":"hide",t=this.videojs.controlBar.getChild("sourceSwitcherButton");t&&"function"==typeof t?.[i]&&t[i]()}if(o){const i=s.findIndex(i=>{let{publicId:t}=i;return t===e.publicId()});this.sourceSwitcher.reInit({sources:s,selectedIndex:-1===i?0:i,onSourceChange:i=>{let{publicId:t,...e}=i;return this.source(t,{...e,videoSources:s})}})}}),Array.isArray(this.playerOptions.sourceOptions?.videoSources)&&this.playerOptions.sourceOptions?.videoSources.length){const{publicId:i,label:t,...e}=this.playerOptions.sourceOptions.videoSources[0];this.source(i,{...e,videoSources:this.playerOptions.sourceOptions.videoSources})}}reTryVideoStateUntilAvailable(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3;if("number"!=typeof this.reTryVideoStateRetriesCount&&(this.reTryVideoStateRetriesCount=0),(0,R.h)(this.videojs.readyState()))this.reTryVideoStateRetriesCount=0;else if(this.reTryVideoStateRetriesCount<i)this.reTryVideoStateRetriesCount++,this.reTryVideoStateTimeoutId=this.videojs.setTimeout(()=>this.reTryVideoStateUntilAvailable(i,t),t);else{let i=new Error("Video is not ready please try later");this.videojs.trigger("error",i)}}_resetReloadVideo=()=>{this.reloadVideoRetriesCount=0,this.videojs.clearTimeout(this.reloadVideoTimeoutId)};reloadVideoUntilAvailable(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3;"number"!=typeof this.reloadVideoRetriesCount&&(this.reloadVideoRetriesCount=0),this.reloadVideoRetriesCount<i?(this.reloadVideoRetriesCount++,this.reloadVideoTimeoutId=this.videojs.setTimeout(()=>{const e=this.currentSourceUrl();(0,R.O)(e,this.isLiveStream?"live":"default").then(()=>this.source(e)).catch(()=>this.reloadVideoUntilAvailable(i,t))},t)):this.videojs.trigger("error",new Error("Sorry, we could not load your video"))}_initAutoplay(){"on-scroll"===this.playerOptions.autoplayMode&&this.videojs.autoplayOnScroll()}_initContextMenu(){this.playerOptions.hideContextMenu||this.videojs.contextMenu(O.A.contextMenu)}_initFloatingPlayer(){this.playerOptions.floatingWhenNotVisible!==A.rT.NONE&&this.videojs.floatingPlayer({floatTo:this.playerOptions.floatingWhenNotVisible})}_setCssClasses(){this.videojs.addClass(f.A.CLASS_PREFIX),this.videojs.addClass(f.A.playerClassPrefix(this.videojs)),f.A.setSkinClassPrefix(this.videojs,f.A.skinClassPrefix(this.videojs))}_onReady(){this._setExtendedEvents();const i=this.playerOptions.sourceOptions.source||this.playerOptions.sourceOptions.publicId;if(i){const t=Object.assign({},this.playerOptions.sourceOptions);this.source(i,t)}}_applyVolumeBarAriaLiveFix(){const i=this.videojs.$(".vjs-volume-bar");i&&i.removeAttribute("aria-live")}_onSourceChange(i,t){let{source:e,sourceOptions:s}=t;this._sendInternalAnalytics({...s&&{sourceOptions:s}}),this.isLiveStream="live"===e?.resourceConfig()?.type}_setExtendedEvents(){const i=[];this.playerOptions.playedEventPercents&&i.push({type:P.f.PERCENTS_PLAYED,percents:this.playerOptions.playedEventPercents}),this.playerOptions.playedEventTimes&&i.push({type:P.f.TIME_PLAYED,times:this.playerOptions.playedEventTimes});const t=new T.A(this.videojs,{events:i});Object.keys(t.events).forEach(i=>{t.on(i,(t,e)=>{this.videojs.trigger({type:i,eventData:e})})})}cloudinaryConfig(i){return this.videojs.cloudinary.cloudinaryConfig(i)}currentPublicId(){return this.videojs.cloudinary.currentPublicId()}currentSourceUrl(){return this.videojs.currentSource().src}currentPoster(){return this.videojs.cloudinary.currentPoster()}source(i){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(({publicId:i,options:t}=(0,E.a5)(i,t)),!this._isPlayerConfigValid)return;if(this.playerOptions.debug&&(t.debug=!0,(0,I.Is)(t).then(i=>{i||this.videojs.error("invalid source configuration")})),i instanceof S.A)return this.videojs.cloudinary.source(i,t);t={...this.playerOptions.sourceOptions||{},...t},t.shoppable&&this.videojs.shoppable&&this.videojs.shoppable(this.videojs,t),this._resetReloadVideo(),this._resetReTryVideoState();const e=this.videojs.options_.maxTries||3,s=this.videojs.options_.videoTimeout||55e3;return this.reTryVideoStateUntilAvailable(e,s),this.videojs.cloudinary.source(i,t)}posterOptions(i){return this.videojs.cloudinary.posterOptions(i)}skin(i){return void 0!==i&&g()(i)&&f.A.setSkinClassPrefix(this.videojs,i),f.A.skinClassPrefix(this.videojs)}playlist(i){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.playerOptions.playlistWidget={...this.playerOptions.playlistWidget||{show:!1},playlist:!0},t=Object.assign({},t,{playlistWidget:this.playerOptions.playlistWidget}),this.videojs.one(P.f.READY,async()=>{(await this.videojs.playlist(t))(i,t)}),this.videojs.cloudinary.playlist?this.videojs.cloudinary.playlist(i,t):this}playlistByTag(i){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.playerOptions.playlistWidget={...this.playerOptions.playlistWidget||{show:!1},playlistByTag:!0},t=Object.assign({},t,{playlistWidget:this.playerOptions.playlistWidget}),new Promise(e=>{this.videojs.one(P.f.READY,async()=>{(await this.videojs.playlist(t))(await this.sourcesByTag(i,t),t),e(this)})})}sourcesByTag(i){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.videojs.cloudinary.sourcesByTag(i,t)}fluid(i){return void 0===i?this.videojs.fluid():(i?this.videojs.addClass(A.gi):this.videojs.removeClass(A.gi),this.videojs.fluid(i),this.videojs.trigger(P.f.FLUID,i),this)}play(){return this.playWasCalled=!0,this.videojs.play(),this}stop(){return this.pause(),this.currentTime(0),this}playPrevious(){return this.playlist().playPrevious(),this}playNext(){return this.playlist().playNext(),this}transformation(i){return this.videojs.cloudinary.transformation(i)}sourceTypes(i){return this.videojs.cloudinary.sourceTypes(i)}sourceTransformation(i){return this.videojs.cloudinary.sourceTransformation(i)}autoShowRecommendations(i){return this.videojs.cloudinary.autoShowRecommendations(i)}duration(){return this.videojs.duration()}height(i){return i?(this.videojs.height(i),this):this.videojs.height()}width(i){return i?(this.videojs.width(i),this):this.videojs.width()}volume(i){return i?(this.videojs.volume(i),this):this.videojs.volume()}mute(){return this.isMuted()||this.videojs.muted(!0),this}unmute(){return this.isMuted()&&this.videojs.muted(!1),this}isMuted(){return this.videojs.muted()}pause(){return this.videojs.pause(),this}currentTime(i){return i||0===i?(this.videojs.currentTime(i),this):this.videojs.currentTime()}maximize(){return this.isMaximized()||this.videojs.requestFullscreen(),this}exitMaximize(){return this.isMaximized()&&this.videojs.exitFullscreen(),this}isMaximized(){return this.videojs.isFullscreen()}dispose(){this.videojs.dispose()}controls(i){return void 0===i?this.videojs.controls():(this.videojs.controls(i),this)}ima(){return{playAd:this.videojs.ima.playAd}}loop(i){return void 0===i?this.videojs.loop():(this.videojs.loop(i),this)}el(){return this.videojs.el()}}const x=i=>o().obj.merge({},O.A,i),B=function(i){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const e=(0,C.iG)(i);return{videoElement:e,options:(0,C.Wi)(e,t)}},D=function(i){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=arguments.length>2?arguments[2]:void 0;const{videoElement:s,options:o}=B(i,t);return o.profile&&console.warn("Profile option requires async initialization. Use cloudinary.player() instead of cloudinary.videoPlayer()"),new w(s,x(o),e)},k=(i,t,e)=>{const{videoElement:s,options:o}=B(i,t);return new w(s,x(o),e)},L=88==e.j?w:null}}]);
6
+ "use strict";(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[76,801],{6801(i,t,e){e.r(t),e.d(t,{createPlayerWithConfig:()=>k,createVideoPlayer:()=>D,default:()=>L});var s=e(6673),o=e.n(s),r=e(1698),n=e(5685),a=e.n(n),l=e(2832),h=e.n(l),d=e(7171),u=e.n(d),c=e(8446),p=e.n(c),v=e(8953),y=e.n(v),j=e(7571),g=e.n(j),_=(e(223),e(8273)),f=e(5104),O=e(7668),m=e(3105),T=e(8513),S=e(5381),C=e(8838),A=e(608),I=e(5779),P=e(1104),b=e(918),E=e(5770),R=e(4242),V=e(7311);Object.keys(_.A).forEach(i=>{o().registerPlugin(i,_.A[i])}),(0,C.go)();class w{static all(i){for(var t=arguments.length,e=new Array(t>1?t-1:0),s=1;s<t;s++)e[s-1]=arguments[s];return[...document.querySelectorAll(i)].map(i=>new w(i,...e))}get playerOptions(){return this.options.playerOptions}constructor(i,t,e){this.videoElement=i,this.options=(0,C.DS)(t),this._videojsOptions=this.options.videojsOptions,this.videoElement.classList.add("video-js"),f.A.fontFace(this.videoElement,this.playerOptions.fontFace),"init"===this._videojsOptions.bigPlayButton&&(this.videoElement.classList.add("vjs-big-play-button-init-only"),this._videojsOptions.bigPlayButton=!0),this.videojs=o()(this.videoElement,this._videojsOptions),(0,m.A)(this,this.videojs),this._isPlayerConfigValid=!0,this.playerOptions.debug&&(0,I.I6)(this.options).then(i=>{if(!i)return this._isPlayerConfigValid=!1,void this.videojs.error("invalid player configuration")}),this._videojsOptions.muted&&this.videojs.volume(.4),this.playerOptions.fluid&&this.fluid(this.playerOptions.fluid),this._setCssClasses(),this._initPlugins(),this._initJumpButtons(),this._initPictureInPicture(),this._initBigPauseButton(),this._setVideoJsListeners(e)}getVPInstanceId(){return this.vpInstanceId||(this.vpInstanceId=(0,r.A)()),this.vpInstanceId}_sendInternalAnalytics(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Object.assign({},this.playerOptions,this.options.videojsOptions,i);if(t.sourceOptions?.allowUsageReport)try{const i=t._internalAnalyticsMetadata??{},e=(0,b.o)(t),s=new URLSearchParams(e).toString(),o=new URLSearchParams({vpVersion:"4.1.1",vpInstanceId:this.getVPInstanceId(),cloudName:t.cloudinary.cloud_name,...i}).toString();fetch(`https://analytics-api-s.cloudinary.com/video_player_source?${s}&${o}`)}catch(i){console.warn(i)}}_resetReTryVideoState=()=>{this.reTryVideoStateRetriesCount=0,this.videojs.clearTimeout(this.reTryVideoStateTimeoutId)};_handleRefresh=()=>{this.videojs.error(null);const i=this.currentPublicId()||this.currentSourceUrl();i&&this.source(i,this.playerOptions.sourceOptions||{})};_setVideoJsListeners(i){this.videojs.on(P.f.ERROR,()=>{const i=this.videojs.error();if(i){const t=this._isPlayerConfigValid&&this.videojs.cloudinary.currentSourceType();[3===i.code&&o().browser.IS_SAFARI,4===i.code].includes(!0)&&[P.x.AUDIO,P.x.VIDEO].includes(t)?this.isLiveStream?(this.videojs.error({code:E.bo.CUSTOM,message:"Live Stream not started"}),this.reloadVideoUntilAvailable()):(this.videojs.error(null),f.A.handleCldError(this,this.playerOptions)):this._resetReTryVideoState()}}),this.videojs.tech_.on(P.f.RETRY_PLAYLIST,()=>{h()(this.videojs,"hls.stats.mediaRequestsErrored",0)>0&&(this._resetReTryVideoState(),f.A.handleCldError(this,this.playerOptions))}),this.videojs.on(P.f.PLAY,this._resetReTryVideoState),this.videojs.on(P.f.CAN_PLAY_THROUGH,this._resetReTryVideoState),this.videojs.on(P.f.CLD_SOURCE_CHANGED,this._onSourceChange.bind(this)),this.videojs.on(P.f.REFRESH,this._handleRefresh.bind(this)),this.videojs.ready(()=>{this._onReady(),this._applyVolumeBarAriaLiveFix(),i&&i(this)})}_initPlugins(){this._initIma(),this._initAutoplay(),this._initContextMenu(),this._initPerSrcBehaviors(),this._initCloudinary(),this._initAnalytics(),this._initCloudinaryAnalytics(),this._initFloatingPlayer(),this._initShare(),this._initColors(),this._initTextTracks(),this._initHighlightsGraph(),this._initSeekThumbs(),this._initChapters(),this._initInteractionAreas(),this._initSourceSwitcher()}_isFullScreen(){return this.videojs.player().isFullscreen()}_initIma(){this.playerOptions.ads&&0!==Object.keys(this.playerOptions.ads).length&&_.A.imaPlugin(this.videojs,this.playerOptions)}setTextTracks(i){if(this.textTracksManager.removeAllTextTracks(),i){const t=Object.keys(i),e=[];for(const s of t)if("options"!==s){const t=Array.isArray(i[s])?i[s]:[i[s]];for(const i of t)e.push({...i,kind:s,label:i.label,srclang:i.language,default:!!i.default,src:i.url})}this.textTracksManager.addTextTracks(e),i.options&&this.videojs.styledTextTracks&&this.videojs.styledTextTracks(i.options)}}_initSeekThumbs(){this.playerOptions.seekThumbnails&&this.videojs.on(P.f.CLD_SOURCE_CHANGED,(i,t)=>{let{source:e}=t;if(!e||e.getType()===P.x.AUDIO||"live"===e.resourceConfig().type||(0,E.iT)(e.publicId())||this.videojs.activePlugins_&&this.videojs.activePlugins_.vr)return;const s=e.publicId(),o=(0,E.hS)(Object.assign({},e.transformation())),r=[...Array.isArray(o)?o:[o],{flags:["sprite"]}],n=e.config().url(`${s}.vtt`,{transformation:r}).replace(/\.json$/,""),a=(0,V.N)(n,e.queryParams());p()(this.videojs.vttThumbnails)?this.videojs.vttThumbnails({src:a}):this.videojs.vttThumbnails.src(a)})}_initHighlightsGraph(){this.playerOptions.aiHighlightsGraph&&this.videojs.on(P.f.CLD_SOURCE_CHANGED,(i,t)=>{let{source:e}=t;if(!e||e.getType()===P.x.AUDIO||(0,E.iT)(e.publicId()))return;const s=e.publicId(),o=u()(e.transformation(),["start_offset","end_offset","duration"]),r=Object.assign({},o);r.effect="preview",r.flags=r.flags||[],r.flags.push("getinfo");const n=e.config().url(`${s}`,{transformation:r}).replace(/\.json$/,""),a=(0,V.N)(n,e.queryParams());p()(this.videojs.aiHighlightsGraph)?this.videojs.aiHighlightsGraph({src:a}):this.videojs.aiHighlightsGraph.src(a)})}_initChapters(){!this.playerOptions.chaptersButton&&this.videojs.controlBar&&this.videojs.controlBar.removeChild("chaptersButton"),this.videojs.on(P.f.CLD_SOURCE_CHANGED,(i,t)=>{let{source:e}=t;a()(e?._chapters)&&!0!==e?._chapters||!this.videojs.chapters?this.videojs.chapters?.resetPlugin&&this.videojs.chapters.resetPlugin():p()(this.videojs.chapters)?this.videojs.chapters(e._chapters):this.videojs.chapters.src(e._chapters)})}_initInteractionAreas(){this.videojs.on(P.f.READY,async()=>{this.options.videojsOptions.interactionDisplay&&this.videojs.interactionAreas&&this.videojs.interactionAreas(this,this.playerOptions,this._videojsOptions)})}_initShare(){this.videojs.on(P.f.CLD_SOURCE_CHANGED,(i,t)=>{let{source:e}=t;this.videojs.share&&(e?._download&&p()(this.videojs.share)&&this.videojs.share({download:!0}),p()(this.videojs.share)||(e?._download?this.videojs.share.addDownloadButton?.():this.videojs.share.removeDownloadButton?.()))})}_initColors(){this.playerOptions.colors&&this.videojs.colors({colors:this.playerOptions.colors})}_initTextTracks(){this.textTracksManager=this.videojs.textTracksManager(),this.videojs.on(P.f.CLD_SOURCE_CHANGED,(i,t)=>{let{source:e}=t;e?._textTracks&&this.setTextTracks(e._textTracks)})}_initPerSrcBehaviors(){this.videojs.perSourceBehaviors&&this.videojs.perSourceBehaviors()}_initJumpButtons(){!this.playerOptions.showJumpControls&&this.videojs.controlBar&&(this.videojs.controlBar.removeChild("JumpForwardButton"),this.videojs.controlBar.removeChild("JumpBackButton"))}_initPictureInPicture(){!this.playerOptions.pictureInPictureToggle&&this.videojs.controlBar&&this.videojs.controlBar.removeChild("pictureInPictureToggle")}_initBigPauseButton(){(o().browser.IS_IOS||o().browser.IS_ANDROID)&&this.videojs.addChild("BigPauseButton")}_initCloudinary(){const i=this.playerOptions.cloudinary;i.chainTarget=this,!1!==i.secure&&(0,E.lP)(i,{secure:!0});const t={cloudinaryConfig:i,...this.playerOptions.sourceOptions};this.videojs.cloudinary(t)}_initAnalytics(){const i=this.playerOptions.analytics;if(window.gtag||!i){if(i){const t="object"==typeof i?i:{};this.videojs.analytics(t)}}else console.error("Google Analytics script (gtag) is missing.")}_initCloudinaryAnalytics(){if(!!this.playerOptions.cloudinaryAnalytics){this.videojs.videoElement=this.videoElement;const i=y()(this.playerOptions.cloudinaryAnalytics)?this.playerOptions.cloudinaryAnalytics:{};this.videojs.cloudinaryAnalytics(i)}}_initSourceSwitcher(){if(this.sourceSwitcher=this.videojs.sourceSwitcher(),this.videojs.on(P.f.CLD_SOURCE_CHANGED,(i,t)=>{let{source:e}=t;const s=e.videoSources?.(),o=!!Array.isArray(s)&&!!s.length;if(this.videojs.controlBar){const i=o?"show":"hide",t=this.videojs.controlBar.getChild("sourceSwitcherButton");t&&"function"==typeof t?.[i]&&t[i]()}if(o){const i=s.findIndex(i=>{let{publicId:t}=i;return t===e.publicId()});this.sourceSwitcher.reInit({sources:s,selectedIndex:-1===i?0:i,onSourceChange:i=>{let{publicId:t,...e}=i;return this.source(t,{...e,videoSources:s})}})}}),Array.isArray(this.playerOptions.sourceOptions?.videoSources)&&this.playerOptions.sourceOptions?.videoSources.length){const{publicId:i,label:t,...e}=this.playerOptions.sourceOptions.videoSources[0];this.source(i,{...e,videoSources:this.playerOptions.sourceOptions.videoSources})}}reTryVideoStateUntilAvailable(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3;if("number"!=typeof this.reTryVideoStateRetriesCount&&(this.reTryVideoStateRetriesCount=0),(0,R.h)(this.videojs.readyState()))this.reTryVideoStateRetriesCount=0;else if(this.reTryVideoStateRetriesCount<i)this.reTryVideoStateRetriesCount++,this.reTryVideoStateTimeoutId=this.videojs.setTimeout(()=>this.reTryVideoStateUntilAvailable(i,t),t);else{let i=new Error("Video is not ready please try later");this.videojs.trigger("error",i)}}_resetReloadVideo=()=>{this.reloadVideoRetriesCount=0,this.videojs.clearTimeout(this.reloadVideoTimeoutId)};reloadVideoUntilAvailable(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3;"number"!=typeof this.reloadVideoRetriesCount&&(this.reloadVideoRetriesCount=0),this.reloadVideoRetriesCount<i?(this.reloadVideoRetriesCount++,this.reloadVideoTimeoutId=this.videojs.setTimeout(()=>{const e=this.currentSourceUrl();(0,R.O)(e,this.isLiveStream?"live":"default").then(()=>this.source(e)).catch(()=>this.reloadVideoUntilAvailable(i,t))},t)):this.videojs.trigger("error",new Error("Sorry, we could not load your video"))}_initAutoplay(){"on-scroll"===this.playerOptions.autoplayMode&&this.videojs.autoplayOnScroll()}_initContextMenu(){this.playerOptions.hideContextMenu||this.videojs.contextMenu(O.A.contextMenu)}_initFloatingPlayer(){this.playerOptions.floatingWhenNotVisible!==A.rT.NONE&&this.videojs.floatingPlayer({floatTo:this.playerOptions.floatingWhenNotVisible})}_setCssClasses(){this.videojs.addClass(f.A.CLASS_PREFIX),this.videojs.addClass(f.A.playerClassPrefix(this.videojs)),f.A.setSkinClassPrefix(this.videojs,f.A.skinClassPrefix(this.videojs))}_onReady(){this._setExtendedEvents();const i=this.playerOptions.sourceOptions.source||this.playerOptions.sourceOptions.publicId;if(i){const t=Object.assign({},this.playerOptions.sourceOptions);this.source(i,t)}}_applyVolumeBarAriaLiveFix(){const i=this.videojs.$(".vjs-volume-bar");i&&i.removeAttribute("aria-live")}_onSourceChange(i,t){let{source:e,sourceOptions:s}=t;this._sendInternalAnalytics({...s&&{sourceOptions:s}}),this.isLiveStream="live"===e?.resourceConfig()?.type}_setExtendedEvents(){const i=[];this.playerOptions.playedEventPercents&&i.push({type:P.f.PERCENTS_PLAYED,percents:this.playerOptions.playedEventPercents}),this.playerOptions.playedEventTimes&&i.push({type:P.f.TIME_PLAYED,times:this.playerOptions.playedEventTimes});const t=new T.A(this.videojs,{events:i});Object.keys(t.events).forEach(i=>{t.on(i,(t,e)=>{this.videojs.trigger({type:i,eventData:e})})})}cloudinaryConfig(i){return this.videojs.cloudinary.cloudinaryConfig(i)}currentPublicId(){return this.videojs.cloudinary.currentPublicId()}currentSourceUrl(){return this.videojs.currentSource().src}currentPoster(){return this.videojs.cloudinary.currentPoster()}source(i){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(({publicId:i,options:t}=(0,E.a5)(i,t)),!this._isPlayerConfigValid)return;if(this.playerOptions.debug&&(t.debug=!0,(0,I.Is)(t).then(i=>{i||this.videojs.error("invalid source configuration")})),i instanceof S.A)return this.videojs.cloudinary.source(i,t);t={...this.playerOptions.sourceOptions||{},...t},t.shoppable&&this.videojs.shoppable&&this.videojs.shoppable(this.videojs,t),this._resetReloadVideo(),this._resetReTryVideoState();const e=this.videojs.options_.maxTries||3,s=this.videojs.options_.videoTimeout||55e3;return this.reTryVideoStateUntilAvailable(e,s),this.videojs.cloudinary.source(i,t)}posterOptions(i){return this.videojs.cloudinary.posterOptions(i)}skin(i){return void 0!==i&&g()(i)&&f.A.setSkinClassPrefix(this.videojs,i),f.A.skinClassPrefix(this.videojs)}playlist(i){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.playerOptions.playlistWidget={...this.playerOptions.playlistWidget||{show:!1},playlist:!0},t=Object.assign({},t,{playlistWidget:this.playerOptions.playlistWidget}),this.videojs.one(P.f.READY,async()=>{(await this.videojs.playlist(t))(i,t)}),this.videojs.cloudinary.playlist?this.videojs.cloudinary.playlist(i,t):this}playlistByTag(i){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.playerOptions.playlistWidget={...this.playerOptions.playlistWidget||{show:!1},playlistByTag:!0},t=Object.assign({},t,{playlistWidget:this.playerOptions.playlistWidget}),new Promise(e=>{this.videojs.one(P.f.READY,async()=>{(await this.videojs.playlist(t))(await this.sourcesByTag(i,t),t),e(this)})})}sourcesByTag(i){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.videojs.cloudinary.sourcesByTag(i,t)}fluid(i){return void 0===i?this.videojs.fluid():(i?this.videojs.addClass(A.gi):this.videojs.removeClass(A.gi),this.videojs.fluid(i),this.videojs.trigger(P.f.FLUID,i),this)}play(){return this.playWasCalled=!0,this.videojs.play(),this}stop(){return this.pause(),this.currentTime(0),this}playPrevious(){return this.playlist().playPrevious(),this}playNext(){return this.playlist().playNext(),this}transformation(i){return this.videojs.cloudinary.transformation(i)}sourceTypes(i){return this.videojs.cloudinary.sourceTypes(i)}sourceTransformation(i){return this.videojs.cloudinary.sourceTransformation(i)}autoShowRecommendations(i){return this.videojs.cloudinary.autoShowRecommendations(i)}duration(){return this.videojs.duration()}height(i){return i?(this.videojs.height(i),this):this.videojs.height()}width(i){return i?(this.videojs.width(i),this):this.videojs.width()}volume(i){return i?(this.videojs.volume(i),this):this.videojs.volume()}mute(){return this.isMuted()||this.videojs.muted(!0),this}unmute(){return this.isMuted()&&this.videojs.muted(!1),this}isMuted(){return this.videojs.muted()}pause(){return this.videojs.pause(),this}currentTime(i){return i||0===i?(this.videojs.currentTime(i),this):this.videojs.currentTime()}maximize(){return this.isMaximized()||this.videojs.requestFullscreen(),this}exitMaximize(){return this.isMaximized()&&this.videojs.exitFullscreen(),this}isMaximized(){return this.videojs.isFullscreen()}dispose(){this.videojs.dispose()}controls(i){return void 0===i?this.videojs.controls():(this.videojs.controls(i),this)}ima(){return{playAd:this.videojs.ima.playAd}}loop(i){return void 0===i?this.videojs.loop():(this.videojs.loop(i),this)}el(){return this.videojs.el()}}const x=i=>o().obj.merge({},O.A,i),B=function(i){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const e=(0,C.iG)(i);return{videoElement:e,options:(0,C.Wi)(e,t)}},D=function(i){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=arguments.length>2?arguments[2]:void 0;const{videoElement:s,options:o}=B(i,t);return o.profile&&console.warn("Profile option requires async initialization. Use cloudinary.player() instead of cloudinary.videoPlayer()"),new w(s,x(o),e)},k=(i,t,e)=>{const{videoElement:s,options:o}=B(i,t);return new w(s,x(o),e)},L=88==e.j?w:null}}]);
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * Cloudinary Video Player v4.1.1-edge.1
3
- * Built on 2026-09-02T09:17:30.800Z
2
+ * Cloudinary Video Player v4.1.1
3
+ * Built on 2026-09-14T07:42:53.357Z
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 */ __webpa
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 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:///./plugins/adaptive-streaming/videojs-contrib-hlsjs.js?\n}");
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 configurable: true,\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:///./plugins/adaptive-streaming/videojs-contrib-hlsjs.js?\n}");
57
57
 
58
58
  /***/ },
59
59