@flowplayer/player 3.32.1 → 3.32.2-rc
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/core.js +1 -1
- package/default.js +1 -1
- package/embed.js +2 -2
- package/package.json +1 -1
- package/plugins/ads.js +1 -1
- package/plugins/analytics.js +1 -1
- package/plugins/consent.js +1 -1
- package/plugins/rts.js +1 -1
- package/plugins/ssai.js +1 -1
package/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=t()}(this,function(){"use strict";const e=[],t=[];function n(){const e="undefined"!=typeof document&&"undefined"!=typeof window,t=e?navigator.userAgent:"",n=/iP(hone|od)/i.test(t)&&!/iPad/.test(t)&&!/IEMobile/i.test(t),o=/Android/.test(t)&&!/Firefox/.test(t),r=/^((?!chrome|android).)*safari/i.test(t),i=/chrome|crios/i.test(t)&&!/opr|opera|chromium|edg|ucbrowser|googlebot/i.test(t),a=/firefox|fxios/i.test(t)&&!/seamonkey/i.test(t),s=/edg/i.test(t),l=/opr|opera/i.test(t),c=/SamsungBrowser/.test(t),d=c&&/SMART-TV/.test(t);return{controls:!n,video:function(t){return e&&document.createElement("video").canPlayType(t)},lang:e&&window.navigator.language,android:o,iphone:n,safari:r,edge:s,opera:l,chrome:i,firefox:a,ios:e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,samsung:c,samsung_tv:c&&d,touch:"ontouchstart"in window,tizen:"tizen"in window,webOS:"webos"in window}}const o="mount",r="retry",i="error",a="click",s="touchend",l="resize",c="fullscreenenter",d="fullscreenexit",u="loadedmetadata",p="loadeddata",f="progress",h="timeupdate",m="loadstart",y="volumechange",E="pause",g="playing",w="play",_="waiting",v="canplay",S="ended",N="seeked",b="seeking",A="viewenter",O="viewleave",T="src",I="reap",k="qualitychange",P="live",R="recover",C="seek:queued",L="seek:cancel",D="remotesession:ended",U="intersectionchange",M="renderplugin",F="audioonlysource",H="error:fatal",W="config",x="state",V="beforeplay",j="beforepause",K="content:loadstart",B="flowplayer:error";var G=Object.freeze({__proto__:null,MOUNT:o,RETRY:r,ERROR:i,CONTEXT_MENU:"contextmenu",CLICK:a,DBL_CLICK:"dblclick",KEYUP:"keyup",KEYDOWN:"keydown",LOAD:"load",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_MOVE:"mousemove",TOUCH_START:"touchstart",TOUCH_MOVE:"touchmove",TOUCH_END:s,TOUCH_CANCEL:"touchcancel",RESIZE:l,SCROLL:"scroll",FULLSCREEN_ENTER:c,FULLSCREEN_EXIT:d,FULLSCREEN_CHANGE:"fullscreenchange",METADATA:u,DATA:p,PROGRESS:f,TIME_UPDATE:h,LOAD_START:m,VOLUME_CHANGE:y,PAUSE:E,PLAYING:g,PLAY:w,WAITING:_,CAN_PLAY:v,ENDED:S,SEEKED:N,SEEKING:b,DURATION_CHANGE:"durationchange",VIEW_ENTER:A,VIEW_LEAVE:O,SOURCE:T,REAP:I,QUALITIES:"qualities",QUALITY_CHANGE:k,VIDEO_TRACKS:"videoTracks",SET_QUALITY:"quality:set",VIDEO_TRACK_SELECT:"tracks:video:select",RECOMMENDATIONS_READY:"recommendationsready",LANDSCAPE:"landscape",PORTRAIT:"portrait",DVR:"dvr",LIVE:P,RECOVER:R,SEEK_QUEUED:C,SEEK_CANCEL:L,PLUGIN_REGISTERED:"plugin:registered",REMOTE_SESSION_STARTED:"remotesession:started",REMOTE_SESSION_ENDED:D,INTERSECTIONCHANGE:U,WEBKIT_NEEDKEY:"webkitneedkey",RENDER_PLUGIN:M,AUDIO_ONLY_SOURCE:F,NON_RECOVERABLE_ERROR:H,CONFIG:W,STATE:x,BEFORE_PLAY:V,BEFORE_PAUSE:j,CONTENT_REAL_LOAD_START:K,CUEPOINTS:"cuepoints",CUEPOINT_START:"cuepointstart",CUEPOINT_END:"cuepointend",STANDARD_ERROR:B});var q=Object.freeze({__proto__:null,SUBTITLES_MENU:"flowplayer-subtitles-menu",SHARE_MENU:"flowplayer-share-menu",SPEED_MENU:"flowplayer-speed-menu",QUALITY_MENU:"flowplayer-quality-menu",AUDIO_MENU:"flowplayer-audio-menu",VIDEO_MENU:"flowplayer-video-menu",UI:"flowplayer-ui",LOGO:"flowplayer-logo",CONTROL:"flowplayer-control",CONTROL_BUTTONS:"flowplayer-control-buttons",LIVE_STATUS:"flowplayer-live-status",ELAPSED:"flowplayer-elapsed-time",TIMELINE:"flowplayer-timeline-bar",CHAPTERS_TIMELINE:"flowplayer-chapters-timeline-bar",CONTROL_DURATION:"flowplayer-control-duration",VOLUME_CONTROL:"flowplayer-volume-control",VOLUME_BAR:"flowplayer-volume-bar",HEADER:"flowplayer-header",HEADER_LEFT_ZONE:"flowplayer-header-left-zone",HEADER_RIGHT_ZONE:"flowplayer-header-right-zone",HEADER_DURATION:"flowplayer-header-duration",MIDDLE:"flowplayer-middle",MIDDLE_ZONE:"flowplayer-middle-zone",WAIT:"flowplayer-wait",MIDDLE_BUTTONS:"flowplayer-middle-buttons",MIDDLE_LEFT_ZONE:"flowplayer-middle-left-zone",MIDDLE_RIGHT_ZONE:"flowplayer-middle-right-zone",ENDSCREEN_INTERSTITIAL:"flowplayer-endscreen-interstitial",ENDSCREEN_UP_NEXT:"flowplayer-endscreen-up-next",ENDSCREEN_GRID:"flowplayer-endscreen-grid",PLAYLIST_INTERSTITIAL:"flowplayer-playlist-interstitial",AIRPLAY_ICON:"flowplayer-airplay-icon",CHROMECAST_ICON:"flowplayer-chromecast-icon",SMALL_PLAY_ICON:"flowplayer-small-play-icon",SMALL_PAUSE_ICON:"flowplayer-small-pause-icon",PLAY_ICON:"flowplayer-play-icon",PAUSE_ICON:"flowplayer-pause-icon",FULLSCREEN_ENTER_ICON:"flowplayer-fullscreen-enter-icon",FULLSCREEN_EXIT_ICON:"flowplayer-fullscreen-exit-icon",SKIP_NEXT_ICON:"flowplayer-skip-next-icon",SKIP_PREVIOUS_ICON:"flowplayer-skip-previous-icon",FAST_FORWARD_ICON:"flowplayer-fast-forward-icon",REWIND_ICON:"flowplayer-rewind-icon",SHARE_ICON:"flowplayer-share-icon",SUBTITLES_MENU_ICON:"flowplayer-subs-menu-icon",MENU_BACK_ICON:"flowplayer-menu-back",VOLUME_ICON:"flowplayer-volume-icon",MUTE_ICON:"flowplayer-mute-icon",UNMUTE_ICON:"flowplayer-unmute-icon",CLOSE_ICON:"flowplayer-close-icon",FACEBOOK_ICON:"flowplayer-facebook-icon",TWITTER_ICON:"flowplayer-twitter-icon",LINK_ICON:"flowplayer-link-icon",EMBED_ICON:"flowplayer-embed-icon",LIVE_COUNTDOWN:"flowplayer-live-countdown",PLAYLIST_CONTROLS:"flowplayer-playlist-controls",THUMBNAILS_CAROUSEL:"flowplayer-thumbnails-carousel",ERROR_COMPONENT:"flowplayer-error",TV_MENU:"flowplayer-tv-menu",CUE_COMPONENT:"flowplayer-cue",SSAI_UI:"flowplayer-ssai-ui",SSAI_CONTROLS:"flowplayer-ssai-controls",SSAI_TIMELINE:"flowplayer-ssai-timeline",SSAI_INDICATOR:"flowplayer-ssai-indicator"});const Y="is-playing",z="is-paused",$="is-loaded",J="is-loading",Q="is-starting",Z="is-seeking",X="is-disabled",ee="is-small",te="is-tiny",ne="is-rtl",oe="is-ended",re="is-live",ie="is-error",ae="is-waiting",se="is-autoplay",le="is-toggling",ce="is-live-seeked",de="no-timeline",ue="has-poster",pe="will-play",fe="will-pause",he="will-seek",me="is-seekable",ye="is-in-viewport",Ee="no-controls",ge="is-destroyed";var we=Object.freeze({__proto__:null,PLAYING:Y,FULLSCREEN:"is-fullscreen",PAUSED:z,MUTED:"is-muted",LOADED:$,LOADING:J,STARTING:Q,SEEKING:Z,GRABBING:"is-grabbing",DISABLED:X,SMALL:ee,TINY:te,RTL:ne,TV:"is-tv",ENDED:oe,LIVE:re,ERRORED:ie,WAITING:ae,AUTOPLAY:se,SEAMLESS:"is-seamless",TOGGLING:le,LIVE_SEEKED:ce,NO_DVR:de,HAS_POSTER:ue,WILL_PLAY:pe,WILL_PAUSE:fe,MENU_OPENED:"has-menu-opened",TOUCHED:"is-touched",HOVERED:"is-hovered",TOUCH_DEVICE:"is-touch-device",WILL_SEEK:he,SEEKABLE:me,IN_VIEWPORT:ye,NO_CONTROLS:Ee,DESTROYED:ge,IS_SOURCE_PROCESSING:"is-source-processing"});function _e(e){this.message=e}_e.prototype=new Error,_e.prototype.name="InvalidCharacterError";var ve="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new _e("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,o,r=0,i=0,a="";o=t.charAt(i++);~o&&(n=r%4?64*n+o:o,r++%4)?a+=String.fromCharCode(255&n>>(-2*r&6)):0)o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return a};var Se=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(ve(e).replace(/(.)/g,function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}(t)}catch(e){return ve(t)}};function Ne(e){this.message=e}Ne.prototype=new Error,Ne.prototype.name="InvalidTokenError";var be=function(e,t){if("string"!=typeof e)throw new Ne("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(Se(e.split(".")[n]))}catch(e){throw new Ne("Invalid token specified: "+e.message)}};be.InvalidTokenError=Ne;const Ae=new Map,Oe=(e,t)=>new(((e,t)=>{const n=e.get(t);if(!n)throw new Error(`no flowplayer component with the name ${t} exists`);const o=window.customElements.get(t);if(!o)throw new Error(`no default flowplayer component with the name ${t} exists`);const r=window.customElements.get(n);return"function"!=typeof r?o:r})(e._customElements,t))(e);var Te,Ie;!function(e){e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=4]="HIGH"}(Te||(Te={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON",e[e.AUDIO_REQUIRED=2]="AUDIO_REQUIRED"}(Ie||(Ie={}));const ke={Unknown:"00-00",MediaUnknown:"01-00",MediaUnavailable:"01-01",MediaUnsupportedVideoFormat:"01-02",MediaUnsupportedAudioFormat:"01-03",MediaBitrateExceeded:"01-04",MediaBufferOverread:"01-05",MediaIntegerOverflow:"01-06",MediaQuotaExceeded:"01-07",MediaInvalidCompositionDuration:"01-08",MediaInvalidCompositionSourceDuration:"01-09",MediaInvalidCompositionSourceStartTime:"01-10",MediaMalformedDepth:"01-11",PlaybackUnknown:"02-00",PlaybackVideoBufferUnderRun:"02-01",PlaybackAudioBufferUnderRun:"02-02",PlaybackVideoBufferingTimeout:"02-03",PlaybackAudioBufferingTimeout:"02-04",PlaybackManifestParseError:"02-05",PlaybackVideoDecodeError:"02-06",PlaybackAudioDecodeError:"02-07",PlaybackDroppedFramesExceeded:"02-08",PlaybackPlayheadExceedsDuration:"02-09",PlaybackUnsupportedDevice:"02-10",PlaybackManifestLoadError:"02-11",PlaybackManifestLoadTimeout:"02-12",PlaybackManifestParsingError:"02-13",PlaybackManifestIncompatibleCodecs:"02-14",PlaybackLevelEmptyError:"02-15",PlaybackLevelLoadError:"02-16",PlaybackLevelLoadTimeout:"02-17",PlaybackLevelSwitchError:"02-18",PlaybackAudioTrackLoadError:"02-19",PlaybackAudioTrackLoadTimeout:"02-20",PlaybackFragLoadError:"02-21",PlaybackFragLoadTimeout:"02-22",PlaybackFragDecryptError:"02-23",PlaybackFragParsingError:"02-24",PlaybackFragGap:"02-25",PlaybackRemuxAllocError:"02-26",PlaybackBufferAddCodecError:"02-27",PlaybackBufferIncompatibleCodecs:"02-28",PlaybackBufferAppendError:"02-29",PlaybackBufferStalledError:"02-30",PlaybackBufferFullError:"02-31",PlaybackBufferSeekOverHole:"02-32",PlaybackBufferNudgeOnStall:"02-33",PlaybackInternalException:"02-34",PlaybackInternalAborted:"02-35",PlaybackManifestLoaderFailure:"02-36",PlaybackSegmentBaseLoaderError:"02-37",PlaybackTimeSyncFailed:"02-38",PlaybackFragmentLoaderFailure:"02-39",PlaybackAppendError:"02-40",PlaybackRemoveError:"02-41",PlaybackDataUpdateFailed:"02-42",PlaybackManifestNoStreams:"02-43",PlaybackUnknownManifestType:"02-44",PlaybackDashInsufficientSegmentInfo:"02-45",PlaybackDashNoRepresentations:"02-46",PlaybackDashNoAdaptationSets:"02-47",PlaybackDashNoInitSegment:"02-48",PlaybackDashUnsupportedContainerFormat:"02-49",PlaybackDashKeySystemMismatch:"02-50",PlaybackMultipleKeyIDs:"02-51",PlaybackDashConflictingKeyIDs:"02-52",PlaybackRestrictedStreams:"02-53",PlaybackHlsMasterAndMediaTags:"02-54",PlaybackRepresentationIdConflict:"02-55",PlaybackHlsUnsupportedKeyFormats:"02-56",PlaybackManifestNoVariants:"02-57",PlaybackHlsUndeclaredVariables:"02-58",PlaybackAes128InvalidKeyLength:"02-59",PlaybackDashConflictingAes128Keys:"02-60",PlaybackDashUnsupportedAes128Encryption:"02-61",PlaybackManifestPatchMismatch:"02-62",PlaybackEmptyMediaPlaylist:"02-63",PlaybackNonContiguousCompositionTrack:"02-64",PlaybackDecoderNotFound:"02-65",PlaybackDecoderTemporarilyUnavailable:"02-66",PlaybackIncompatibleAsset:"02-67",PlaybackNoCompatibleExternalDisplay:"02-69",PlaybackOutOfMemory:"02-70",PlaybackToneMappingFailed:"02-71",PlaybackVideoCompositorFailed:"02-72",NetworkUnknown:"03-00",NetworkNoInternet:"03-01",NetworkRequestTimeout:"03-02",NetworkUnableToResolveHost:"03-03",NetworkResourceNotFound:"03-04",NetworkExpiredUrl:"03-05",NetworkUrlResolutionFailed:"03-06",NetworkDownloadErrorIdManifest:"03-07",NetworkDownloadErrorIdSidx:"03-08",NetworkDownloadErrorIdContent:"03-09",NetworkDownloadErrorIdInitialization:"03-10",NetworkDownloadErrorIdXlink:"03-11",NetworkHttpRequestFailed:"03-12",NetworkMaxRetriesExceeded:"03-13",NetworkSegmentMissing:"03-14",NetworkHttp400BadRequest:"03-400",NetworkHttp401Unauthorized:"03-401",NetworkHttp402PaymentRequired:"03-402",NetworkHttp403Forbidden:"03-403",NetworkHttp404NotFound:"03-404",NetworkHttp405MethodNotAllowed:"03-405",NetworkHttp406NotAcceptable:"03-406",NetworkHttp407ProxyAuthenticationRequired:"03-407",NetworkHttp408RequestTimeout:"03-408",NetworkHttp409Conflict:"03-409",NetworkHttp410Gone:"03-410",NetworkHttp411LengthRequired:"03-411",NetworkHttp412PreconditionFailed:"03-412",NetworkHttp413PayloadTooLarge:"03-413",NetworkHttp414URITooLong:"03-414",NetworkHttp415UnsupportedMediaType:"03-415",NetworkHttp416RangeNotSatisfiable:"03-416",NetworkHttp417ExpectationFailed:"03-417",NetworkHttp418ImATeapot:"03-418",NetworkHttp421MisdirectedRequest:"03-421",NetworkHttp422UnprocessableEntity:"03-422",NetworkHttp423Locked:"03-423",NetworkHttp424FailedDependency:"03-424",NetworkHttp425TooEarly:"03-425",NetworkHttp426UpgradeRequired:"03-426",NetworkHttp428PreconditionRequired:"03-428",NetworkHttp429TooManyRequests:"03-429",NetworkHttp431RequestHeaderFieldsTooLarge:"03-431",NetworkHttp451UnavailableForLegalReasons:"03-451",NetworkHttp500InternalServerError:"03-500",NetworkHttp501NotImplemented:"03-501",NetworkHttp502BadGateway:"03-502",NetworkHttp503ServiceUnavailable:"03-503",NetworkHttp504GatewayTimeout:"03-504",NetworkHttp505HTTPVersionNotSupported:"03-505",NetworkHttp506VariantAlsoNegotiates:"03-506",NetworkHttp507InsufficientStorage:"03-507",NetworkHttp508LoopDetected:"03-508",NetworkHttp510NotExtended:"03-510",NetworkHttp511NetworkAuthenticationRequired:"03-511",ContentProtectionUnknown:"04-00",ContentProtectionConcurrentStreamLimitExceeded:"04-01",ContentProtectionEntitlementRefused:"04-02",ContentProtectionLicenseExpired:"04-03",ContentProtectionBadLicenseRequest:"04-04",ContentProtectionLicenseServerTimeout:"04-05",ContentProtectionInsufficientHDCPSupport:"04-06",ContentProtectionGeoRestricted:"04-07",ContentProtectionParentalControlRestricted:"04-08",ContentProtectionCDNUnauthorized:"04-09",ContentProtectionInvalidAccessToken:"04-10",ContentProtectionKeySystemNoKeys:"04-11",ContentProtectionKeySystemNoAccess:"04-12",ContentProtectionKeySystemNoSession:"04-13",ContentProtectionKeySystemNoConfiguredLicense:"04-14",ContentProtectionKeySystemCertificateRequestFailed:"04-15",ContentProtectionKeySystemCertificateUpdateFailed:"04-16",ContentProtectionKeySystemSessionUpdateFailed:"04-17",ContentProtectionKeySystemStatusOutputRestricted:"04-18",ContentProtectionKeySystemStatusInternalError:"04-19",ContentProtectionKeyLoadError:"04-20",ContentProtectionKeyLoadTimeout:"04-21",ContentProtectionCapabilityMediaKeysError:"04-22",ContentProtectionManifestKeySystemUnknown:"04-23",ContentProtectionKeySystemUnavailable:"04-24",ContentProtectionCDMCreationFailed:"04-25",ContentProtectionCDMAttachFailed:"04-26",ContentProtectionCDMServerCertificateRejected:"04-27",ContentProtectionCDMSessionCreationFailed:"04-28",ContentProtectionCDMLicenseRequestFailed:"04-29",ContentProtectionCDMLicenseResponseRejected:"04-30",ContentProtectionManifestMissingDRMInfo:"04-31",ContentProtectionLicenseServerMissing:"04-32",ContentProtectionOfflineSessionRemoved:"04-33",ContentProtectionInitDataTransformationError:"04-34",ContentProtectionServerCertificateRequestFailed:"04-35",ContentProtectionInsufficientHDCPVersion:"04-36",ContentProtectionHDCPVersionCheckFailed:"04-37",AdsUnknown:"08-00",AdsVastParseError:"08-100",AdsInvalidVastSchema:"08-101",AdsVastVersionNotSupported:"08-102",AdsUnexpectedAdType:"08-200",AdsCreativeLinearityMismatch:"08-201",AdsCreativeDurationMismatch:"08-202",AdsCreativeSizeMismatch:"08-203",AdsWrapperVastError:"08-300",AdsVastResponseRedirectTimeout:"08-301",AdsWrapperLimitReached:"08-302",AdsVastResponseEmpty:"08-303",AdsLinearAdDisplayError:"08-400",AdsMediaFileNotFound:"08-401",AdsMediaFileUnavailable:"08-402",AdsUnsupportedMimeType:"08-403",AdsUnableToDisplayMediaFile:"08-405",AdsMezzanineFileMissing:"08-406",AdsMezzanineFileDownloaded:"08-407",AdsRejectedAd:"08-408",AdsInteractiveCreativeError:"08-409",AdsVerificationNodeExecutionError:"08-410",AdsNonLinearAdDisplayError:"08-500",AdsNonLinearAdSizeMismatch:"08-501",AdsNonLinearAdFetchError:"08-502",AdsNonLinearUnsupportedType:"08-503",AdsCompanionAdDisplayError:"08-600",AdsCompanionAdSizeMismatch:"08-601",AdsRequiredCompanionAdError:"08-602",AdsCompanionAdFetchError:"08-603",AdsUndefinedVastError:"08-900",AdsUnknownVpaidError:"08-901",AdsVastDocumentEmpty:"08-999"},Pe=Object.fromEntries(Object.entries(ke).map(([e,t])=>[t,e]));const Re=e=>{return e.autoplay&&Ie.AUDIO_REQUIRED&(!0===(t=e.autoplay)?Ie.ON:!1===t?Ie.OFF:t);var t};function Ce(e,t,n){const o="boolean"==typeof n;if("boolean"!=typeof n&&(n=!!e.hasState(fe)||e.paused),function(e,t,n){const o=e.poll(t?V:j,{forced:n});return o&&o.defaultPrevented}(e,n,o))return Promise.resolve();if(!n)return e.hasState(pe)?(e.setState(fe,!0),e.setState(pe,!1),Promise.resolve()):Promise.resolve(e.pause());if(0==e.reaper)return Promise.resolve();const r=e.reaper.get("__pending_play");return e.paused||r?r?(r.src!==De(e.original_src)&&Le(e),r):(function(e){return(0==e.networkState||0==e.readyState)&&e.currentSrc==De(e.original_src)}(e)&&Le(e),function(e){const t=e.hasState(se),n=t&&Re(e.opts);n&&(e.muted&&e.toggleMute(!1),0==e.volume&&(e.volume=1));t&&e.setState(se,!1);return e.play().then(()=>{e.hasState(fe)&&e.togglePlay(!1)}).catch(o=>{if(console.warn(t?n?"[flowplayer/play] autoplay audio required\n%s":"[flowplayer/play] attempting muted autoplay\n%s":"",o.message,"\ninstance:",e),t&&!n)return e.muted=!0,e.play()})}(e)):(e.setState(fe,!1),!e.hasState(Y)&&e.setState(pe,!0),Promise.resolve())}function Le(e){e.opts.is_native&&(e.hasState($)||(e.hasState(J)||e.emit(K),e.setState(J,!0),e.load()))}function De(e){const t=document.createElement("a");return t.href=e,t.href}function Ue(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function Me(e){const t=document.createElement("a");t.href=e;const n=t.pathname&&t.pathname.split(".");return n.length>1&&n[n.length-1]}function Fe(e){switch(e){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return e}}const He=e=>{var{src:t}=e,n=Ue(e,["src"]);return[Object.assign({src:t,type:t?Fe("video/"+Me(t)):""},n)]};function We(e){return He({src:e})}function xe(e){var{src:t,type:n}=e,o=Ue(e,["src","type"]);return t&&n?[Object.assign({src:t,type:n},o)]:n&&!t?[Object.assign({type:n},o)]:He(Object.assign({src:t},o))}const Ve="health:record",je="rebuffer",Ke="rebuffer:ended",Be="display",Ge="insights:ttff",qe="insights:time_to_first_frag_loaded",Ye="insights:watched_interval",ze="flowplayer:feature",$e="health:ready";var Je=Object.freeze({__proto__:null,RECORD:Ve,REBUFFER:je,REBUFFER_ENDED:Ke,DISPLAY:Be,TIME_TO_FIRST_FRAME:Ge,TIME_TO_FIRST_FRAGMENT_LOADED:qe,WATCHED_INTERVAL:Ye,FEATURE_USAGE:ze,HEALTH_SERVICE_READY:$e});const Qe={All:1,High:.1,Medium:.01,Low:.001,None:0};function Ze(e,{feature_name:t,behavior:n,sample_rate:o}){t&&(o||(o=Qe.All),e.emit(ze,{feature_name:t,behavior:n,sample_rate:o}))}var Xe;function et(e,t,n,o={safari:!1}){const r=function(e){return"string"==typeof e?We(e):Array.isArray(e)||"object"!=typeof e?e.reduce(function(e,t){return"string"==typeof t&&(t=We(t)),"object"!=typeof t||Array.isArray(t)||(t=xe(t)),e.concat(t)},[]):xe(e)}(n);return function(e){[Z,fe,pe,Y,z,J,$,ce].forEach(t=>e.setState(t,!1)),e.setState(Q,!0)}(e),Array(...Array(r.length)).map((e,t)=>t).some(n=>{const i=r[n];if(Xe.Ok==function(e,t,n){e.emit(T,n),t.playback_token&&"string"==typeof n.src&&n.src.startsWith("https://")&&(n.src=function(e,t){const n=new URL(e);return n.pathname=`/pt:${t}${n.pathname}`,n.toString()}(n.src,t.playback_token),Ze(e,{feature_name:"signed-urls",behavior:"used",sample_rate:.1}));"string"==typeof n.src&&(e.original_src=n.src);const o=function(e,t,n){return e.plugins.filter(e=>{return(t=e)&&"wants"in t;var t}).find(e=>e.wants(n.src||"",n,t))}(e,t,n);return e.setOpts({is_native:!o}),o?(o.onload(t,e.root,e,n),Xe.Ok):Xe.Err}(e,t,i)||Xe.Ok==function(e,t,n,o={safari:!1}){var r;/^audio\//.test(n.type||"")&&e.emit(F);t.start_time&&(n.src=n.src+"#t="+t.start_time);if(""==e.canPlayType(n.type||""))return Xe.Err;if(n.drm&&(!n.drm["com.apple.fps.1_0"]||!o.safari))return Xe.Err;"string"==typeof n.src&&(e.preload=null!==(r=t.preload)&&void 0!==r?r:"auto",e.src=n.src);return Xe.Ok}(e,t,i,o))return!0;n==r.length-1&&"string"==typeof i.src&&(e.src=i.src)}),e}!function(e){e[e.Err=0]="Err",e[e.Ok=1]="Ok"}(Xe||(Xe={}));const tt=[I,b,T,L];var nt;function ot(e,t,n){return isNaN(e.duration)||isNaN(e.currentTime)?{}:(t.offset+=n,0==t.offset?rt(e,t):(t.timer&&clearTimeout(t.timer),t.timer=setTimeout(function(){0!=e.reaper&&(e.currentTime=function(e,t,n=0){return Math.max(Math.min(t,e),n)}(e.currentTime+t.offset,e.duration),t.timer=0,rt(e,t))},1e3),function(e,t){e.setState(he,!0),e.setState(nt.BACKWARD,t.offset<0),e.setState(nt.FORWARD,t.offset>0)}(e,t),e.emit(C,t),t))}function rt(e,t){t.timer&&clearTimeout(t.timer),t.timer=t.offset=0,function(e){e.setState(nt.FORWARD,!1),e.setState(nt.BACKWARD,!1),e.setState(he,!1)}(e)}function it(){if("undefined"==typeof document)return!1;const e=document.documentElement;return e&&"rtl"==e.getAttribute("dir")}function at(e,t,n){const o=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;o.length;){if(null==e)return n;const t=o.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}function st(e,t,n,o){if((o=o||0)>=e.length)return n;return at(e[o],t,st(e,t,n,o+1))}!function(e){e.FORWARD="forward",e.BACKWARD="backward"}(nt||(nt={}));const lt=[1e7]+""+-1e3+-4e3+-8e3+-1e11,ct=()=>"undefined"==typeof crypto?"":lt.replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),dt="flowplayer/uuid";let ut="";!function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}}();const pt=["touchstart","touchmove"];function ft(e,t){const n=new CustomEvent(e,{detail:t,cancelable:!0});return t&&Object.defineProperty(n,"data",{get:()=>t}),n}function ht(e,t,n){const o=ft(t,n);return e.dispatchEvent(o),e}function mt(e,t,n){const o=ft(t,n);return e.dispatchEvent(o),o}function yt(e,t,n,o){Array.isArray(t)?t.forEach(t=>Et(e,t,n,o)):Et(e,t,n,o)}function Et(e,t,n,o){if(r=t,!~pt.indexOf(r))return e.addEventListener(t,n,o),e;var r;const i=Object.assign(o||{},{passive:!0});return e.addEventListener(t,n,i),e}function gt(e,t,n,o){return yt(e,t,n,Object.assign(o||{},{once:!0}))}class PlayerStorage{constructor(e,t){this.implementation=e,t&&t.keys().forEach(e=>{"string"==typeof t.implementation[e]&&this.implementation.setItem(e,t.implementation[e])})}keys(){var e;const t=[];for(var n=0;n<this.implementation.length;n++)(null===(e=this.implementation.key(n))||void 0===e?void 0:e.startsWith("flowplayer/"))&&t.push(this.implementation.key(n));return t}removeItem(e){try{this.implementation.removeItem(`flowplayer/${e}`)}catch(e){}}getItem(e){try{return this.implementation.getItem(`flowplayer/${e}`)}catch(e){return null}}setItem(e,t){try{this.implementation.setItem(`flowplayer/${e}`,t)}catch(e){}}clear(){try{this.keys().forEach(e=>this.implementation.removeItem(e))}catch(e){}}get length(){try{return this.keys().length}catch(e){return 0}}key(e){try{return this.implementation.key(e)}catch(e){return null}}}class InMemoryStorage{constructor(){this.pairs=[]}get length(){return this.pairs.length}clear(){this.pairs=[]}getItem(e){var t;return(null===(t=this.pairs.find(t=>t[0]===e))||void 0===t?void 0:t[1])||null}key(e){return this.pairs[e][0]||null}removeItem(e){this.pairs=this.pairs.filter(t=>t[0]!==e)}setItem(e,t){this.removeItem(e),this.pairs.push([e,t])}}const wt={preload:"auto",rtl:!1,controls:!0},_t=["muted","preload"];function vt(e,o,r){let i;r.live_state={dvr_window:void 0,get dvr(){return i},set dvr(t){i=t;const n=!(!e.live||t);r.hasState(de)!=n&&r.setState(de,n)}},r._storage=new PlayerStorage(["localStorage","sessionStorage"].map(e=>{try{const t=window[e];return t.getItem(""),t}catch(t){return console.debug(`Access to window.${e} denied, trying next option`),null}}).find(e=>!!e)||new InMemoryStorage),r.toJSON=function(){return{duration:r.duration,volume:r.volume,currentTime:r.currentTime,states:r.root.className}},r.setSrc=function(t){return et(r,e,t,n())},r.playerState=r.playerState||{},r.setState=function(e,t){if(r.playerState[e]===!!t)return r;const n=Object.assign({},r.playerState,{[e]:t});return r.playerState=n,ht(r,x,r.playerState),r},r.createComponents=function(...e){return Array.from({length:e.length}).map((t,n)=>Oe(this,e[n]))},r.hasState=function(e){return!!r.playerState[e]},r.transitionState=function(e,t,n){!r.hasState(e)&&r.hasState(t)||(n=0),n&&r.setState(le,!0),r.setState(t,!1),r.setState(e,!0),n&&setTimeout(function(){r.setState(le,!1)},n)},r.emit=(e,t)=>(ht(r,e,t),r),r.on=(e,t)=>(yt(r,e,t),r),r.once=(e,t)=>(gt(r,e,t),r),r.off=(e,t)=>{var n,o;return n=e,o=t,r.removeEventListener(n,o),r},r.poll=(e,t)=>mt(r,e,t),r.togglePlay=function(e){return r.hasState(ie)?Promise.reject():Ce(r,0,e)},r.toggleMute=function(e){e=null==e?!r.muted:!!e,r.muted=e,r.muted||r.volume||(r.volume=1),ht(r,y)},r.toggleDisable=function(e){e=null==e?!r.disabled:!!e,r.setState(X,e),r.disabled=e},r.destroy=function(){r.pause();const e=t.indexOf(r);~e&&t.splice(e,1),setTimeout(function(){r.setSrc([]),r.reaper&&r.reaper.clear(),ht(r,I),r.setState(ge,!0)},0)},r.setAttrs=function(e){return _t.forEach(t=>{if(!(t in e))return;const n=e[t];n?r.setAttribute(t,n.toString()):r.removeAttribute(t)}),r},r.opt=function(t,n){return n=void 0===n?at(wt,t):n,at(e,t,n)},r.i18n=function(e,t){if(!r.reaper)return"";const n=r.reaper.get("translations");return n?st(n,e,t||""):t||""},r.setOpts=function(t){Object.assign(e,t),e.live&&!r.hasState(re)&&(r.setState(de,!0),ht(r,P)),"disabled"in t&&void 0!==t.disabled&&r.toggleDisable(t.disabled),"muted"in t&&void 0!==t.muted&&r.toggleMute(t.muted),"dvr"in e&&(r.live_state.dvr=r.opt("dvr")),r.setState(ne,r.opt("rtl",function(e){if(!e)return it();const t=e.getAttribute("dir");return t?"rtl"==t:it()}(o))),r.setState(re,!!e.live),r.setState(ue,"string"==typeof e.poster&&e.poster.length>0),r.setState(me,!!e.seekable),r.setState(Ee,0==e.controls),o.style.backgroundImage=r.hasState(ue)?"url('"+e.poster+"')":"",ht(r,W,e)},r.renderPlugin=function(e){mt(r,M,e).defaultPrevented||r.root.appendChild(e)};const a={offset:0,timer:0};var s,l;l=a,(s=r).on(tt,function(){rt(s,l)}),r.enqueueSeek=function(e){if(0!=r.opts.seekable&&!(1==r.opts.disabled&&e>0))return ot(r,a,e)},r.deviceId=function(){return function(e){if(ut)return ut;try{const t=e.getItem(dt);if(t)return t;const n=ct();return e.setItem(dt,n),n}catch(e){return ut=ct()}}(r._storage)}}var St="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};const Nt=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function bt(e,t){return!!~Nt.indexOf(e)||e.indexOf(t)===e.length-t.length}bt.check_whitelist=function(e){return!!~Nt.indexOf(e)};const At="production";function Ot(e,t){const n={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let o={c:"{}",exp:0};t=t||{};try{o=be(e),n.valid_jwt=!0}catch(e){}return n.raw=e,n.data=JSON.parse(o.c),n.exp=o.exp,t.require_valid_token&&Ot.validate(n),n}var Tt;function It(e){return{grant:e,is_granted:t=>(e&t)===t}}function kt({root:e,video:t,data:n}){t&&t.destroy(),console.error(new Error(n.details||n.reason)),e.innerHTML="",e.classList.remove("flowplayer"),e.classList.add("flowplayer-fatal"),e.style.removeProperty("background-image");const o=document.createElement("h2");o.textContent="Playback Error";const r=document.createElement("p");r.textContent="Are you the site owner?";const i=document.createElement("a");i.classList.add("troubleshoot"),i.target="_blank",i.href="https://docs.flowplayer.com/troubleshooting/player#"+n.reason,i.textContent="Troubleshoot?";const a=document.createElement("img");a.src="https://flowplayer.com/user/pages/images/logo-white.png",a.alt="Flowplayer Logo",e.append(o,r,i,a)}function Pt(e){return t=>{setTimeout(function(){if(!t.defaultPrevented&&!t.prevented)return e(t)},0)}}Ot.validate=function(e){if("string"==typeof e&&(e=Ot(e)),!e||!e.raw){if(bt.check_whitelist(window.location.hostname)||"dev"===At.toString())return!0;throw new Error("No token provided in configuration")}if(!e.valid_jwt)throw new Error("Invalid token provided");const t=window.location.hostname,n=bt.bind(null,t);if("dev"!==At.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(n))throw new Error("Domain not allowed");if("dev"!==At.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},Ot.id=function(e){if(e)return"string"==typeof e&&(e=Ot(e)),e.data.id},function(e){e[e.ADS=2]="ADS",e[e.ANALYTICS=4]="ANALYTICS",e[e.NO_METERING=8]="NO_METERING",e[e.DEVELOPER_PLAN=16]="DEVELOPER_PLAN",e[e.WOWZA_VIDEO=32]="WOWZA_VIDEO"}(Tt||(Tt={})),It.of=It,It.from_token=function(e){const t=Ot(e,{require_valid_token:!0});return It.of(t.data.acl)},It.permissions=Tt;const Rt="is-casting",Ct="has-casted";function Lt(e){return function(e,t){const n=e.seekable;if("object"!=typeof e.opts||0==n.length)return{head:0,tail:0};const o=Dt(e),r=t||e.live_state.dvr_window;return{head:o,tail:"number"!=typeof r||o-r<0?n.start(0):o-r}}(e).tail}function Dt(e){var t;const n=e.seekable;return n.length?e.hasState("is-chromecast-playing")||!(null===(t=e.hls)||void 0===t?void 0:t.liveSyncPosition)?n.end(n.length-1):e.hls.liveSyncPosition:0}function Ut(e){try{e.dvr_offset=0,e.currentTime=Dt(e)}catch(e){console.warn("failed to seek to now: %j",e)}}function Mt(e,t){const n=t.clientWidth;t.classList.toggle(ee,n<600),t.classList.toggle(te,n<400)}function Ft(e,t,n){let o=!0;t.classList.add("flowplayer"),Mt(0,t),gt(n,m,()=>{void 0!==e.start_quality&&Ze(n,{feature_name:"start-quality",behavior:String(e.start_quality),sample_rate:Qe.High})}),yt(n,m,()=>{if(!n.hasState(J)&&!n.hasState($)&&e.is_native&&"none"!==e.preload)return"metadata"===e.preload?(n.setState(J,!0),n.emit(K)):void Le(n)}),yt(n,u,()=>{e.is_native&&"metadata"===e.preload&&n.paused&&n.emit(v)}),yt(n,[m,l],function(){Mt(0,t)}),yt(n,x,function(){Object.entries(n.playerState).forEach(function([e,n]){t.classList.toggle(e,n)})}),yt(n,h,function(){n.setState(ae,!n.hasState(Rt)&&!n.hasState(Q)&&n.readyState<3)}),yt(n,S,function(t){const o=n.original_src;Pt(()=>{if(o===n.original_src){if(n.setState(oe,!0),gt(n,h,function(){n.setState(oe,!1),o===n.original_src&&n.setState(Q,!e.loop&&!!e.rewind&&n.paused)}),e.loop)return n.togglePlay(!0);e.rewind&&(n.currentTime=0)}})(t)}),yt(n,[b,N],function(e){n.setState(Z,e.type==b)}),yt(n,D,function(e){setTimeout(()=>{e.defaultPrevented||(n.currentTime=e.detail.currentTime)},0)}),yt(n,S,function(){n.setState(Y,!1),o=!0}),yt(n,f,()=>{if(!n.opts.live||!n.opts.is_native)return;const e=n.seekable;0!=e.length&&n.emit("dvr/window",e.end(e.length-1)-e.start(0))}),yt(n,p,function(){n.setState($,!0),n.setState(J,!1)}),yt(n,w,()=>{n.setState(pe,!0)}),yt(n,[_,v,m],function(t){if(!n.hasState(Z)&&(t.type!=v||e.autoplay||n.setState(ae,!1),t.type!=m||"none"!=n.opt("preload")||e.autoplay)){if(t.type==m&&e.autoplay)return gt(n,g,function(){n.setState(ae,!1)});t.type!=_||n.hasState($)||n.setState(J,!0),n.setState(oe,!1),n.setState(ae,t.type==_)}}),yt(n,[g,E],function(t){setTimeout(()=>{const e=new CustomEvent("flowplayer/"+t.type,{detail:n});document.dispatchEvent(e)},0);const r=t.type==g,i=n.currentTime==n.duration,a=r&&o&&e.autoplay||n.hasState(ae);if(r&&(n.started=!0,o=!1),n.setState(ae,!1).setState(pe,!1),!r&&n.setState(fe,!1),i)return;const s=r?Y:z,l=r?z:Y;n.transitionState(s,l,a?0:300),!n.hasState(Q)||n.root.classList.contains("ad-hide-first-frame")||n.root.classList.contains("preroll-ios")||function(e,t){if(!e.hasState(re)||![void 0,0,-1].includes(t)||!e.seekable.length||e.hasState(Ct))return e.setState(Q,!1);e.once(N,()=>e.setState(Q,!1)),0===t?function(e){e.currentTime=Lt(e)}(e):Ut(e)}(n,e.start_time)})}const Ht=[0].concat(Array.from({length:100}).map((e,t)=>(t+1)/100));function Wt(){return t.find(e=>e.hasState(Rt))}const xt=.5625;function Vt(e){if("number"==typeof e&&!isNaN(e))return Number(e);if("string"==typeof e){const t=e.split(":");return Number(t[1])/Number(t[0])}return e}class ExplorerPlan{constructor(){this.cleanUp=this.cleanUp.bind(this),this.render=this.render.bind(this),this.wireUp=this.wireUp.bind(this)}init(e,t,n){this.root=t,this.player=n,this.wireUp()}wireUp(){var e,t;this.cleanUp(),null===(e=this.player)||void 0===e||e.once(g,this.render),null===(t=this.player)||void 0===t||t.once(S,this.wireUp)}cleanUp(){var e,t,n,o;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo),null===(n=this.player)||void 0===n||n.off(g,this.render),null===(o=this.player)||void 0===o||o.off(S,this.wireUp)}render(){var e,t,n;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo);const o=(null===(n=this.root)||void 0===n?void 0:n.querySelector(".fp-ui"))||this.root;if(!o)return;const r=this._logo=document.createElement("a");r.href="https://explorer.flowplayer.com",r.target="_blank",Object.entries(jt).forEach(([e,t])=>{r.style.setProperty(e,t,"important")}),o.appendChild(r)}}ExplorerPlan.pluginName="explorer-plan";const jt={display:"block",opacity:"1",visibility:"visible",width:"33%","padding-top":"9%",position:"absolute","z-index":"9999",bottom:"25%",left:"10%","background-size":"cover","background-image":"url(https://static.flowplayer.com/explorer/explorer.svg)"},Kt="flowplayer/"+g;function Bt(e,t){const n=[];e.addEventListener("contextmenu",o=>{const r=o.timeStamp;for(n.push(r);n.length>3;)n.shift();n.length>=3&&n.every(e=>e-r<3e3)&&(console.debug("flowplayer/debug rendering info"),function(e,t){var n;!function(e){const t=e.querySelector(".debug-info");null==t||t.remove()}(e);const o=document.createElement("div");o.classList.add("debug-info");const r=Gt("flowplayer.version","3.32.1");o.append(r);const i=null===(n=null==t?void 0:t.hls)||void 0===n?void 0:n.constructor;if(i&&i.version){const e=Gt("hls.version",i.version);o.append(e)}e.appendChild(o)}(e,t))})}const Gt=(e,t)=>{const n=document.createElement("div");n.classList.add("row",e);const o=document.createElement("span");o.classList.add("attr"),o.textContent=e;const r=document.createElement("span");return r.textContent=t,r.classList.add("value"),n.append(o,r),n};function qt(e,t){const n=function(){try{return localStorage.getItem("flowplayer/debug")}catch(e){return""}}(),o=(o,...r)=>{try{const i=(null==t?void 0:t.debug)||n;i&&e.match(i)&&console.log(`flowplayer/${e} -- ${o}`,...r)}catch(e){console.warn(e)}};return o.log=o,o}const Yt="without_recovery",zt="off";class FlowplayerError extends Error{static getErrorKey(e){return e in Pe?Pe[e]:Pe["00-00"]}constructor(e,t,n={}){super(e),this.message=e,this.flowplayerErrorCode=t,this.config=n,this.id=ct(),this.isFatal=!!n.isFatal,this.errorKey=FlowplayerError.getErrorKey(this.flowplayerErrorCode)||"unknown"}toJSON(){return{message:this.message,flowplayer_error_code:this.flowplayerErrorCode,id:this.id,root_error_id:this.config.rootErrorId,resource:this.config.resource,is_fatal:this.isFatal,is_retry:!!this.config.isRetry}}}const $t=qt("core/retry");function Jt(e,t){const n={pending:void 0,count:0};e.on(B,o=>{var i,a,s,l,c;const d=null===(i=o.detail)||void 0===i?void 0:i.error;d.config.isRetry=!!n.count,void 0===n.pending&&(null===(s=null===(a=d.config)||void 0===a?void 0:a.retryOpts)||void 0===s?void 0:s.retry)!==zt&&(t.retry||(null===(c=null===(l=d.config)||void 0===l?void 0:l.retryOpts)||void 0===c?void 0:c.retry))&&(++n.count,n.pending=function(e,t,n){var o,i;return setTimeout(()=>{var o;e.hasState(ge)||(t.pending=void 0,(null===(o=n.config.retryOpts)||void 0===o?void 0:o.retry)!==Yt&&e.emit(R),e.emit(r,{error:n}),$t("%s try",t.count))},null!==(i=null===(o=n.config.retryOpts)||void 0===o?void 0:o.retryTimeout)&&void 0!==i?i:3e3*t.count)}(e,n,d))}),e.on(g,()=>{n.count=0}),e.on([T,R],e=>{e.type===T&&(n.count=0),clearTimeout(n.pending),n.pending=void 0}),e.on(r,Pt(()=>{e.load()}))}const Qt=[K,i,T];function Zt(e){try{return!!new URL(e)}catch(e){return!1}}const Xt=navigator;function en(e){var t,n;const o=null===(t=e.hls)||void 0===t?void 0:t.bandwidthEstimate;return o?1e-6*o:(null===(n=Xt.connection)||void 0===n?void 0:n.downlink)||-1}function tn(e,t){return async function(e,t){try{await fetch(e,{body:t,method:"POST",mode:"no-cors"})}catch(e){}}(e,JSON.stringify({events:t}))}const nn=e=>{switch(e){case!0:return Ie.ON;case!1:return Ie.OFF;default:return e}};function on(){try{const e=window.location!==window.parent.location?document.referrer:document.location.href;return"string"==typeof e&&e.slice(0,200)}catch(e){return!1}}const rn=[],an="https://ihi.flowplayer.com/v1/health/events";function sn(e){if(e.suspended)return;const t=rn.slice(0);rn.length=0,0!=t.length&&(e.logger.log(`:dispatch events={${t.length}}`),tn(function(){try{return"undefined"==typeof window?an:window.__FLOWPLAYER_INSIGHTS_URL?window.__FLOWPLAYER_INSIGHTS_URL:an}catch(e){return an}}(),t))}async function ln(e,t,n){const o=await dn();rn.push(Object.assign(t,o)),e.logger.log(":enqueue",t.event,t),rn.length<10&&!n||sn(e)}const cn=()=>{var e,t;try{const n=window;return null===(t=null===(e=null==n?void 0:n.google)||void 0===e?void 0:e.ima)||void 0===t?void 0:t.VERSION}catch(e){return}},dn=async()=>({client_time:Date.now()}),un=(e,t)=>Object.assign(e,{detail:t}),pn=(e,{event:t,media_session_id:n,session_id:o,play_range_id:r})=>({event:t,media_session_id:n,session_id:o,play_range_id:r,device_id:e.deviceId(),version:"3.32.1",commit:"e5c528ba9ef6fb9b0d6f4293c1c742aa203bf0a5",ima_sdk_version:cn(),preload:e.opt("preload"),autoplay:nn(e.opt("autoplay")),live:e.opt("live"),dvr:!!e.live_state.dvr,source:e.original_src,downlink_mbs:en(e),page_url:on(),player_id:e.opt("metadata.player_id"),media_id:e.opt("metadata.media_id")||e.opt("metadata.stream_target_id"),site_id:e.opt("metadata.site_id"),category_id:e.opt("metadata.category_id"),sitegroup_id:e.opt("metadata.sitegroup_id"),token:e.token,plugins:e.plugins.map(e=>e.constructor.name).sort((e,t)=>e.localeCompare(t)),current_time:e.currentTime,external_media_id:e.opt("external_media_id")}),fn=e=>({bitrate:null==e?void 0:e.bitrate,resolution:null==e?void 0:e.attrs.RESOLUTION,frame_rate:null==e?void 0:e.attrs["FRAME-RATE"]});const hn=(e,t)=>{let n=null;return(...o)=>{null!==n&&(clearTimeout(n),n=null),n=setTimeout(()=>t(...o),e)}};var mn;!function(e){e[e.Starting=0]="Starting",e[e.ConfigFinalized=1]="ConfigFinalized",e[e.TimerStartedWithAutoplay=2]="TimerStartedWithAutoplay",e[e.TimerStartedWithUserGesture=3]="TimerStartedWithUserGesture",e[e.MetricReported=4]="MetricReported"}(mn||(mn={}));const yn=[a,s];class TimeToFirstFrame{constructor(e=mn.Starting,t=!1){this.state=e,this.loadedAd=t}reset(){this.state=mn.Starting,this.loadedAd=!1,this.start=void 0,this.end=void 0,this.adDetails=void 0}adInfo(){const{ad_tag_id:e,vast_ad_id:t}=this.adDetails||{};return{ad_tag_id:e,vast_ad_id:t}}toJSON(){return Object.assign({ad_was_requested:this.loadedAd,ms_to_first_frame:Math.round(this.end&&this.start?this.end-this.start:-1)},this.adInfo())}startTimer(e){this.state==mn.ConfigFinalized&&(this.state=e,this.start=performance.now())}hasStarted(){return[mn.TimerStartedWithAutoplay,mn.TimerStartedWithUserGesture].includes(this.state)}stopTimer(e){this.hasStarted()&&(this.end||(this.end=performance.now()),this.state=mn.MetricReported,e())}}function En(e){return Math.round(1e3*e)/1e3}class EWMA{constructor(e){this.tickInterval=e,this.ewma=0,this.startTime=Date.now()}decay(){const e=Date.now()-this.startTime;return Math.pow(2,-e/(4*this.tickInterval))}update(e){const t=this.decay();return this.ewma=t*this.ewma+(1-t)*e,this.ewma}toJSON(){return this.ewma}}const gn={skipUnreliableSegments:!0};class WatchedState{constructor(e){this.player=e,this.marchingInterval=void 0,this.lastWatchedPoint=void 0,this.watchedSum=0,this.lastReportedSum=0,this.ewmaTickWatched=new EWMA(WatchedState.AccuracyMilliseconds)}reset(){this.onNotWatching(),this.watchedSum=0,this.lastReportedSum=0,this.lastWatchedPoint=void 0}onNotWatching(){this.marchingInterval&&(this.updateWatched(),this.marchingInterval=clearInterval(this.marchingInterval))}onWatching(){this.marchingInterval||(this.lastWatchedPoint=this.createWatchedPoint(),this.marchingInterval=setInterval(()=>{this.updateWatched()},WatchedState.AccuracyMilliseconds))}createWatchedPoint(){return{currentTime:this.player.currentTime,paused:this.player.paused}}updateWatched(){const e=this.createWatchedPoint();this.lastWatchedPoint&&this.calculateTimeWatched(this.lastWatchedPoint,e),this.lastWatchedPoint=e}calculateTimeWatched(e,t){var n,o;const r=t.currentTime-e.currentTime,i=this.ewmaTickWatched.update(r);if(!(r<0)&&!(!1!==(null===(o=null===(n=this.player.opts)||void 0===n?void 0:n.health)||void 0===o?void 0:o.skipUnreliableSegments)&&1e3*r>1.3*WatchedState.AccuracyMilliseconds)&&(this.watchedSum+=r,this.watchedSum!=this.lastReportedSum&&(this.watchedSum>this.lastReportedSum+WatchedState.ReportingIntervalSeconds||this.player.ended))){const e=En(i),t={total_watched_seconds:En(this.watchedSum),tick_watched_seconds:e,batch_watched_seconds:En(this.watchedSum-this.lastReportedSum)};this.lastReportedSum=this.watchedSum,this.player.emit(Ye,t)}}}WatchedState.ReportingIntervalSeconds=5,WatchedState.AccuracyMilliseconds=160;const wn=ct();class Health{constructor(e,t){let n;this.session_id=wn,this.suspended=!1,this.logger=qt("health",t.opts),this.media_session_id=ct(),this.play_range_id=ct(),this.analyticsLoop=setInterval(()=>sn(this),2e3),t.on(I,()=>clearInterval(this.analyticsLoop)),t.on(g,()=>{n!==this.media_session_id&&(n=this.media_session_id,this.first_playing_event_timestamp=Date.now()),this.play_range_id=ct()});let o=Date.now()-1e3;t.on(h,e=>{if(n!==this.media_session_id)return;const r=Date.now();if(r<o)return;o=Date.now()+5e3;const i=pn(t,this.eventInfo(e.type)),a=un(i,{duration:(s=t.duration,Number.isFinite(s)?s:s===1/0?-1:void 0)});var s;this.first_playing_event_timestamp&&(Object.assign(a,{ms_since_first_playing:r-this.first_playing_event_timestamp}),this.first_playing_event_timestamp=void 0),ln(this,a)});const r=this;if(t.health={get media_session_id(){return r.media_session_id},set media_session_id(e){r.media_session_id=e},get session_id(){return r.session_id},set session_id(e){r.session_id=e},toggle(e){e?r.resume():r.suspend()}},!Health._UNLOAD_SUBSCRIBED){Health._UNLOAD_SUBSCRIBED=!0;const t=t=>e.instances.forEach(e=>e.emit(t.type));document.addEventListener("visibilitychange",e=>{"hidden"==document.visibilityState&&t(e)}),window.addEventListener("pagehide",t)}}eventInfo(e){return{event:e,media_session_id:this.media_session_id,session_id:this.session_id,play_range_id:this.play_range_id}}suspend(){this.suspended=!0,clearInterval(this.analyticsLoop)}resume(){this.suspended=!1,this.analyticsLoop=setInterval(()=>sn(this),2e3)}init(e,t,n){if(on().toString().startsWith("data:"))return this.suspend();!function(e){let t=null;const n=()=>{t=null};e.on(_,function(t){e.seeking||e.networkState===e.NETWORK_LOADING&&(e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||e.emit(je))}),e.on(je,e=>{t=e}),e.on(v,o=>{if(t){const r=o.timeStamp-t.timeStamp;if(n(),r<31)return;if(r>3e5)return;e.emit(Ke,{rebuffer_duration:r/1e3})}}),Qt.forEach(t=>e.on(t,n))}(n),function(e){let t;[v,K].forEach(n=>{e.on(n,n=>{const o=Date.now();switch(n.type){case K:return t=o;case v:if(t)return e.emit(qe,{ms_since_loading_started:o-t}),t=null}})})}(n),function(e){if(void 0===window.performance)return;const t=new TimeToFirstFrame;e.on(T,()=>{if(!e.opt("metadata.media_id"))return t.reset();t.reset(),t.state=mn.ConfigFinalized}),e.on(K,()=>{(e.root.classList.contains("ad-hide-first-frame")||e.opt("autoplay"))&&t.startTimer(mn.TimerStartedWithAutoplay)}),yn.forEach(n=>{e.on(n,()=>{e.opt("autoplay")||t.startTimer(mn.TimerStartedWithUserGesture)})}),e.on("ad-requested",()=>{t.loadedAd=!0}),e.on(h,()=>{if(!(e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA)){if(e.root.classList.contains("ad-hide-first-frame"))return!t.end&&(t.end=performance.now());switch(t.state){case mn.TimerStartedWithAutoplay:case mn.TimerStartedWithUserGesture:return t.stopTimer(()=>e.emit(Ge,t.toJSON()))}}}),e.on("ad-started",n=>{switch(t.end=void 0,t.adDetails=n.detail,t.state){case mn.TimerStartedWithAutoplay:case mn.TimerStartedWithUserGesture:return t.stopTimer(()=>e.emit(Ge,t.toJSON()))}})}(n),function(e){const t=new WatchedState(e);e.on(K,()=>t.reset()),e.on(g,()=>t.onWatching()),e.on(Ke,()=>!e.paused&&t.onWatching()),e.on(je,()=>t.onNotWatching()),e.on(E,()=>t.onNotWatching()),e.on(b,()=>{e.currentTime>1&&t.updateWatched(),t.onNotWatching()}),e.on(N,()=>{e.paused||t.onWatching()}),e.on(S,()=>t.updateWatched()),e.on("visibilitychange",()=>t.updateWatched())}(n),n.on(Be,e=>{ln(this,pn(n,this.eventInfo(e.type)),!0)}),n.on(Ve,({detail:e})=>{const t=pn(n,this.eventInfo(e.event));Object.assign(t,e.detail||{}),ln(this,t)}),n.on(ze,e=>{if(t=e.detail.sample_rate,!Object.values(Qe).includes(t))return console.debug(`sample_rate=${e.detail.sample_rate} is invalid`);var t,o;if(!(0!==(o=e.detail).sample_rate&&Math.random()<=o.sample_rate))return;const r=pn(n,this.eventInfo(e.type));ln(this,un(r,e.detail))}),n.on(T,()=>{n.opt("metadata.media_id")&&n.emit($e)}),[m,u,p,f,_,je].forEach(e=>{n.on(e,e=>{ln(this,pn(n,this.eventInfo(e.type)))})}),[Ke,Ge,qe,Ye].forEach(e=>{n.on(e,e=>{const t=pn(n,this.eventInfo(e.type));ln(this,Object.assign(t,e.detail))})}),[g,E,b,N,S,c,d,v,K].forEach(e=>{n.on(e,e=>{ln(this,pn(n,this.eventInfo(e.type)))})}),n.on(y,hn(800,e=>{const t=pn(n,this.eventInfo(e.type));ln(this,un(t,{volume:parseFloat(n.volume.toFixed(2)),muted:n.muted}))})),n.on(l,hn(800,e=>{const o=pn(n,this.eventInfo(e.type));ln(this,un(o,{height:t.clientHeight,width:t.clientWidth}))})),n.on("hls/failover",e=>{const t=pn(n,this.eventInfo(e.type)),o=e.detail,{reason:r,from:i}=o;ln(this,un(t,{reason:r,from:i}))}),n.on(k,({type:e,detail:t})=>{if("hls"===t.plugin)return function(e,t,n,o){const r=pn(t,e.eventInfo(n)),i=Object.assign({before:fn(o.before),after:fn(o.after),automatic:o.automatic,downscale:o.downscale},o.before?{}:{start_quality:t.opts.start_quality});ln(e,Object.assign(Object.assign({},r),{state:i}))}(this,n,e,t)}),n.on(B,e=>{const t=pn(n,this.eventInfo(e.type)),o=e.detail.error;if(!o)return ln(this,t,!0);return ln(this,un(t,o.toJSON()),!0)}),n.on(T,e=>{var t;const o=null===(t=e.detail)||void 0===t?void 0:t.src;if("string"!=typeof o)return;if(!Zt(n.original_src))return;if(!Zt(o))return;if(o==n.original_src)return;this.media_session_id=ct();ln(this,pn(n,this.eventInfo(e.type))),sn(this),n.setOpts({health:Object.assign(Object.assign({},n.opts.health),gn)})}),n.on("visibilitychange",e=>{ln(this,pn(n,this.eventInfo(e.type))),sn(this)})}}function _n(e,t){return function(e){return e.extensions.reduce((e,t)=>e.find(e=>e.pluginName===t.pluginName)?(console.warn("flowplayer: duplicate plugin %s detected, plugin names should be unique",t.name),e):(e.push(t),e),[])}(e).map(n=>new n(e,t))}function vn(e,t={}){var n,o,r,i,a,s;switch(e.code){case MediaError.MEDIA_ERR_ABORTED:return new FlowplayerError(null!==(n=e.message)&&void 0!==n?n:"The playback was aborted, typically by the user.",ke.PlaybackInternalAborted,Object.assign({isFatal:!1,retryOpts:{retry:zt}},t));case MediaError.MEDIA_ERR_NETWORK:return new FlowplayerError(null!==(o=e.message)&&void 0!==o?o:"A network error prevented media from being downloaded.",ke.NetworkHttpRequestFailed,Object.assign({isFatal:!0},t));case MediaError.MEDIA_ERR_DECODE:return new FlowplayerError(null!==(r=e.message)&&void 0!==r?r:"An error occurred while decoding the media.",ke.PlaybackVideoDecodeError,Object.assign({isFatal:!0},t));case MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:return new FlowplayerError(null!==(i=e.message)&&void 0!==i?i:"The media could not be loaded because the format is not supported.",ke.MediaUnsupportedVideoFormat,Object.assign({isFatal:!0},t));case 5:return new FlowplayerError(null!==(a=e.message)&&void 0!==a?a:"Encrypted content could not be played due to missing keys or unsupported protection scheme.",ke.ContentProtectionKeySystemNoKeys,Object.assign({isFatal:!0},t));default:return new FlowplayerError(null!==(s=e.message)&&void 0!==s?s:"An unknown playback error occurred.",ke.PlaybackUnknown,Object.assign({isFatal:!0},t))}}Health.pluginName="health",Health.events=Je,Health._UNLOAD_SUBSCRIBED=!1;const Sn=function(){const e="undefined"!=typeof window?window:void 0!==St?St:{},t=e.flowplayer?e.flowplayer:{extensions:[]};return Array.isArray(t.extensions)||(t.extensions=[]),t}();function Nn(n,r){if("function"==typeof n)return e.push(...[...arguments].filter(e=>"function"==typeof e)),Nn;"string"==typeof r&&(r={src:r}),r||(r={}),r.token||"string"!=typeof window.__FLOWPLAYER_TOKEN||(r.token=window.__FLOWPLAYER_TOKEN);const a="string"==typeof n?document.querySelector(n):n;if(!a)return console.error(new Error("Flowplayer: '"+n.toString()+"' not found"));const s=a.querySelector("video.fp-engine");if(s)return s;const c=function(e){try{return Ot.validate(e),{success:!0,message:""}}catch(e){return{success:!1,message:e.message}}}(r.token);if(!c.success)return kt({root:a,data:{reason:"token",details:c.message}});const d=new Map,f=function(e,t){const n=t.querySelector("video"),o=n||(e._video_element_callback?e._video_element_callback(e):document.createElement("video"));return o.classList.add("fp-engine"),o.playsInline=!0,n||t.append(o),o}(r,a);var h;f.reaper=d,f._customElements=Ae,Object.defineProperty(f,"token",{value:"string"==typeof r.token?Ot.id(r.token):"",writable:!1}),f.addEventListener(I,()=>{d.clear(),f.reaper=0,delete f.root}),f.root=a,r.token&&It.from_token(r.token).is_granted(It.permissions.DEVELOPER_PLAN)&&e.push(ExplorerPlan),!~t.indexOf(f)&&t.push(f),vt(r,a,f),f.setAttrs(r),f.plugins=_n(Nn,f),Ft(r,a,f),function(e,t,n){if(!window.IntersectionObserver)return;const o={should_resume:!!e.autoplay,locked:!1};yt(n,w,function(){o.locked||(o.should_resume=!0)});const r=()=>{if(!e.autoplay)return;if(n.hasState(ye)&&o.should_resume)return n.togglePlay(!0);const t=n.currentSrc;e.autopause||n.hasState(ye)||!o.should_resume||gt(n,A,()=>{e.autoplay&&o.should_resume&&t===n.currentSrc&&n.togglePlay(!0)})},i=()=>{if(!e.autoplay)return;if(!e.is_native)return;if("auto"===e.preload)return;if(n.hasState(ye))return Le(n);const t=n.currentSrc;gt(n,A,()=>{t!==n.currentSrc||n.readyState>1||!n.paused||Le(n)})};yt(n,T,function(){o.should_resume=!!e.autoplay,n.off(m,i),n.once(m,i),n.off(v,r),n.once(v,r)}),yt(n,E,function(){o.locked||(o.should_resume=!1)});const a=new IntersectionObserver(e=>{e.forEach(e=>{setTimeout(()=>{const t=e.intersectionRatio,o=n.hasState(ye);if(n.setState(ye,t>=.2),n.emit(U,{ratio:t}),o===n.hasState(ye))return;const r=n.hasState(ye)?A:O;n.emit(r)},0)})},{threshold:Ht});a.observe(t),n.on(I,()=>a.disconnect()),yt(n,A,function(){!o.should_resume||!e.autopause||Wt()||n.opts.autoplay&&!n.readyState||n.togglePlay(!0)}),yt(n,O,function(){if(!e.autopause||Wt())return;const t=!n.paused;o.locked=!0,n.pause(),setTimeout(function(){o.should_resume=t,o.locked=!1},0)})}(r,a,f),function(e,t){if(!window.ResizeObserver)return;const n=new ResizeObserver(e=>{const n=e[e.length-1];t.emit(l,n)});n.observe(e),t.on(I,()=>n.disconnect())}(a,f),function(e,t,n){const o=!!e.ratio,r=document.createElement("div");r.classList.add("fp-ratio"),t.append(r);let i=Vt(e.ratio||xt);r.style.paddingTop=100*i+"%";const a=[p,u];n.on(a,function(){if(o)return;const e=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth;e&&n.setOpts({ratio:e})}),n.on(W,function(){const t=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth,o=Vt((null==e?void 0:e.ratio)||t||xt);i!==o&&(i=o,r.style.paddingTop=100*o+"%")})}(r,a,f),function(e){const t=t=>{t.detail!==e&&!1===e.opt("multiplay")&&e.togglePlay(!1)};e.on(I,()=>document.removeEventListener(Kt,t)),document.addEventListener(Kt,t)}(f),Bt(a,f),Jt(f,r),(h=f).on(i,Pt(e=>{const t=e instanceof MediaError?e:h.error;t&&h.emit(B,{error:vn(t,{resource:h.original_src})})})),f.plugins.forEach(e=>{try{e.init(r,a,f)}catch(t){console.log("Error(plugin/%s)",e.constructor.name,t)}}),f.setOpts(r),f.opts=r,r.src&&f.setSrc(r.src);const y=f.readyState;return y>0&&f.currentSrc&&f.emit(u),y>2&&f.currentSrc&&f.emit(v),f.emit(o),f.on(H,function(e){kt({root:a,video:f,data:e.data||{}})}),setTimeout(ht,0,document,"flowplayer:player:created",f),f}return Object.assign(Nn,Sn),function(o){Array.isArray(o.extensions)&&o.extensions.forEach(t=>e.push(t)),o.customElements=Ae,o.defaultElements=q,o.version="3.32.1",o.commit="e5c528ba9ef6fb9b0d6f4293c1c742aa203bf0a5",o.instances=t,o.extensions=e,o.support=n,o.events=G,o.states=we,o.errors=ke,o.jwt=be,o.autoplay=Ie,o.quality=Te}(Nn),"object"==typeof document&&setTimeout(ht,0,document,"flowplayer:umd",Nn),Nn.extensions.unshift.apply(Nn.extensions,[Health]),Nn});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=t()}(this,function(){"use strict";const e=[],t=[];function n(){const e="undefined"!=typeof document&&"undefined"!=typeof window,t=e?navigator.userAgent:"",n=/iP(hone|od)/i.test(t)&&!/iPad/.test(t)&&!/IEMobile/i.test(t),o=/Android/.test(t)&&!/Firefox/.test(t),r=/^((?!chrome|android).)*safari/i.test(t),i=/chrome|crios/i.test(t)&&!/opr|opera|chromium|edg|ucbrowser|googlebot/i.test(t),a=/firefox|fxios/i.test(t)&&!/seamonkey/i.test(t),s=/edg/i.test(t),l=/opr|opera/i.test(t),c=/SamsungBrowser/.test(t),d=c&&/SMART-TV/.test(t);return{controls:!n,video:function(t){return e&&document.createElement("video").canPlayType(t)},lang:e&&window.navigator.language,android:o,iphone:n,safari:r,edge:s,opera:l,chrome:i,firefox:a,ios:e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,samsung:c,samsung_tv:c&&d,touch:"ontouchstart"in window,tizen:"tizen"in window,webOS:"webos"in window}}const o="mount",r="retry",i="error",a="click",s="touchend",l="resize",c="fullscreenenter",d="fullscreenexit",u="loadedmetadata",p="loadeddata",f="progress",h="timeupdate",m="loadstart",y="volumechange",E="pause",g="playing",w="play",_="waiting",v="canplay",S="ended",N="seeked",b="seeking",A="viewenter",O="viewleave",T="src",I="reap",k="qualitychange",P="live",R="recover",C="seek:queued",L="seek:cancel",D="remotesession:ended",U="intersectionchange",M="renderplugin",F="audioonlysource",H="error:fatal",W="config",x="state",V="beforeplay",j="beforepause",K="content:loadstart",B="flowplayer:error";var G=Object.freeze({__proto__:null,MOUNT:o,RETRY:r,ERROR:i,CONTEXT_MENU:"contextmenu",CLICK:a,DBL_CLICK:"dblclick",KEYUP:"keyup",KEYDOWN:"keydown",LOAD:"load",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_MOVE:"mousemove",TOUCH_START:"touchstart",TOUCH_MOVE:"touchmove",TOUCH_END:s,TOUCH_CANCEL:"touchcancel",RESIZE:l,SCROLL:"scroll",FULLSCREEN_ENTER:c,FULLSCREEN_EXIT:d,FULLSCREEN_CHANGE:"fullscreenchange",METADATA:u,DATA:p,PROGRESS:f,TIME_UPDATE:h,LOAD_START:m,VOLUME_CHANGE:y,PAUSE:E,PLAYING:g,PLAY:w,WAITING:_,CAN_PLAY:v,ENDED:S,SEEKED:N,SEEKING:b,DURATION_CHANGE:"durationchange",VIEW_ENTER:A,VIEW_LEAVE:O,SOURCE:T,REAP:I,QUALITIES:"qualities",QUALITY_CHANGE:k,VIDEO_TRACKS:"videoTracks",SET_QUALITY:"quality:set",VIDEO_TRACK_SELECT:"tracks:video:select",RECOMMENDATIONS_READY:"recommendationsready",LANDSCAPE:"landscape",PORTRAIT:"portrait",DVR:"dvr",LIVE:P,RECOVER:R,SEEK_QUEUED:C,SEEK_CANCEL:L,PLUGIN_REGISTERED:"plugin:registered",REMOTE_SESSION_STARTED:"remotesession:started",REMOTE_SESSION_ENDED:D,INTERSECTIONCHANGE:U,WEBKIT_NEEDKEY:"webkitneedkey",RENDER_PLUGIN:M,AUDIO_ONLY_SOURCE:F,NON_RECOVERABLE_ERROR:H,CONFIG:W,STATE:x,BEFORE_PLAY:V,BEFORE_PAUSE:j,CONTENT_REAL_LOAD_START:K,CUEPOINTS:"cuepoints",CUEPOINT_START:"cuepointstart",CUEPOINT_END:"cuepointend",STANDARD_ERROR:B});var q=Object.freeze({__proto__:null,SUBTITLES_MENU:"flowplayer-subtitles-menu",SHARE_MENU:"flowplayer-share-menu",SPEED_MENU:"flowplayer-speed-menu",QUALITY_MENU:"flowplayer-quality-menu",AUDIO_MENU:"flowplayer-audio-menu",VIDEO_MENU:"flowplayer-video-menu",UI:"flowplayer-ui",LOGO:"flowplayer-logo",CONTROL:"flowplayer-control",CONTROL_BUTTONS:"flowplayer-control-buttons",LIVE_STATUS:"flowplayer-live-status",ELAPSED:"flowplayer-elapsed-time",TIMELINE:"flowplayer-timeline-bar",CHAPTERS_TIMELINE:"flowplayer-chapters-timeline-bar",CONTROL_DURATION:"flowplayer-control-duration",VOLUME_CONTROL:"flowplayer-volume-control",VOLUME_BAR:"flowplayer-volume-bar",HEADER:"flowplayer-header",HEADER_LEFT_ZONE:"flowplayer-header-left-zone",HEADER_RIGHT_ZONE:"flowplayer-header-right-zone",HEADER_DURATION:"flowplayer-header-duration",MIDDLE:"flowplayer-middle",MIDDLE_ZONE:"flowplayer-middle-zone",WAIT:"flowplayer-wait",MIDDLE_BUTTONS:"flowplayer-middle-buttons",MIDDLE_LEFT_ZONE:"flowplayer-middle-left-zone",MIDDLE_RIGHT_ZONE:"flowplayer-middle-right-zone",ENDSCREEN_INTERSTITIAL:"flowplayer-endscreen-interstitial",ENDSCREEN_UP_NEXT:"flowplayer-endscreen-up-next",ENDSCREEN_GRID:"flowplayer-endscreen-grid",PLAYLIST_INTERSTITIAL:"flowplayer-playlist-interstitial",AIRPLAY_ICON:"flowplayer-airplay-icon",CHROMECAST_ICON:"flowplayer-chromecast-icon",SMALL_PLAY_ICON:"flowplayer-small-play-icon",SMALL_PAUSE_ICON:"flowplayer-small-pause-icon",PLAY_ICON:"flowplayer-play-icon",PAUSE_ICON:"flowplayer-pause-icon",FULLSCREEN_ENTER_ICON:"flowplayer-fullscreen-enter-icon",FULLSCREEN_EXIT_ICON:"flowplayer-fullscreen-exit-icon",SKIP_NEXT_ICON:"flowplayer-skip-next-icon",SKIP_PREVIOUS_ICON:"flowplayer-skip-previous-icon",FAST_FORWARD_ICON:"flowplayer-fast-forward-icon",REWIND_ICON:"flowplayer-rewind-icon",SHARE_ICON:"flowplayer-share-icon",SUBTITLES_MENU_ICON:"flowplayer-subs-menu-icon",MENU_BACK_ICON:"flowplayer-menu-back",VOLUME_ICON:"flowplayer-volume-icon",MUTE_ICON:"flowplayer-mute-icon",UNMUTE_ICON:"flowplayer-unmute-icon",CLOSE_ICON:"flowplayer-close-icon",FACEBOOK_ICON:"flowplayer-facebook-icon",TWITTER_ICON:"flowplayer-twitter-icon",LINK_ICON:"flowplayer-link-icon",EMBED_ICON:"flowplayer-embed-icon",LIVE_COUNTDOWN:"flowplayer-live-countdown",PLAYLIST_CONTROLS:"flowplayer-playlist-controls",THUMBNAILS_CAROUSEL:"flowplayer-thumbnails-carousel",ERROR_COMPONENT:"flowplayer-error",TV_MENU:"flowplayer-tv-menu",CUE_COMPONENT:"flowplayer-cue",SSAI_UI:"flowplayer-ssai-ui",SSAI_CONTROLS:"flowplayer-ssai-controls",SSAI_TIMELINE:"flowplayer-ssai-timeline",SSAI_INDICATOR:"flowplayer-ssai-indicator"});const Y="is-playing",z="is-paused",$="is-loaded",J="is-loading",Q="is-starting",Z="is-seeking",X="is-disabled",ee="is-small",te="is-tiny",ne="is-rtl",oe="is-ended",re="is-live",ie="is-error",ae="is-waiting",se="is-autoplay",le="is-toggling",ce="is-live-seeked",de="no-timeline",ue="has-poster",pe="will-play",fe="will-pause",he="will-seek",me="is-seekable",ye="is-in-viewport",Ee="no-controls",ge="is-destroyed";var we=Object.freeze({__proto__:null,PLAYING:Y,FULLSCREEN:"is-fullscreen",PAUSED:z,MUTED:"is-muted",LOADED:$,LOADING:J,STARTING:Q,SEEKING:Z,GRABBING:"is-grabbing",DISABLED:X,SMALL:ee,TINY:te,RTL:ne,TV:"is-tv",ENDED:oe,LIVE:re,ERRORED:ie,WAITING:ae,AUTOPLAY:se,SEAMLESS:"is-seamless",TOGGLING:le,LIVE_SEEKED:ce,NO_DVR:de,HAS_POSTER:ue,WILL_PLAY:pe,WILL_PAUSE:fe,MENU_OPENED:"has-menu-opened",TOUCHED:"is-touched",HOVERED:"is-hovered",TOUCH_DEVICE:"is-touch-device",WILL_SEEK:he,SEEKABLE:me,IN_VIEWPORT:ye,NO_CONTROLS:Ee,DESTROYED:ge,IS_SOURCE_PROCESSING:"is-source-processing"});function _e(e){this.message=e}_e.prototype=new Error,_e.prototype.name="InvalidCharacterError";var ve="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new _e("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,o,r=0,i=0,a="";o=t.charAt(i++);~o&&(n=r%4?64*n+o:o,r++%4)?a+=String.fromCharCode(255&n>>(-2*r&6)):0)o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return a};var Se=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(ve(e).replace(/(.)/g,function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}(t)}catch(e){return ve(t)}};function Ne(e){this.message=e}Ne.prototype=new Error,Ne.prototype.name="InvalidTokenError";var be=function(e,t){if("string"!=typeof e)throw new Ne("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(Se(e.split(".")[n]))}catch(e){throw new Ne("Invalid token specified: "+e.message)}};be.InvalidTokenError=Ne;const Ae=new Map,Oe=(e,t)=>new(((e,t)=>{const n=e.get(t);if(!n)throw new Error(`no flowplayer component with the name ${t} exists`);const o=window.customElements.get(t);if(!o)throw new Error(`no default flowplayer component with the name ${t} exists`);const r=window.customElements.get(n);return"function"!=typeof r?o:r})(e._customElements,t))(e);var Te,Ie;!function(e){e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=4]="HIGH"}(Te||(Te={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON",e[e.AUDIO_REQUIRED=2]="AUDIO_REQUIRED"}(Ie||(Ie={}));const ke={Unknown:"00-00",MediaUnknown:"01-00",MediaUnavailable:"01-01",MediaUnsupportedVideoFormat:"01-02",MediaUnsupportedAudioFormat:"01-03",MediaBitrateExceeded:"01-04",MediaBufferOverread:"01-05",MediaIntegerOverflow:"01-06",MediaQuotaExceeded:"01-07",MediaInvalidCompositionDuration:"01-08",MediaInvalidCompositionSourceDuration:"01-09",MediaInvalidCompositionSourceStartTime:"01-10",MediaMalformedDepth:"01-11",PlaybackUnknown:"02-00",PlaybackVideoBufferUnderRun:"02-01",PlaybackAudioBufferUnderRun:"02-02",PlaybackVideoBufferingTimeout:"02-03",PlaybackAudioBufferingTimeout:"02-04",PlaybackManifestParseError:"02-05",PlaybackVideoDecodeError:"02-06",PlaybackAudioDecodeError:"02-07",PlaybackDroppedFramesExceeded:"02-08",PlaybackPlayheadExceedsDuration:"02-09",PlaybackUnsupportedDevice:"02-10",PlaybackManifestLoadError:"02-11",PlaybackManifestLoadTimeout:"02-12",PlaybackManifestParsingError:"02-13",PlaybackManifestIncompatibleCodecs:"02-14",PlaybackLevelEmptyError:"02-15",PlaybackLevelLoadError:"02-16",PlaybackLevelLoadTimeout:"02-17",PlaybackLevelSwitchError:"02-18",PlaybackAudioTrackLoadError:"02-19",PlaybackAudioTrackLoadTimeout:"02-20",PlaybackFragLoadError:"02-21",PlaybackFragLoadTimeout:"02-22",PlaybackFragDecryptError:"02-23",PlaybackFragParsingError:"02-24",PlaybackFragGap:"02-25",PlaybackRemuxAllocError:"02-26",PlaybackBufferAddCodecError:"02-27",PlaybackBufferIncompatibleCodecs:"02-28",PlaybackBufferAppendError:"02-29",PlaybackBufferStalledError:"02-30",PlaybackBufferFullError:"02-31",PlaybackBufferSeekOverHole:"02-32",PlaybackBufferNudgeOnStall:"02-33",PlaybackInternalException:"02-34",PlaybackInternalAborted:"02-35",PlaybackManifestLoaderFailure:"02-36",PlaybackSegmentBaseLoaderError:"02-37",PlaybackTimeSyncFailed:"02-38",PlaybackFragmentLoaderFailure:"02-39",PlaybackAppendError:"02-40",PlaybackRemoveError:"02-41",PlaybackDataUpdateFailed:"02-42",PlaybackManifestNoStreams:"02-43",PlaybackUnknownManifestType:"02-44",PlaybackDashInsufficientSegmentInfo:"02-45",PlaybackDashNoRepresentations:"02-46",PlaybackDashNoAdaptationSets:"02-47",PlaybackDashNoInitSegment:"02-48",PlaybackDashUnsupportedContainerFormat:"02-49",PlaybackDashKeySystemMismatch:"02-50",PlaybackMultipleKeyIDs:"02-51",PlaybackDashConflictingKeyIDs:"02-52",PlaybackRestrictedStreams:"02-53",PlaybackHlsMasterAndMediaTags:"02-54",PlaybackRepresentationIdConflict:"02-55",PlaybackHlsUnsupportedKeyFormats:"02-56",PlaybackManifestNoVariants:"02-57",PlaybackHlsUndeclaredVariables:"02-58",PlaybackAes128InvalidKeyLength:"02-59",PlaybackDashConflictingAes128Keys:"02-60",PlaybackDashUnsupportedAes128Encryption:"02-61",PlaybackManifestPatchMismatch:"02-62",PlaybackEmptyMediaPlaylist:"02-63",PlaybackNonContiguousCompositionTrack:"02-64",PlaybackDecoderNotFound:"02-65",PlaybackDecoderTemporarilyUnavailable:"02-66",PlaybackIncompatibleAsset:"02-67",PlaybackNoCompatibleExternalDisplay:"02-69",PlaybackOutOfMemory:"02-70",PlaybackToneMappingFailed:"02-71",PlaybackVideoCompositorFailed:"02-72",NetworkUnknown:"03-00",NetworkNoInternet:"03-01",NetworkRequestTimeout:"03-02",NetworkUnableToResolveHost:"03-03",NetworkResourceNotFound:"03-04",NetworkExpiredUrl:"03-05",NetworkUrlResolutionFailed:"03-06",NetworkDownloadErrorIdManifest:"03-07",NetworkDownloadErrorIdSidx:"03-08",NetworkDownloadErrorIdContent:"03-09",NetworkDownloadErrorIdInitialization:"03-10",NetworkDownloadErrorIdXlink:"03-11",NetworkHttpRequestFailed:"03-12",NetworkMaxRetriesExceeded:"03-13",NetworkSegmentMissing:"03-14",NetworkHttp400BadRequest:"03-400",NetworkHttp401Unauthorized:"03-401",NetworkHttp402PaymentRequired:"03-402",NetworkHttp403Forbidden:"03-403",NetworkHttp404NotFound:"03-404",NetworkHttp405MethodNotAllowed:"03-405",NetworkHttp406NotAcceptable:"03-406",NetworkHttp407ProxyAuthenticationRequired:"03-407",NetworkHttp408RequestTimeout:"03-408",NetworkHttp409Conflict:"03-409",NetworkHttp410Gone:"03-410",NetworkHttp411LengthRequired:"03-411",NetworkHttp412PreconditionFailed:"03-412",NetworkHttp413PayloadTooLarge:"03-413",NetworkHttp414URITooLong:"03-414",NetworkHttp415UnsupportedMediaType:"03-415",NetworkHttp416RangeNotSatisfiable:"03-416",NetworkHttp417ExpectationFailed:"03-417",NetworkHttp418ImATeapot:"03-418",NetworkHttp421MisdirectedRequest:"03-421",NetworkHttp422UnprocessableEntity:"03-422",NetworkHttp423Locked:"03-423",NetworkHttp424FailedDependency:"03-424",NetworkHttp425TooEarly:"03-425",NetworkHttp426UpgradeRequired:"03-426",NetworkHttp428PreconditionRequired:"03-428",NetworkHttp429TooManyRequests:"03-429",NetworkHttp431RequestHeaderFieldsTooLarge:"03-431",NetworkHttp451UnavailableForLegalReasons:"03-451",NetworkHttp500InternalServerError:"03-500",NetworkHttp501NotImplemented:"03-501",NetworkHttp502BadGateway:"03-502",NetworkHttp503ServiceUnavailable:"03-503",NetworkHttp504GatewayTimeout:"03-504",NetworkHttp505HTTPVersionNotSupported:"03-505",NetworkHttp506VariantAlsoNegotiates:"03-506",NetworkHttp507InsufficientStorage:"03-507",NetworkHttp508LoopDetected:"03-508",NetworkHttp510NotExtended:"03-510",NetworkHttp511NetworkAuthenticationRequired:"03-511",ContentProtectionUnknown:"04-00",ContentProtectionConcurrentStreamLimitExceeded:"04-01",ContentProtectionEntitlementRefused:"04-02",ContentProtectionLicenseExpired:"04-03",ContentProtectionBadLicenseRequest:"04-04",ContentProtectionLicenseServerTimeout:"04-05",ContentProtectionInsufficientHDCPSupport:"04-06",ContentProtectionGeoRestricted:"04-07",ContentProtectionParentalControlRestricted:"04-08",ContentProtectionCDNUnauthorized:"04-09",ContentProtectionInvalidAccessToken:"04-10",ContentProtectionKeySystemNoKeys:"04-11",ContentProtectionKeySystemNoAccess:"04-12",ContentProtectionKeySystemNoSession:"04-13",ContentProtectionKeySystemNoConfiguredLicense:"04-14",ContentProtectionKeySystemCertificateRequestFailed:"04-15",ContentProtectionKeySystemCertificateUpdateFailed:"04-16",ContentProtectionKeySystemSessionUpdateFailed:"04-17",ContentProtectionKeySystemStatusOutputRestricted:"04-18",ContentProtectionKeySystemStatusInternalError:"04-19",ContentProtectionKeyLoadError:"04-20",ContentProtectionKeyLoadTimeout:"04-21",ContentProtectionCapabilityMediaKeysError:"04-22",ContentProtectionManifestKeySystemUnknown:"04-23",ContentProtectionKeySystemUnavailable:"04-24",ContentProtectionCDMCreationFailed:"04-25",ContentProtectionCDMAttachFailed:"04-26",ContentProtectionCDMServerCertificateRejected:"04-27",ContentProtectionCDMSessionCreationFailed:"04-28",ContentProtectionCDMLicenseRequestFailed:"04-29",ContentProtectionCDMLicenseResponseRejected:"04-30",ContentProtectionManifestMissingDRMInfo:"04-31",ContentProtectionLicenseServerMissing:"04-32",ContentProtectionOfflineSessionRemoved:"04-33",ContentProtectionInitDataTransformationError:"04-34",ContentProtectionServerCertificateRequestFailed:"04-35",ContentProtectionInsufficientHDCPVersion:"04-36",ContentProtectionHDCPVersionCheckFailed:"04-37",AdsUnknown:"08-00",AdsVastParseError:"08-100",AdsInvalidVastSchema:"08-101",AdsVastVersionNotSupported:"08-102",AdsUnexpectedAdType:"08-200",AdsCreativeLinearityMismatch:"08-201",AdsCreativeDurationMismatch:"08-202",AdsCreativeSizeMismatch:"08-203",AdsWrapperVastError:"08-300",AdsVastResponseRedirectTimeout:"08-301",AdsWrapperLimitReached:"08-302",AdsVastResponseEmpty:"08-303",AdsLinearAdDisplayError:"08-400",AdsMediaFileNotFound:"08-401",AdsMediaFileUnavailable:"08-402",AdsUnsupportedMimeType:"08-403",AdsUnableToDisplayMediaFile:"08-405",AdsMezzanineFileMissing:"08-406",AdsMezzanineFileDownloaded:"08-407",AdsRejectedAd:"08-408",AdsInteractiveCreativeError:"08-409",AdsVerificationNodeExecutionError:"08-410",AdsNonLinearAdDisplayError:"08-500",AdsNonLinearAdSizeMismatch:"08-501",AdsNonLinearAdFetchError:"08-502",AdsNonLinearUnsupportedType:"08-503",AdsCompanionAdDisplayError:"08-600",AdsCompanionAdSizeMismatch:"08-601",AdsRequiredCompanionAdError:"08-602",AdsCompanionAdFetchError:"08-603",AdsUndefinedVastError:"08-900",AdsUnknownVpaidError:"08-901",AdsVastDocumentEmpty:"08-999"},Pe=Object.fromEntries(Object.entries(ke).map(([e,t])=>[t,e]));const Re=e=>{return e.autoplay&&Ie.AUDIO_REQUIRED&(!0===(t=e.autoplay)?Ie.ON:!1===t?Ie.OFF:t);var t};function Ce(e,t,n){const o="boolean"==typeof n;if("boolean"!=typeof n&&(n=!!e.hasState(fe)||e.paused),function(e,t,n){const o=e.poll(t?V:j,{forced:n});return o&&o.defaultPrevented}(e,n,o))return Promise.resolve();if(!n)return e.hasState(pe)?(e.setState(fe,!0),e.setState(pe,!1),Promise.resolve()):Promise.resolve(e.pause());if(0==e.reaper)return Promise.resolve();const r=e.reaper.get("__pending_play");return e.paused||r?r?(r.src!==De(e.original_src)&&Le(e),r):(function(e){return(0==e.networkState||0==e.readyState)&&e.currentSrc==De(e.original_src)}(e)&&Le(e),function(e){const t=e.hasState(se),n=t&&Re(e.opts);n&&(e.muted&&e.toggleMute(!1),0==e.volume&&(e.volume=1));t&&e.setState(se,!1);return e.play().then(()=>{e.hasState(fe)&&e.togglePlay(!1)}).catch(o=>{if(console.warn(t?n?"[flowplayer/play] autoplay audio required\n%s":"[flowplayer/play] attempting muted autoplay\n%s":"",o.message,"\ninstance:",e),t&&!n)return e.muted=!0,e.play()})}(e)):(e.setState(fe,!1),!e.hasState(Y)&&e.setState(pe,!0),Promise.resolve())}function Le(e){e.opts.is_native&&(e.hasState($)||(e.hasState(J)||e.emit(K),e.setState(J,!0),e.load()))}function De(e){const t=document.createElement("a");return t.href=e,t.href}function Ue(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function Me(e){const t=document.createElement("a");t.href=e;const n=t.pathname&&t.pathname.split(".");return n.length>1&&n[n.length-1]}function Fe(e){switch(e){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return e}}const He=e=>{var{src:t}=e,n=Ue(e,["src"]);return[Object.assign({src:t,type:t?Fe("video/"+Me(t)):""},n)]};function We(e){return He({src:e})}function xe(e){var{src:t,type:n}=e,o=Ue(e,["src","type"]);return t&&n?[Object.assign({src:t,type:n},o)]:n&&!t?[Object.assign({type:n},o)]:He(Object.assign({src:t},o))}const Ve="health:record",je="rebuffer",Ke="rebuffer:ended",Be="display",Ge="insights:ttff",qe="insights:time_to_first_frag_loaded",Ye="insights:watched_interval",ze="flowplayer:feature",$e="health:ready";var Je=Object.freeze({__proto__:null,RECORD:Ve,REBUFFER:je,REBUFFER_ENDED:Ke,DISPLAY:Be,TIME_TO_FIRST_FRAME:Ge,TIME_TO_FIRST_FRAGMENT_LOADED:qe,WATCHED_INTERVAL:Ye,FEATURE_USAGE:ze,HEALTH_SERVICE_READY:$e});const Qe={All:1,High:.1,Medium:.01,Low:.001,None:0};function Ze(e,{feature_name:t,behavior:n,sample_rate:o}){t&&(o||(o=Qe.All),e.emit(ze,{feature_name:t,behavior:n,sample_rate:o}))}var Xe;function et(e,t,n,o={safari:!1}){const r=function(e){return"string"==typeof e?We(e):Array.isArray(e)||"object"!=typeof e?e.reduce(function(e,t){return"string"==typeof t&&(t=We(t)),"object"!=typeof t||Array.isArray(t)||(t=xe(t)),e.concat(t)},[]):xe(e)}(n);return function(e){[Z,fe,pe,Y,z,J,$,ce].forEach(t=>e.setState(t,!1)),e.setState(Q,!0)}(e),Array(...Array(r.length)).map((e,t)=>t).some(n=>{const i=r[n];if(Xe.Ok==function(e,t,n){e.emit(T,n),t.playback_token&&"string"==typeof n.src&&n.src.startsWith("https://")&&(n.src=function(e,t){const n=new URL(e);return n.pathname=`/pt:${t}${n.pathname}`,n.toString()}(n.src,t.playback_token),Ze(e,{feature_name:"signed-urls",behavior:"used",sample_rate:.1}));"string"==typeof n.src&&(e.original_src=n.src);const o=function(e,t,n){return e.plugins.filter(e=>{return(t=e)&&"wants"in t;var t}).find(e=>e.wants(n.src||"",n,t))}(e,t,n);return e.setOpts({is_native:!o}),o?(o.onload(t,e.root,e,n),Xe.Ok):Xe.Err}(e,t,i)||Xe.Ok==function(e,t,n,o={safari:!1}){var r;/^audio\//.test(n.type||"")&&e.emit(F);t.start_time&&(n.src=n.src+"#t="+t.start_time);if(""==e.canPlayType(n.type||""))return Xe.Err;if(n.drm&&(!n.drm["com.apple.fps.1_0"]||!o.safari))return Xe.Err;"string"==typeof n.src&&(e.preload=null!==(r=t.preload)&&void 0!==r?r:"auto",e.src=n.src);return Xe.Ok}(e,t,i,o))return!0;n==r.length-1&&"string"==typeof i.src&&(e.src=i.src)}),e}!function(e){e[e.Err=0]="Err",e[e.Ok=1]="Ok"}(Xe||(Xe={}));const tt=[I,b,T,L];var nt;function ot(e,t,n){return isNaN(e.duration)||isNaN(e.currentTime)?{}:(t.offset+=n,0==t.offset?rt(e,t):(t.timer&&clearTimeout(t.timer),t.timer=setTimeout(function(){0!=e.reaper&&(e.currentTime=function(e,t,n=0){return Math.max(Math.min(t,e),n)}(e.currentTime+t.offset,e.duration),t.timer=0,rt(e,t))},1e3),function(e,t){e.setState(he,!0),e.setState(nt.BACKWARD,t.offset<0),e.setState(nt.FORWARD,t.offset>0)}(e,t),e.emit(C,t),t))}function rt(e,t){t.timer&&clearTimeout(t.timer),t.timer=t.offset=0,function(e){e.setState(nt.FORWARD,!1),e.setState(nt.BACKWARD,!1),e.setState(he,!1)}(e)}function it(){if("undefined"==typeof document)return!1;const e=document.documentElement;return e&&"rtl"==e.getAttribute("dir")}function at(e,t,n){const o=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;o.length;){if(null==e)return n;const t=o.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}function st(e,t,n,o){if((o=o||0)>=e.length)return n;return at(e[o],t,st(e,t,n,o+1))}!function(e){e.FORWARD="forward",e.BACKWARD="backward"}(nt||(nt={}));const lt=[1e7]+""+-1e3+-4e3+-8e3+-1e11,ct=()=>"undefined"==typeof crypto?"":lt.replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),dt="flowplayer/uuid";let ut="";!function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}}();const pt=["touchstart","touchmove"];function ft(e,t){const n=new CustomEvent(e,{detail:t,cancelable:!0});return t&&Object.defineProperty(n,"data",{get:()=>t}),n}function ht(e,t,n){const o=ft(t,n);return e.dispatchEvent(o),e}function mt(e,t,n){const o=ft(t,n);return e.dispatchEvent(o),o}function yt(e,t,n,o){Array.isArray(t)?t.forEach(t=>Et(e,t,n,o)):Et(e,t,n,o)}function Et(e,t,n,o){if(r=t,!~pt.indexOf(r))return e.addEventListener(t,n,o),e;var r;const i=Object.assign(o||{},{passive:!0});return e.addEventListener(t,n,i),e}function gt(e,t,n,o){return yt(e,t,n,Object.assign(o||{},{once:!0}))}class PlayerStorage{constructor(e,t){this.implementation=e,t&&t.keys().forEach(e=>{"string"==typeof t.implementation[e]&&this.implementation.setItem(e,t.implementation[e])})}keys(){var e;const t=[];for(var n=0;n<this.implementation.length;n++)(null===(e=this.implementation.key(n))||void 0===e?void 0:e.startsWith("flowplayer/"))&&t.push(this.implementation.key(n));return t}removeItem(e){try{this.implementation.removeItem(`flowplayer/${e}`)}catch(e){}}getItem(e){try{return this.implementation.getItem(`flowplayer/${e}`)}catch(e){return null}}setItem(e,t){try{this.implementation.setItem(`flowplayer/${e}`,t)}catch(e){}}clear(){try{this.keys().forEach(e=>this.implementation.removeItem(e))}catch(e){}}get length(){try{return this.keys().length}catch(e){return 0}}key(e){try{return this.implementation.key(e)}catch(e){return null}}}class InMemoryStorage{constructor(){this.pairs=[]}get length(){return this.pairs.length}clear(){this.pairs=[]}getItem(e){var t;return(null===(t=this.pairs.find(t=>t[0]===e))||void 0===t?void 0:t[1])||null}key(e){return this.pairs[e][0]||null}removeItem(e){this.pairs=this.pairs.filter(t=>t[0]!==e)}setItem(e,t){this.removeItem(e),this.pairs.push([e,t])}}const wt={preload:"auto",rtl:!1,controls:!0},_t=["muted","preload"];function vt(e,o,r){let i;r.live_state={dvr_window:void 0,get dvr(){return i},set dvr(t){i=t;const n=!(!e.live||t);r.hasState(de)!=n&&r.setState(de,n)}},r._storage=new PlayerStorage(["localStorage","sessionStorage"].map(e=>{try{const t=window[e];return t.getItem(""),t}catch(t){return console.debug(`Access to window.${e} denied, trying next option`),null}}).find(e=>!!e)||new InMemoryStorage),r.toJSON=function(){return{duration:r.duration,volume:r.volume,currentTime:r.currentTime,states:r.root.className}},r.setSrc=function(t){return et(r,e,t,n())},r.playerState=r.playerState||{},r.setState=function(e,t){if(r.playerState[e]===!!t)return r;const n=Object.assign({},r.playerState,{[e]:t});return r.playerState=n,ht(r,x,r.playerState),r},r.createComponents=function(...e){return Array.from({length:e.length}).map((t,n)=>Oe(this,e[n]))},r.hasState=function(e){return!!r.playerState[e]},r.transitionState=function(e,t,n){!r.hasState(e)&&r.hasState(t)||(n=0),n&&r.setState(le,!0),r.setState(t,!1),r.setState(e,!0),n&&setTimeout(function(){r.setState(le,!1)},n)},r.emit=(e,t)=>(ht(r,e,t),r),r.on=(e,t)=>(yt(r,e,t),r),r.once=(e,t)=>(gt(r,e,t),r),r.off=(e,t)=>{var n,o;return n=e,o=t,r.removeEventListener(n,o),r},r.poll=(e,t)=>mt(r,e,t),r.togglePlay=function(e){return r.hasState(ie)?Promise.reject():Ce(r,0,e)},r.toggleMute=function(e){e=null==e?!r.muted:!!e,r.muted=e,r.muted||r.volume||(r.volume=1),ht(r,y)},r.toggleDisable=function(e){e=null==e?!r.disabled:!!e,r.setState(X,e),r.disabled=e},r.destroy=function(){r.pause();const e=t.indexOf(r);~e&&t.splice(e,1),setTimeout(function(){r.setSrc([]),r.reaper&&r.reaper.clear(),ht(r,I),r.setState(ge,!0)},0)},r.setAttrs=function(e){return _t.forEach(t=>{if(!(t in e))return;const n=e[t];n?r.setAttribute(t,n.toString()):r.removeAttribute(t)}),r},r.opt=function(t,n){return n=void 0===n?at(wt,t):n,at(e,t,n)},r.i18n=function(e,t){if(!r.reaper)return"";const n=r.reaper.get("translations");return n?st(n,e,t||""):t||""},r.setOpts=function(t){Object.assign(e,t),e.live&&!r.hasState(re)&&(r.setState(de,!0),ht(r,P)),"disabled"in t&&void 0!==t.disabled&&r.toggleDisable(t.disabled),"muted"in t&&void 0!==t.muted&&r.toggleMute(t.muted),"dvr"in e&&(r.live_state.dvr=r.opt("dvr")),r.setState(ne,r.opt("rtl",function(e){if(!e)return it();const t=e.getAttribute("dir");return t?"rtl"==t:it()}(o))),r.setState(re,!!e.live),r.setState(ue,"string"==typeof e.poster&&e.poster.length>0),r.setState(me,!!e.seekable),r.setState(Ee,0==e.controls),o.style.backgroundImage=r.hasState(ue)?"url('"+e.poster+"')":"",ht(r,W,e)},r.renderPlugin=function(e){mt(r,M,e).defaultPrevented||r.root.appendChild(e)};const a={offset:0,timer:0};var s,l;l=a,(s=r).on(tt,function(){rt(s,l)}),r.enqueueSeek=function(e){if(0!=r.opts.seekable&&!(1==r.opts.disabled&&e>0))return ot(r,a,e)},r.deviceId=function(){return function(e){if(ut)return ut;try{const t=e.getItem(dt);if(t)return t;const n=ct();return e.setItem(dt,n),n}catch(e){return ut=ct()}}(r._storage)}}var St="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};const Nt=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function bt(e,t){return!!~Nt.indexOf(e)||e.indexOf(t)===e.length-t.length}bt.check_whitelist=function(e){return!!~Nt.indexOf(e)};const At="production";function Ot(e,t){const n={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let o={c:"{}",exp:0};t=t||{};try{o=be(e),n.valid_jwt=!0}catch(e){}return n.raw=e,n.data=JSON.parse(o.c),n.exp=o.exp,t.require_valid_token&&Ot.validate(n),n}var Tt;function It(e){return{grant:e,is_granted:t=>(e&t)===t}}function kt({root:e,video:t,data:n}){t&&t.destroy(),console.error(new Error(n.details||n.reason)),e.innerHTML="",e.classList.remove("flowplayer"),e.classList.add("flowplayer-fatal"),e.style.removeProperty("background-image");const o=document.createElement("h2");o.textContent="Playback Error";const r=document.createElement("p");r.textContent="Are you the site owner?";const i=document.createElement("a");i.classList.add("troubleshoot"),i.target="_blank",i.href="https://docs.flowplayer.com/troubleshooting/player#"+n.reason,i.textContent="Troubleshoot?";const a=document.createElement("img");a.src="https://flowplayer.com/user/pages/images/logo-white.png",a.alt="Flowplayer Logo",e.append(o,r,i,a)}function Pt(e){return t=>{setTimeout(function(){if(!t.defaultPrevented&&!t.prevented)return e(t)},0)}}Ot.validate=function(e){if("string"==typeof e&&(e=Ot(e)),!e||!e.raw){if(bt.check_whitelist(window.location.hostname)||"dev"===At.toString())return!0;throw new Error("No token provided in configuration")}if(!e.valid_jwt)throw new Error("Invalid token provided");const t=window.location.hostname,n=bt.bind(null,t);if("dev"!==At.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(n))throw new Error("Domain not allowed");if("dev"!==At.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},Ot.id=function(e){if(e)return"string"==typeof e&&(e=Ot(e)),e.data.id},function(e){e[e.ADS=2]="ADS",e[e.ANALYTICS=4]="ANALYTICS",e[e.NO_METERING=8]="NO_METERING",e[e.DEVELOPER_PLAN=16]="DEVELOPER_PLAN",e[e.WOWZA_VIDEO=32]="WOWZA_VIDEO"}(Tt||(Tt={})),It.of=It,It.from_token=function(e){const t=Ot(e,{require_valid_token:!0});return It.of(t.data.acl)},It.permissions=Tt;const Rt="is-casting",Ct="has-casted";function Lt(e){return function(e,t){const n=e.seekable;if("object"!=typeof e.opts||0==n.length)return{head:0,tail:0};const o=Dt(e),r=t||e.live_state.dvr_window;return{head:o,tail:"number"!=typeof r||o-r<0?n.start(0):o-r}}(e).tail}function Dt(e){var t;const n=e.seekable;return n.length?e.hasState("is-chromecast-playing")||!(null===(t=e.hls)||void 0===t?void 0:t.liveSyncPosition)?n.end(n.length-1):e.hls.liveSyncPosition:0}function Ut(e){try{e.dvr_offset=0,e.currentTime=Dt(e)}catch(e){console.warn("failed to seek to now: %j",e)}}function Mt(e,t){const n=t.clientWidth;t.classList.toggle(ee,n<600),t.classList.toggle(te,n<400)}function Ft(e,t,n){let o=!0;t.classList.add("flowplayer"),Mt(0,t),gt(n,m,()=>{void 0!==e.start_quality&&Ze(n,{feature_name:"start-quality",behavior:String(e.start_quality),sample_rate:Qe.High})}),yt(n,m,()=>{if(!n.hasState(J)&&!n.hasState($)&&e.is_native&&"none"!==e.preload)return"metadata"===e.preload?(n.setState(J,!0),n.emit(K)):void Le(n)}),yt(n,u,()=>{e.is_native&&"metadata"===e.preload&&n.paused&&n.emit(v)}),yt(n,[m,l],function(){Mt(0,t)}),yt(n,x,function(){Object.entries(n.playerState).forEach(function([e,n]){t.classList.toggle(e,n)})}),yt(n,h,function(){n.setState(ae,!n.hasState(Rt)&&!n.hasState(Q)&&n.readyState<3)}),yt(n,S,function(t){const o=n.original_src;Pt(()=>{if(o===n.original_src){if(n.setState(oe,!0),gt(n,h,function(){n.setState(oe,!1),o===n.original_src&&n.setState(Q,!e.loop&&!!e.rewind&&n.paused)}),e.loop)return n.togglePlay(!0);e.rewind&&(n.currentTime=0)}})(t)}),yt(n,[b,N],function(e){n.setState(Z,e.type==b)}),yt(n,D,function(e){setTimeout(()=>{e.defaultPrevented||(n.currentTime=e.detail.currentTime)},0)}),yt(n,S,function(){n.setState(Y,!1),o=!0}),yt(n,f,()=>{if(!n.opts.live||!n.opts.is_native)return;const e=n.seekable;0!=e.length&&n.emit("dvr/window",e.end(e.length-1)-e.start(0))}),yt(n,p,function(){n.setState($,!0),n.setState(J,!1)}),yt(n,w,()=>{n.setState(pe,!0)}),yt(n,[_,v,m],function(t){if(!n.hasState(Z)&&(t.type!=v||e.autoplay||n.setState(ae,!1),t.type!=m||"none"!=n.opt("preload")||e.autoplay)){if(t.type==m&&e.autoplay)return gt(n,g,function(){n.setState(ae,!1)});t.type!=_||n.hasState($)||n.setState(J,!0),n.setState(oe,!1),n.setState(ae,t.type==_)}}),yt(n,[g,E],function(t){setTimeout(()=>{const e=new CustomEvent("flowplayer/"+t.type,{detail:n});document.dispatchEvent(e)},0);const r=t.type==g,i=n.currentTime==n.duration,a=r&&o&&e.autoplay||n.hasState(ae);if(r&&(n.started=!0,o=!1),n.setState(ae,!1).setState(pe,!1),!r&&n.setState(fe,!1),i)return;const s=r?Y:z,l=r?z:Y;n.transitionState(s,l,a?0:300),!n.hasState(Q)||n.root.classList.contains("ad-hide-first-frame")||n.root.classList.contains("preroll-ios")||function(e,t){if(!e.hasState(re)||![void 0,0,-1].includes(t)||!e.seekable.length||e.hasState(Ct))return e.setState(Q,!1);e.once(N,()=>e.setState(Q,!1)),0===t?function(e){e.currentTime=Lt(e)}(e):Ut(e)}(n,e.start_time)})}const Ht=[0].concat(Array.from({length:100}).map((e,t)=>(t+1)/100));function Wt(){return t.find(e=>e.hasState(Rt))}const xt=.5625;function Vt(e){if("number"==typeof e&&!isNaN(e))return Number(e);if("string"==typeof e){const t=e.split(":");return Number(t[1])/Number(t[0])}return e}class ExplorerPlan{constructor(){this.cleanUp=this.cleanUp.bind(this),this.render=this.render.bind(this),this.wireUp=this.wireUp.bind(this)}init(e,t,n){this.root=t,this.player=n,this.wireUp()}wireUp(){var e,t;this.cleanUp(),null===(e=this.player)||void 0===e||e.once(g,this.render),null===(t=this.player)||void 0===t||t.once(S,this.wireUp)}cleanUp(){var e,t,n,o;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo),null===(n=this.player)||void 0===n||n.off(g,this.render),null===(o=this.player)||void 0===o||o.off(S,this.wireUp)}render(){var e,t,n;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo);const o=(null===(n=this.root)||void 0===n?void 0:n.querySelector(".fp-ui"))||this.root;if(!o)return;const r=this._logo=document.createElement("a");r.href="https://explorer.flowplayer.com",r.target="_blank",Object.entries(jt).forEach(([e,t])=>{r.style.setProperty(e,t,"important")}),o.appendChild(r)}}ExplorerPlan.pluginName="explorer-plan";const jt={display:"block",opacity:"1",visibility:"visible",width:"33%","padding-top":"9%",position:"absolute","z-index":"9999",bottom:"25%",left:"10%","background-size":"cover","background-image":"url(https://static.flowplayer.com/explorer/explorer.svg)"},Kt="flowplayer/"+g;function Bt(e,t){const n=[];e.addEventListener("contextmenu",o=>{const r=o.timeStamp;for(n.push(r);n.length>3;)n.shift();n.length>=3&&n.every(e=>e-r<3e3)&&(console.debug("flowplayer/debug rendering info"),function(e,t){var n;!function(e){const t=e.querySelector(".debug-info");null==t||t.remove()}(e);const o=document.createElement("div");o.classList.add("debug-info");const r=Gt("flowplayer.version","3.32.2-rc");o.append(r);const i=null===(n=null==t?void 0:t.hls)||void 0===n?void 0:n.constructor;if(i&&i.version){const e=Gt("hls.version",i.version);o.append(e)}e.appendChild(o)}(e,t))})}const Gt=(e,t)=>{const n=document.createElement("div");n.classList.add("row",e);const o=document.createElement("span");o.classList.add("attr"),o.textContent=e;const r=document.createElement("span");return r.textContent=t,r.classList.add("value"),n.append(o,r),n};function qt(e,t){const n=function(){try{return localStorage.getItem("flowplayer/debug")}catch(e){return""}}(),o=(o,...r)=>{try{const i=(null==t?void 0:t.debug)||n;i&&e.match(i)&&console.log(`flowplayer/${e} -- ${o}`,...r)}catch(e){console.warn(e)}};return o.log=o,o}const Yt="without_recovery",zt="off";class FlowplayerError extends Error{static getErrorKey(e){return e in Pe?Pe[e]:Pe["00-00"]}constructor(e,t,n={}){super(e),this.message=e,this.flowplayerErrorCode=t,this.config=n,this.id=ct(),this.isFatal=!!n.isFatal,this.errorKey=FlowplayerError.getErrorKey(this.flowplayerErrorCode)||"unknown"}toJSON(){return{message:this.message,flowplayer_error_code:this.flowplayerErrorCode,id:this.id,root_error_id:this.config.rootErrorId,resource:this.config.resource,is_fatal:this.isFatal,is_retry:!!this.config.isRetry}}}const $t=qt("core/retry");function Jt(e,t){const n={pending:void 0,count:0};e.on(B,o=>{var i,a,s,l,c;const d=null===(i=o.detail)||void 0===i?void 0:i.error;d.config.isRetry=!!n.count,void 0===n.pending&&(null===(s=null===(a=d.config)||void 0===a?void 0:a.retryOpts)||void 0===s?void 0:s.retry)!==zt&&(t.retry||(null===(c=null===(l=d.config)||void 0===l?void 0:l.retryOpts)||void 0===c?void 0:c.retry))&&(++n.count,n.pending=function(e,t,n){var o,i;return setTimeout(()=>{var o;e.hasState(ge)||(t.pending=void 0,(null===(o=n.config.retryOpts)||void 0===o?void 0:o.retry)!==Yt&&e.emit(R),e.emit(r,{error:n}),$t("%s try",t.count))},null!==(i=null===(o=n.config.retryOpts)||void 0===o?void 0:o.retryTimeout)&&void 0!==i?i:3e3*t.count)}(e,n,d))}),e.on(g,()=>{n.count=0}),e.on([T,R],e=>{e.type===T&&(n.count=0),clearTimeout(n.pending),n.pending=void 0}),e.on(r,Pt(()=>{e.load()}))}const Qt=[K,i,T];function Zt(e){try{return!!new URL(e)}catch(e){return!1}}const Xt=navigator;function en(e){var t,n;const o=null===(t=e.hls)||void 0===t?void 0:t.bandwidthEstimate;return o?1e-6*o:(null===(n=Xt.connection)||void 0===n?void 0:n.downlink)||-1}function tn(e,t){return async function(e,t){try{await fetch(e,{body:t,method:"POST",mode:"no-cors"})}catch(e){}}(e,JSON.stringify({events:t}))}const nn=e=>{switch(e){case!0:return Ie.ON;case!1:return Ie.OFF;default:return e}};function on(){try{const e=window.location!==window.parent.location?document.referrer:document.location.href;return"string"==typeof e&&e.slice(0,200)}catch(e){return!1}}const rn=[],an="https://ihi.flowplayer.com/v1/health/events";function sn(e){if(e.suspended)return;const t=rn.slice(0);rn.length=0,0!=t.length&&(e.logger.log(`:dispatch events={${t.length}}`),tn(function(){try{return"undefined"==typeof window?an:window.__FLOWPLAYER_INSIGHTS_URL?window.__FLOWPLAYER_INSIGHTS_URL:an}catch(e){return an}}(),t))}async function ln(e,t,n){const o=await dn();rn.push(Object.assign(t,o)),e.logger.log(":enqueue",t.event,t),rn.length<10&&!n||sn(e)}const cn=()=>{var e,t;try{const n=window;return null===(t=null===(e=null==n?void 0:n.google)||void 0===e?void 0:e.ima)||void 0===t?void 0:t.VERSION}catch(e){return}},dn=async()=>({client_time:Date.now()}),un=(e,t)=>Object.assign(e,{detail:t}),pn=(e,{event:t,media_session_id:n,session_id:o,play_range_id:r})=>({event:t,media_session_id:n,session_id:o,play_range_id:r,device_id:e.deviceId(),version:"3.32.2-rc",commit:"aeb5daf69505b89f82c9b0bf9131465e3daf4c92",ima_sdk_version:cn(),preload:e.opt("preload"),autoplay:nn(e.opt("autoplay")),live:e.opt("live"),dvr:!!e.live_state.dvr,source:e.original_src,downlink_mbs:en(e),page_url:on(),player_id:e.opt("metadata.player_id"),media_id:e.opt("metadata.media_id")||e.opt("metadata.stream_target_id"),site_id:e.opt("metadata.site_id"),category_id:e.opt("metadata.category_id"),sitegroup_id:e.opt("metadata.sitegroup_id"),token:e.token,plugins:e.plugins.map(e=>e.constructor.name).sort((e,t)=>e.localeCompare(t)),current_time:e.currentTime,external_media_id:e.opt("external_media_id")}),fn=e=>({bitrate:null==e?void 0:e.bitrate,resolution:null==e?void 0:e.attrs.RESOLUTION,frame_rate:null==e?void 0:e.attrs["FRAME-RATE"]});const hn=(e,t)=>{let n=null;return(...o)=>{null!==n&&(clearTimeout(n),n=null),n=setTimeout(()=>t(...o),e)}};var mn;!function(e){e[e.Starting=0]="Starting",e[e.ConfigFinalized=1]="ConfigFinalized",e[e.TimerStartedWithAutoplay=2]="TimerStartedWithAutoplay",e[e.TimerStartedWithUserGesture=3]="TimerStartedWithUserGesture",e[e.MetricReported=4]="MetricReported"}(mn||(mn={}));const yn=[a,s];class TimeToFirstFrame{constructor(e=mn.Starting,t=!1){this.state=e,this.loadedAd=t}reset(){this.state=mn.Starting,this.loadedAd=!1,this.start=void 0,this.end=void 0,this.adDetails=void 0}adInfo(){const{ad_tag_id:e,vast_ad_id:t}=this.adDetails||{};return{ad_tag_id:e,vast_ad_id:t}}toJSON(){return Object.assign({ad_was_requested:this.loadedAd,ms_to_first_frame:Math.round(this.end&&this.start?this.end-this.start:-1)},this.adInfo())}startTimer(e){this.state==mn.ConfigFinalized&&(this.state=e,this.start=performance.now())}hasStarted(){return[mn.TimerStartedWithAutoplay,mn.TimerStartedWithUserGesture].includes(this.state)}stopTimer(e){this.hasStarted()&&(this.end||(this.end=performance.now()),this.state=mn.MetricReported,e())}}function En(e){return Math.round(1e3*e)/1e3}class EWMA{constructor(e){this.tickInterval=e,this.ewma=0,this.startTime=Date.now()}decay(){const e=Date.now()-this.startTime;return Math.pow(2,-e/(4*this.tickInterval))}update(e){const t=this.decay();return this.ewma=t*this.ewma+(1-t)*e,this.ewma}toJSON(){return this.ewma}}const gn={skipUnreliableSegments:!0};class WatchedState{constructor(e){this.player=e,this.marchingInterval=void 0,this.lastWatchedPoint=void 0,this.watchedSum=0,this.lastReportedSum=0,this.ewmaTickWatched=new EWMA(WatchedState.AccuracyMilliseconds)}reset(){this.onNotWatching(),this.watchedSum=0,this.lastReportedSum=0,this.lastWatchedPoint=void 0}onNotWatching(){this.marchingInterval&&(this.updateWatched(),this.marchingInterval=clearInterval(this.marchingInterval))}onWatching(){this.marchingInterval||(this.lastWatchedPoint=this.createWatchedPoint(),this.marchingInterval=setInterval(()=>{this.updateWatched()},WatchedState.AccuracyMilliseconds))}createWatchedPoint(){return{currentTime:this.player.currentTime,paused:this.player.paused}}updateWatched(){const e=this.createWatchedPoint();this.lastWatchedPoint&&this.calculateTimeWatched(this.lastWatchedPoint,e),this.lastWatchedPoint=e}calculateTimeWatched(e,t){var n,o;const r=t.currentTime-e.currentTime,i=this.ewmaTickWatched.update(r);if(!(r<0)&&!(!1!==(null===(o=null===(n=this.player.opts)||void 0===n?void 0:n.health)||void 0===o?void 0:o.skipUnreliableSegments)&&1e3*r>1.3*WatchedState.AccuracyMilliseconds)&&(this.watchedSum+=r,this.watchedSum!=this.lastReportedSum&&(this.watchedSum>this.lastReportedSum+WatchedState.ReportingIntervalSeconds||this.player.ended))){const e=En(i),t={total_watched_seconds:En(this.watchedSum),tick_watched_seconds:e,batch_watched_seconds:En(this.watchedSum-this.lastReportedSum)};this.lastReportedSum=this.watchedSum,this.player.emit(Ye,t)}}}WatchedState.ReportingIntervalSeconds=5,WatchedState.AccuracyMilliseconds=160;const wn=ct();class Health{constructor(e,t){let n;this.session_id=wn,this.suspended=!1,this.logger=qt("health",t.opts),this.media_session_id=ct(),this.play_range_id=ct(),this.analyticsLoop=setInterval(()=>sn(this),2e3),t.on(I,()=>clearInterval(this.analyticsLoop)),t.on(g,()=>{n!==this.media_session_id&&(n=this.media_session_id,this.first_playing_event_timestamp=Date.now()),this.play_range_id=ct()});let o=Date.now()-1e3;t.on(h,e=>{if(n!==this.media_session_id)return;const r=Date.now();if(r<o)return;o=Date.now()+5e3;const i=pn(t,this.eventInfo(e.type)),a=un(i,{duration:(s=t.duration,Number.isFinite(s)?s:s===1/0?-1:void 0)});var s;this.first_playing_event_timestamp&&(Object.assign(a,{ms_since_first_playing:r-this.first_playing_event_timestamp}),this.first_playing_event_timestamp=void 0),ln(this,a)});const r=this;if(t.health={get media_session_id(){return r.media_session_id},set media_session_id(e){r.media_session_id=e},get session_id(){return r.session_id},set session_id(e){r.session_id=e},toggle(e){e?r.resume():r.suspend()}},!Health._UNLOAD_SUBSCRIBED){Health._UNLOAD_SUBSCRIBED=!0;const t=t=>e.instances.forEach(e=>e.emit(t.type));document.addEventListener("visibilitychange",e=>{"hidden"==document.visibilityState&&t(e)}),window.addEventListener("pagehide",t)}}eventInfo(e){return{event:e,media_session_id:this.media_session_id,session_id:this.session_id,play_range_id:this.play_range_id}}suspend(){this.suspended=!0,clearInterval(this.analyticsLoop)}resume(){this.suspended=!1,this.analyticsLoop=setInterval(()=>sn(this),2e3)}init(e,t,n){if(on().toString().startsWith("data:"))return this.suspend();!function(e){let t=null;const n=()=>{t=null};e.on(_,function(t){e.seeking||e.networkState===e.NETWORK_LOADING&&(e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||e.emit(je))}),e.on(je,e=>{t=e}),e.on(v,o=>{if(t){const r=o.timeStamp-t.timeStamp;if(n(),r<31)return;if(r>3e5)return;e.emit(Ke,{rebuffer_duration:r/1e3})}}),Qt.forEach(t=>e.on(t,n))}(n),function(e){let t;[v,K].forEach(n=>{e.on(n,n=>{const o=Date.now();switch(n.type){case K:return t=o;case v:if(t)return e.emit(qe,{ms_since_loading_started:o-t}),t=null}})})}(n),function(e){if(void 0===window.performance)return;const t=new TimeToFirstFrame;e.on(T,()=>{if(!e.opt("metadata.media_id"))return t.reset();t.reset(),t.state=mn.ConfigFinalized}),e.on(K,()=>{(e.root.classList.contains("ad-hide-first-frame")||e.opt("autoplay"))&&t.startTimer(mn.TimerStartedWithAutoplay)}),yn.forEach(n=>{e.on(n,()=>{e.opt("autoplay")||t.startTimer(mn.TimerStartedWithUserGesture)})}),e.on("ad-requested",()=>{t.loadedAd=!0}),e.on(h,()=>{if(!(e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA)){if(e.root.classList.contains("ad-hide-first-frame"))return!t.end&&(t.end=performance.now());switch(t.state){case mn.TimerStartedWithAutoplay:case mn.TimerStartedWithUserGesture:return t.stopTimer(()=>e.emit(Ge,t.toJSON()))}}}),e.on("ad-started",n=>{switch(t.end=void 0,t.adDetails=n.detail,t.state){case mn.TimerStartedWithAutoplay:case mn.TimerStartedWithUserGesture:return t.stopTimer(()=>e.emit(Ge,t.toJSON()))}})}(n),function(e){const t=new WatchedState(e);e.on(K,()=>t.reset()),e.on(g,()=>t.onWatching()),e.on(Ke,()=>!e.paused&&t.onWatching()),e.on(je,()=>t.onNotWatching()),e.on(E,()=>t.onNotWatching()),e.on(b,()=>{e.currentTime>1&&t.updateWatched(),t.onNotWatching()}),e.on(N,()=>{e.paused||t.onWatching()}),e.on(S,()=>t.updateWatched()),e.on("visibilitychange",()=>t.updateWatched())}(n),n.on(Be,e=>{ln(this,pn(n,this.eventInfo(e.type)),!0)}),n.on(Ve,({detail:e})=>{const t=pn(n,this.eventInfo(e.event));Object.assign(t,e.detail||{}),ln(this,t)}),n.on(ze,e=>{if(t=e.detail.sample_rate,!Object.values(Qe).includes(t))return console.debug(`sample_rate=${e.detail.sample_rate} is invalid`);var t,o;if(!(0!==(o=e.detail).sample_rate&&Math.random()<=o.sample_rate))return;const r=pn(n,this.eventInfo(e.type));ln(this,un(r,e.detail))}),n.on(T,()=>{n.opt("metadata.media_id")&&n.emit($e)}),[m,u,p,f,_,je].forEach(e=>{n.on(e,e=>{ln(this,pn(n,this.eventInfo(e.type)))})}),[Ke,Ge,qe,Ye].forEach(e=>{n.on(e,e=>{const t=pn(n,this.eventInfo(e.type));ln(this,Object.assign(t,e.detail))})}),[g,E,b,N,S,c,d,v,K].forEach(e=>{n.on(e,e=>{ln(this,pn(n,this.eventInfo(e.type)))})}),n.on(y,hn(800,e=>{const t=pn(n,this.eventInfo(e.type));ln(this,un(t,{volume:parseFloat(n.volume.toFixed(2)),muted:n.muted}))})),n.on(l,hn(800,e=>{const o=pn(n,this.eventInfo(e.type));ln(this,un(o,{height:t.clientHeight,width:t.clientWidth}))})),n.on("hls/failover",e=>{const t=pn(n,this.eventInfo(e.type)),o=e.detail,{reason:r,from:i}=o;ln(this,un(t,{reason:r,from:i}))}),n.on(k,({type:e,detail:t})=>{if("hls"===t.plugin)return function(e,t,n,o){const r=pn(t,e.eventInfo(n)),i=Object.assign({before:fn(o.before),after:fn(o.after),automatic:o.automatic,downscale:o.downscale},o.before?{}:{start_quality:t.opts.start_quality});ln(e,Object.assign(Object.assign({},r),{state:i}))}(this,n,e,t)}),n.on(B,e=>{const t=pn(n,this.eventInfo(e.type)),o=e.detail.error;if(!o)return ln(this,t,!0);return ln(this,un(t,o.toJSON()),!0)}),n.on(T,e=>{var t;const o=null===(t=e.detail)||void 0===t?void 0:t.src;if("string"!=typeof o)return;if(!Zt(n.original_src))return;if(!Zt(o))return;if(o==n.original_src)return;this.media_session_id=ct();ln(this,pn(n,this.eventInfo(e.type))),sn(this),n.setOpts({health:Object.assign(Object.assign({},n.opts.health),gn)})}),n.on("visibilitychange",e=>{ln(this,pn(n,this.eventInfo(e.type))),sn(this)})}}function _n(e,t){return function(e){return e.extensions.reduce((e,t)=>e.find(e=>e.pluginName===t.pluginName)?(console.warn("flowplayer: duplicate plugin %s detected, plugin names should be unique",t.name),e):(e.push(t),e),[])}(e).map(n=>new n(e,t))}function vn(e,t={}){var n,o,r,i,a,s;switch(e.code){case MediaError.MEDIA_ERR_ABORTED:return new FlowplayerError(null!==(n=e.message)&&void 0!==n?n:"The playback was aborted, typically by the user.",ke.PlaybackInternalAborted,Object.assign({isFatal:!1,retryOpts:{retry:zt}},t));case MediaError.MEDIA_ERR_NETWORK:return new FlowplayerError(null!==(o=e.message)&&void 0!==o?o:"A network error prevented media from being downloaded.",ke.NetworkHttpRequestFailed,Object.assign({isFatal:!0},t));case MediaError.MEDIA_ERR_DECODE:return new FlowplayerError(null!==(r=e.message)&&void 0!==r?r:"An error occurred while decoding the media.",ke.PlaybackVideoDecodeError,Object.assign({isFatal:!0},t));case MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:return new FlowplayerError(null!==(i=e.message)&&void 0!==i?i:"The media could not be loaded because the format is not supported.",ke.MediaUnsupportedVideoFormat,Object.assign({isFatal:!0},t));case 5:return new FlowplayerError(null!==(a=e.message)&&void 0!==a?a:"Encrypted content could not be played due to missing keys or unsupported protection scheme.",ke.ContentProtectionKeySystemNoKeys,Object.assign({isFatal:!0},t));default:return new FlowplayerError(null!==(s=e.message)&&void 0!==s?s:"An unknown playback error occurred.",ke.PlaybackUnknown,Object.assign({isFatal:!0},t))}}Health.pluginName="health",Health.events=Je,Health._UNLOAD_SUBSCRIBED=!1;const Sn=function(){const e="undefined"!=typeof window?window:void 0!==St?St:{},t=e.flowplayer?e.flowplayer:{extensions:[]};return Array.isArray(t.extensions)||(t.extensions=[]),t}();function Nn(n,r){if("function"==typeof n)return e.push(...[...arguments].filter(e=>"function"==typeof e)),Nn;"string"==typeof r&&(r={src:r}),r||(r={}),r.token||"string"!=typeof window.__FLOWPLAYER_TOKEN||(r.token=window.__FLOWPLAYER_TOKEN);const a="string"==typeof n?document.querySelector(n):n;if(!a)return console.error(new Error("Flowplayer: '"+n.toString()+"' not found"));const s=a.querySelector("video.fp-engine");if(s)return s;const c=function(e){try{return Ot.validate(e),{success:!0,message:""}}catch(e){return{success:!1,message:e.message}}}(r.token);if(!c.success)return kt({root:a,data:{reason:"token",details:c.message}});const d=new Map,f=function(e,t){const n=t.querySelector("video"),o=n||(e._video_element_callback?e._video_element_callback(e):document.createElement("video"));return o.classList.add("fp-engine"),o.playsInline=!0,n||t.append(o),o}(r,a);var h;f.reaper=d,f._customElements=Ae,Object.defineProperty(f,"token",{value:"string"==typeof r.token?Ot.id(r.token):"",writable:!1}),f.addEventListener(I,()=>{d.clear(),f.reaper=0,delete f.root}),f.root=a,r.token&&It.from_token(r.token).is_granted(It.permissions.DEVELOPER_PLAN)&&e.push(ExplorerPlan),!~t.indexOf(f)&&t.push(f),vt(r,a,f),f.setAttrs(r),f.plugins=_n(Nn,f),Ft(r,a,f),function(e,t,n){if(!window.IntersectionObserver)return;const o={should_resume:!!e.autoplay,locked:!1};yt(n,w,function(){o.locked||(o.should_resume=!0)});const r=()=>{if(!e.autoplay)return;if(n.hasState(ye)&&o.should_resume)return n.togglePlay(!0);const t=n.currentSrc;e.autopause||n.hasState(ye)||!o.should_resume||gt(n,A,()=>{e.autoplay&&o.should_resume&&t===n.currentSrc&&n.togglePlay(!0)})},i=()=>{if(!e.autoplay)return;if(!e.is_native)return;if("auto"===e.preload)return;if(n.hasState(ye))return Le(n);const t=n.currentSrc;gt(n,A,()=>{t!==n.currentSrc||n.readyState>1||!n.paused||Le(n)})};yt(n,T,function(){o.should_resume=!!e.autoplay,n.off(m,i),n.once(m,i),n.off(v,r),n.once(v,r)}),yt(n,E,function(){o.locked||(o.should_resume=!1)});const a=new IntersectionObserver(e=>{e.forEach(e=>{setTimeout(()=>{const t=e.intersectionRatio,o=n.hasState(ye);if(n.setState(ye,t>=.2),n.emit(U,{ratio:t}),o===n.hasState(ye))return;const r=n.hasState(ye)?A:O;n.emit(r)},0)})},{threshold:Ht});a.observe(t),n.on(I,()=>a.disconnect()),yt(n,A,function(){!o.should_resume||!e.autopause||Wt()||n.opts.autoplay&&!n.readyState||n.togglePlay(!0)}),yt(n,O,function(){if(!e.autopause||Wt())return;const t=!n.paused;o.locked=!0,n.pause(),setTimeout(function(){o.should_resume=t,o.locked=!1},0)})}(r,a,f),function(e,t){if(!window.ResizeObserver)return;const n=new ResizeObserver(e=>{const n=e[e.length-1];t.emit(l,n)});n.observe(e),t.on(I,()=>n.disconnect())}(a,f),function(e,t,n){const o=!!e.ratio,r=document.createElement("div");r.classList.add("fp-ratio"),t.append(r);let i=Vt(e.ratio||xt);r.style.paddingTop=100*i+"%";const a=[p,u];n.on(a,function(){if(o)return;const e=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth;e&&n.setOpts({ratio:e})}),n.on(W,function(){const t=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth,o=Vt((null==e?void 0:e.ratio)||t||xt);i!==o&&(i=o,r.style.paddingTop=100*o+"%")})}(r,a,f),function(e){const t=t=>{t.detail!==e&&!1===e.opt("multiplay")&&e.togglePlay(!1)};e.on(I,()=>document.removeEventListener(Kt,t)),document.addEventListener(Kt,t)}(f),Bt(a,f),Jt(f,r),(h=f).on(i,Pt(e=>{const t=e instanceof MediaError?e:h.error;t&&h.emit(B,{error:vn(t,{resource:h.original_src})})})),f.plugins.forEach(e=>{try{e.init(r,a,f)}catch(t){console.log("Error(plugin/%s)",e.constructor.name,t)}}),f.setOpts(r),f.opts=r,r.src&&f.setSrc(r.src);const y=f.readyState;return y>0&&f.currentSrc&&f.emit(u),y>2&&f.currentSrc&&f.emit(v),f.emit(o),f.on(H,function(e){kt({root:a,video:f,data:e.data||{}})}),setTimeout(ht,0,document,"flowplayer:player:created",f),f}return Object.assign(Nn,Sn),function(o){Array.isArray(o.extensions)&&o.extensions.forEach(t=>e.push(t)),o.customElements=Ae,o.defaultElements=q,o.version="3.32.2-rc",o.commit="aeb5daf69505b89f82c9b0bf9131465e3daf4c92",o.instances=t,o.extensions=e,o.support=n,o.events=G,o.states=we,o.errors=ke,o.jwt=be,o.autoplay=Ie,o.quality=Te}(Nn),"object"==typeof document&&setTimeout(ht,0,document,"flowplayer:umd",Nn),Nn.extensions.unshift.apply(Nn.extensions,[Health]),Nn});
|