@mux/mux-player-react 2.0.1 → 2.1.0

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/README.md CHANGED
@@ -5,6 +5,10 @@
5
5
  <a href="https://www.npmjs.com/package/@mux/mux-player-react"><img src="https://img.shields.io/npm/l/@mux/mux-player-react.svg?sanitize=true" alt="License"></a>
6
6
  </p>
7
7
 
8
+ # New release: 2.0
9
+
10
+ Mux Player has recently released 2.0. See the [[https://github.com/muxinc/elements/blob/packages/mux-player/UPGRADING_V1_to_V2.md](https://github.com/muxinc/elements/blob/main/packages/mux-player/UPGRADING_V1_to_V2.md) and the [blog post announcement](https://www.mux.com/blog/mux-player-2-0-for-web-and-coming-soon-for-ios-and-android).
11
+
8
12
  # Introduction
9
13
 
10
14
  `<MuxPlayer />` is a Mux-flavored React video player component, built on top of our [mux-player web component](../mux-player) and [Media Chrome](https://media-chrome.org).
@@ -0,0 +1,2 @@
1
+ import y,{useEffect as ie}from"react";import{MaxResolution as be,MinResolution as xe,RenditionOrder as Te}from"@mux/playback-core";import{MediaError as he}from"@mux/mux-player";var p={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},_=e=>e==null,q=(e,n)=>_(n)?!1:e in n,J=e=>e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Y=(e,n)=>{if(!(typeof n=="boolean"&&!n)){if(q(e,p))return p[e];if(typeof n!=null)return/[A-Z]/.test(e)?J(e):e}};var $=(e,n)=>typeof e=="boolean"?"":e,c=(e={})=>Object.entries(e).reduce((n,[t,o])=>{let a=Y(t,o);if(!a)return n;let i=$(o,t);return n[a]=i,n},{});import{useRef as se}from"react";import{useEffect as Q,useRef as X}from"react";var m=(...e)=>{let n=X(null);return Q(()=>{e.forEach(t=>{!t||(typeof t=="function"?t(n.current):t.current=n.current)})},[e]),n};import{useEffect as B}from"react";var ee=Object.prototype.hasOwnProperty,ne=(e,n)=>{if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.some((a,i)=>n[i]===a);let t=Object.keys(e),o=Object.keys(n);if(t.length!==o.length)return!1;for(let a=0;a<t.length;a++)if(!ee.call(n,t[a])||!Object.is(e[t[a]],n[t[a]]))return!1;return!0},d=(e,n,t)=>!ne(n,e[t]),te=(e,n,t)=>{e[t]=n},re=(e,n,t,o=te,a=d)=>B(()=>{let i=t==null?void 0:t.current;!i||!a(i,n,e)||o(i,n,e)},[t==null?void 0:t.current,n]),l=re;var ae=()=>{try{return"2.1.0"}catch{}return"UNKNOWN"},oe=ae(),E=()=>oe;var le=y.forwardRef(({children:e,...n},t)=>y.createElement("mux-player",c({...n,ref:t}),e)),r=(e,n,t)=>ie(()=>{let o=n==null?void 0:n.current;if(!(!o||!t))return o.addEventListener(e,t),()=>{o.removeEventListener(e,t)}},[n==null?void 0:n.current,t]),ue=(e,n)=>{let{onAbort:t,onCanPlay:o,onCanPlayThrough:a,onEmptied:i,onLoadStart:g,onLoadedData:M,onLoadedMetadata:f,onProgress:P,onDurationChange:v,onVolumeChange:b,onRateChange:x,onResize:T,onWaiting:R,onPlay:h,onPlaying:k,onTimeUpdate:C,onPause:L,onSeeking:O,onSeeked:S,onStalled:G,onSuspend:w,onEnded:V,onError:A,onCuePointChange:N,onCuePointsChange:I,metadata:K,tokens:D,paused:U,playbackId:H,playbackRates:j,currentTime:z,themeProps:F,...W}=n;return l("playbackRates",j,e),l("metadata",K,e),l("themeProps",F,e),l("tokens",D,e),l("playbackId",H,e),l("paused",U,e,(s,u)=>{u!=null&&(u?s.pause():s.play())},(s,u,Z)=>s.hasAttribute("autoplay")&&!s.hasPlayed?!1:d(s,u,Z)),l("currentTime",z,e,(s,u)=>{u!=null&&(s.currentTime=u)}),r("abort",e,t),r("canplay",e,o),r("canplaythrough",e,a),r("emptied",e,i),r("loadstart",e,g),r("loadeddata",e,M),r("loadedmetadata",e,f),r("progress",e,P),r("durationchange",e,v),r("volumechange",e,b),r("ratechange",e,x),r("resize",e,T),r("waiting",e,R),r("play",e,h),r("playing",e,k),r("timeupdate",e,C),r("pause",e,L),r("seeking",e,O),r("seeked",e,S),r("stalled",e,G),r("suspend",e,w),r("ended",e,V),r("error",e,A),r("cuepointchange",e,N),r("cuepointschange",e,I),[W]},ye=E(),de="mux-player-react",pe=y.forwardRef((e,n)=>{let t=se(null),o=m(t,n),[a]=ue(t,e);return y.createElement(le,{ref:o,playerSoftwareName:de,playerSoftwareVersion:ye,...a})}),Ge=pe;export{be as MaxResolution,he as MediaError,xe as MinResolution,Te as RenditionOrder,Ge as default};
2
+ //# sourceMappingURL=-FXSRSRTV.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.tsx", "../src/common/utils.ts", "../src/useCombinedRefs.ts", "../src/useObjectPropEffect.ts", "../src/env.ts"],
4
+ "sourcesContent": ["import React, { useEffect } from 'react';\nimport type { CSSProperties } from 'react';\nimport type {\n StreamTypes,\n PlaybackTypes,\n CmcdTypes,\n MaxResolutionValue,\n MinResolutionValue,\n RenditionOrderValue,\n} from '@mux/playback-core';\nimport { MaxResolution, MinResolution, RenditionOrder } from '@mux/playback-core';\nimport { MediaError } from '@mux/mux-player';\nimport type MuxPlayerElement from '@mux/mux-player';\nimport type { Tokens, MuxPlayerElementEventMap } from '@mux/mux-player';\nimport { toNativeProps } from './common/utils';\nimport { useRef } from 'react';\nimport { useCombinedRefs } from './useCombinedRefs';\nimport useObjectPropEffect, { defaultHasChanged } from './useObjectPropEffect';\nimport { getPlayerVersion } from './env';\n\nexport { MediaError, MaxResolution, MinResolution, RenditionOrder };\n\ntype ValueOf<T> = T[keyof T];\ninterface GenericEventListener<T extends Event = CustomEvent> {\n (evt: T): void;\n}\n\nexport type MuxPlayerRefAttributes = MuxPlayerElement;\ntype VideoApiAttributes = {\n currentTime: number;\n volume: number;\n paused: boolean;\n src: string | null;\n poster: string;\n playbackRate: number;\n playsInline: boolean;\n preload: string;\n crossOrigin: string;\n autoPlay: boolean | string;\n loop: boolean;\n muted: boolean;\n style: CSSProperties;\n};\n\ntype MuxMediaPropTypes = {\n audio: boolean;\n // envKey: Options[\"data\"][\"env_key\"];\n envKey: string;\n // debug: Options[\"debug\"] & Hls[\"config\"][\"debug\"];\n debug: boolean;\n disableCookies: boolean;\n // metadata: Partial<Options[\"data\"]>;\n metadata: { [k: string]: any };\n beaconCollectionDomain: string;\n customDomain: string;\n playbackId: string;\n preferPlayback: ValueOf<PlaybackTypes> | undefined;\n // NOTE: Explicitly adding deprecated values here for now to avoid fully breaking changes in TS envs (CJP)\n streamType: ValueOf<StreamTypes> | 'll-live' | 'live:dvr' | 'll-live:dvr';\n defaultStreamType: ValueOf<StreamTypes>;\n targetLiveWindow: number;\n startTime: number;\n storyboardSrc: string;\n preferCmcd: ValueOf<CmcdTypes> | undefined;\n children?: React.ReactNode;\n};\n\nexport type MuxPlayerProps = {\n className?: string;\n hotkeys?: string;\n nohotkeys?: boolean;\n defaultHiddenCaptions?: boolean;\n playerSoftwareVersion?: string;\n playerSoftwareName?: string;\n forwardSeekOffset?: number;\n backwardSeekOffset?: number;\n maxResolution?: MaxResolutionValue;\n minResolution?: MinResolutionValue;\n renditionOrder?: RenditionOrderValue;\n metadataVideoId?: string;\n metadataVideoTitle?: string;\n metadataViewerUserId?: string;\n primaryColor?: string;\n secondaryColor?: string;\n accentColor?: string;\n placeholder?: string;\n playbackRates?: number[];\n defaultShowRemainingTime?: boolean;\n noVolumePref?: boolean;\n thumbnailTime?: number;\n title?: string;\n tokens?: Tokens;\n theme?: string;\n themeProps?: { [k: string]: any };\n onAbort?: GenericEventListener<MuxPlayerElementEventMap['abort']>;\n onCanPlay?: GenericEventListener<MuxPlayerElementEventMap['canplay']>;\n onCanPlayThrough?: GenericEventListener<MuxPlayerElementEventMap['canplaythrough']>;\n onEmptied?: GenericEventListener<MuxPlayerElementEventMap['emptied']>;\n onLoadStart?: GenericEventListener<MuxPlayerElementEventMap['loadstart']>;\n onLoadedData?: GenericEventListener<MuxPlayerElementEventMap['loadeddata']>;\n onLoadedMetadata?: GenericEventListener<MuxPlayerElementEventMap['loadedmetadata']>;\n onProgress?: GenericEventListener<MuxPlayerElementEventMap['progress']>;\n onDurationChange?: GenericEventListener<MuxPlayerElementEventMap['durationchange']>;\n onVolumeChange?: GenericEventListener<MuxPlayerElementEventMap['volumechange']>;\n onRateChange?: GenericEventListener<MuxPlayerElementEventMap['ratechange']>;\n onResize?: GenericEventListener<MuxPlayerElementEventMap['resize']>;\n onWaiting?: GenericEventListener<MuxPlayerElementEventMap['waiting']>;\n onPlay?: GenericEventListener<MuxPlayerElementEventMap['play']>;\n onPlaying?: GenericEventListener<MuxPlayerElementEventMap['playing']>;\n onTimeUpdate?: GenericEventListener<MuxPlayerElementEventMap['timeupdate']>;\n onPause?: GenericEventListener<MuxPlayerElementEventMap['pause']>;\n onSeeking?: GenericEventListener<MuxPlayerElementEventMap['seeking']>;\n onSeeked?: GenericEventListener<MuxPlayerElementEventMap['seeked']>;\n onStalled?: GenericEventListener<MuxPlayerElementEventMap['stalled']>;\n onSuspend?: GenericEventListener<MuxPlayerElementEventMap['suspend']>;\n onEnded?: GenericEventListener<MuxPlayerElementEventMap['ended']>;\n onError?: GenericEventListener<MuxPlayerElementEventMap['error']>;\n onCuePointChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointchange']>;\n onCuePointsChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointschange']>;\n // onPlayerReady?: EventListener;\n} & Partial<MuxMediaPropTypes> &\n Partial<VideoApiAttributes>;\n\nconst MuxPlayerInternal = React.forwardRef<MuxPlayerRefAttributes, MuxPlayerProps>(({ children, ...props }, ref) => {\n return React.createElement('mux-player', toNativeProps({ ...props, ref }), children);\n});\n\nconst useEventCallbackEffect = <K extends keyof MuxPlayerElementEventMap>(\n type: K,\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n callback: GenericEventListener<MuxPlayerElementEventMap[K]> | undefined\n) => {\n return useEffect(() => {\n const eventTarget = ref?.current;\n if (!eventTarget || !callback) return;\n eventTarget.addEventListener(type, callback);\n return () => {\n eventTarget.removeEventListener(type, callback);\n };\n }, [ref?.current, callback]);\n};\n\nconst usePlayer = (\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n props: MuxPlayerProps\n) => {\n const {\n onAbort,\n onCanPlay,\n onCanPlayThrough,\n onEmptied,\n onLoadStart,\n onLoadedData,\n onLoadedMetadata,\n onProgress,\n onDurationChange,\n onVolumeChange,\n onRateChange,\n onResize,\n onWaiting,\n onPlay,\n onPlaying,\n onTimeUpdate,\n onPause,\n onSeeking,\n onSeeked,\n onStalled,\n onSuspend,\n onEnded,\n onError,\n onCuePointChange,\n onCuePointsChange,\n // onPlayerReady,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n currentTime,\n themeProps,\n ...remainingProps\n } = props;\n useObjectPropEffect('playbackRates', playbackRates, ref);\n useObjectPropEffect('metadata', metadata, ref);\n useObjectPropEffect('themeProps', themeProps, ref);\n useObjectPropEffect('tokens', tokens, ref);\n useObjectPropEffect('playbackId', playbackId, ref);\n useObjectPropEffect(\n 'paused',\n paused,\n ref,\n (playerEl: HTMLMediaElement, pausedVal?: boolean) => {\n if (pausedVal == null) return;\n if (pausedVal) {\n playerEl.pause();\n } else {\n playerEl.play();\n }\n },\n (playerEl, value, propName) => {\n if (playerEl.hasAttribute('autoplay') && !playerEl.hasPlayed) {\n return false;\n }\n return defaultHasChanged(playerEl, value, propName);\n }\n );\n useObjectPropEffect('currentTime', currentTime, ref, (playerEl: HTMLMediaElement, currentTimeVal?: number) => {\n if (currentTimeVal == null) return;\n playerEl.currentTime = currentTimeVal;\n });\n useEventCallbackEffect('abort', ref, onAbort);\n useEventCallbackEffect('canplay', ref, onCanPlay);\n useEventCallbackEffect('canplaythrough', ref, onCanPlayThrough);\n useEventCallbackEffect('emptied', ref, onEmptied);\n useEventCallbackEffect('loadstart', ref, onLoadStart);\n useEventCallbackEffect('loadeddata', ref, onLoadedData);\n useEventCallbackEffect('loadedmetadata', ref, onLoadedMetadata);\n useEventCallbackEffect('progress', ref, onProgress);\n useEventCallbackEffect('durationchange', ref, onDurationChange);\n useEventCallbackEffect('volumechange', ref, onVolumeChange);\n useEventCallbackEffect('ratechange', ref, onRateChange);\n useEventCallbackEffect('resize', ref, onResize);\n useEventCallbackEffect('waiting', ref, onWaiting);\n useEventCallbackEffect('play', ref, onPlay);\n useEventCallbackEffect('playing', ref, onPlaying);\n useEventCallbackEffect('timeupdate', ref, onTimeUpdate);\n useEventCallbackEffect('pause', ref, onPause);\n useEventCallbackEffect('seeking', ref, onSeeking);\n useEventCallbackEffect('seeked', ref, onSeeked);\n useEventCallbackEffect('stalled', ref, onStalled);\n useEventCallbackEffect('suspend', ref, onSuspend);\n useEventCallbackEffect('ended', ref, onEnded);\n useEventCallbackEffect('error', ref, onError);\n useEventCallbackEffect('cuepointchange', ref, onCuePointChange);\n useEventCallbackEffect('cuepointschange', ref, onCuePointsChange);\n // useEventCallbackEffect('playerready', ref, onPlayerReady);\n return [remainingProps];\n};\n\nconst playerSoftwareVersion = getPlayerVersion();\nconst playerSoftwareName = 'mux-player-react';\n\nconst MuxPlayer = React.forwardRef<\n MuxPlayerRefAttributes,\n Omit<MuxPlayerProps, 'playerSoftwareVersion' | 'playerSoftwareName'>\n>((props, ref) => {\n const innerPlayerRef = useRef<MuxPlayerElement>(null);\n const playerRef = useCombinedRefs(innerPlayerRef, ref);\n const [remainingProps] = usePlayer(innerPlayerRef, props);\n\n return (\n <MuxPlayerInternal\n /** @TODO Fix types relationships (CJP) */\n ref={playerRef as typeof innerPlayerRef}\n playerSoftwareName={playerSoftwareName}\n playerSoftwareVersion={playerSoftwareVersion}\n {...remainingProps}\n />\n );\n});\n\nexport default MuxPlayer;\n", "// NOTE: As a forward-looking implementation, we may want to assume\n// prop names -> attribute names is always a simple name.toLowerCase()\n// and provide a mechanism for passing in per-component overrides for\n// e.g. kebab cases, as that's the way React/Preact handles these. (CJP)\nconst ReactPropToAttrNameMap = {\n className: 'class',\n classname: 'class',\n htmlFor: 'for',\n crossOrigin: 'crossorigin',\n viewBox: 'viewBox',\n playsInline: 'playsinline',\n autoPlay: 'autoplay',\n playbackRate: 'playbackrate',\n};\n\ntype KeyTypes = string | number | symbol;\ntype Maybe<T> = T | null | undefined;\n\nexport const isNil = (x: unknown): x is null | undefined => x == undefined;\n\n// Type Guard to determine if a given key is actually a key of some object of type T\nexport const isKeyOf = <T extends {} = any>(k: KeyTypes, o: Maybe<T>): k is keyof T => {\n if (isNil(o)) return false;\n return k in o;\n};\n\nconst toKebabCase = (string: string) => string.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);\n\nexport const toNativeAttrName = (propName: string, propValue: any): string | undefined => {\n if (typeof propValue === 'boolean' && !propValue) return undefined;\n if (isKeyOf(propName, ReactPropToAttrNameMap)) return ReactPropToAttrNameMap[propName];\n if (typeof propValue == undefined) return undefined;\n if (/[A-Z]/.test(propName)) return toKebabCase(propName);\n return propName;\n};\nexport const toStyleAttr = <T>(x: T) => x;\n\nexport const toNativeAttrValue = (propValue: any, propName: string) => {\n if (typeof propValue === 'boolean') return '';\n return propValue;\n};\n\nexport const toNativeProps = (props = {}) => {\n return Object.entries(props).reduce<{ [k: string]: string }>((transformedProps, [propName, propValue]) => {\n const attrName = toNativeAttrName(propName, propValue);\n\n // prop was stripped. Don't add.\n if (!attrName) {\n return transformedProps;\n }\n\n const attrValue = toNativeAttrValue(propValue, propName);\n transformedProps[attrName] = attrValue;\n return transformedProps;\n }, {});\n};\n", "import { useEffect, useRef } from 'react';\nimport type { MutableRefObject, ForwardedRef } from 'react';\n\ntype Maybe<T> = T | null | undefined;\ntype RefCb<T> = (instance: Maybe<T>) => void;\ntype RefObj<T> = MutableRefObject<Maybe<T>>;\ntype RefTypes<T> = RefObj<T> | RefCb<T> | ForwardedRef<T>;\ninterface useCombinedRefs {\n <T>(...refs: Maybe<RefTypes<T>>[]): RefObj<T>;\n}\n\nexport const useCombinedRefs: useCombinedRefs = (...refs) => {\n const targetRef = useRef(null);\n\n useEffect(() => {\n refs.forEach((ref) => {\n if (!ref) return;\n\n if (typeof ref === 'function') {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n });\n }, [refs]);\n\n return targetRef;\n};\n\n// TS assumed default export was interface def instead of function value (CJP)\nconst defaultUseCombinedRefs = useCombinedRefs;\nexport default defaultUseCombinedRefs;\n", "import { useEffect } from 'react';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Slightly modified version of React's shallowEqual, with optimizations for Arrays\n * so we may treat them specifically as unequal if they are not a) both arrays\n * or b) don't contain the same (shallowly compared) elements.\n */\nconst shallowEqual = (objA: any, objB: any): boolean => {\n if (Object.is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n if (Array.isArray(objA)) {\n // Early \"cheap\" array compares\n if (!Array.isArray(objB) || objA.length !== objB.length) return false;\n // Shallow compare for arrays\n return objA.some((vVal, i) => objB[i] === vVal);\n }\n\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (let i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const defaultHasChanged = (obj: any, v: any, k: string) => {\n return !shallowEqual(v, obj[k]);\n};\n\nconst defaultUpdateValue = (obj: any, v: any, k: string) => {\n obj[k] = v;\n};\n\nexport const useObjectPropEffect = <T extends { [k: string]: any }, V>(\n propName: string,\n propValue: V | null | undefined,\n ref: React.MutableRefObject<T | null> | null | undefined,\n updateValue = defaultUpdateValue,\n hasChanged = defaultHasChanged\n) => {\n return useEffect(() => {\n const obj = ref?.current;\n if (!obj) return;\n if (!hasChanged(obj, propValue, propName)) return;\n updateValue(obj, propValue, propName);\n }, [ref?.current, propValue]);\n};\n\nexport default useObjectPropEffect;\n", "const getEnvPlayerVersion = () => {\n try {\n // @ts-ignore\n return PLAYER_VERSION as string;\n } catch {}\n return 'UNKNOWN';\n};\n\nconst player_version: string = getEnvPlayerVersion();\n\nexport const getPlayerVersion = () => player_version;\n"],
5
+ "mappings": "AAAA,OAAOA,GAAS,aAAAC,OAAiB,QAUjC,OAAS,iBAAAC,GAAe,iBAAAC,GAAe,kBAAAC,OAAsB,qBAC7D,OAAS,cAAAC,OAAkB,kBCP3B,IAAMC,EAAyB,CAC7B,UAAW,QACX,UAAW,QACX,QAAS,MACT,YAAa,cACb,QAAS,UACT,YAAa,cACb,SAAU,WACV,aAAc,cAChB,EAKaC,EAASC,GAAsCA,GAAK,KAGpDC,EAAU,CAAqBC,EAAaC,IACnDJ,EAAMI,CAAC,EAAU,GACdD,KAAKC,EAGRC,EAAeC,GAAmBA,EAAO,QAAQ,SAAWC,GAAU,IAAIA,EAAM,YAAY,GAAG,EAExFC,EAAmB,CAACC,EAAkBC,IAAuC,CACxF,GAAI,SAAOA,GAAc,WAAa,CAACA,GACvC,IAAIR,EAAQO,EAAUV,CAAsB,EAAG,OAAOA,EAAuBU,GAC7E,GAAI,OAAOC,GAAa,KACxB,MAAI,QAAQ,KAAKD,CAAQ,EAAUJ,EAAYI,CAAQ,EAChDA,EACT,EAGO,IAAME,EAAoB,CAACC,EAAgBC,IAC5C,OAAOD,GAAc,UAAkB,GACpCA,EAGIE,EAAgB,CAACC,EAAQ,CAAC,IAC9B,OAAO,QAAQA,CAAK,EAAE,OAAgC,CAACC,EAAkB,CAACH,EAAUD,CAAS,IAAM,CACxG,IAAMK,EAAWC,EAAiBL,EAAUD,CAAS,EAGrD,G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AKsB,CAAS,EAChDpB,EAAuB,aAAcF,EAAKuB,CAAY,EACtDrB,EAAuB,QAASF,EAAKwB,CAAO,EAC5CtB,EAAuB,UAAWF,EAAKyB,CAAS,EAChDvB,EAAuB,SAAUF,EAAK0B,CAAQ,EAC9CxB,EAAuB,UAAWF,EAAK2B,CAAS,EAChDzB,EAAuB,UAAWF,EAAK4B,CAAS,EAChD1B,EAAuB,QAASF,EAAK6B,CAAO,EAC5C3B,EAAuB,QAASF,EAAK8B,CAAO,EAC5C5B,EAAuB,iBAAkBF,EAAK+B,CAAgB,EAC9D7B,EAAuB,kBAAmBF,EAAKgC,CAAiB,EAEzD,CAACQ,CAAc,CACxB,EAEMQ,GAAwBC,EAAiB,EACzCC,GAAqB,mBAErBC,GAAYtD,EAAM,WAGtB,CAACE,EAAOC,IAAQ,CAChB,IAAMoD,EAAiBC,GAAyB,IAAI,EAC9CC,EAAYC,EAAgBH,EAAgBpD,CAAG,EAC/C,CAACwC,CAAc,EAAIjC,GAAU6C,EAAgBrD,CAAK,EAExD,OACEF,EAAA,cAACD,GAAA,CAEC,IAAK0D,EACL,mBAAoBJ,GACpB,sBAAuBF,GACtB,GAAGR,EACN,CAEJ,CAAC,EAEMgB,GAAQL",
6
+ "names": ["React", "useEffect", "MaxResolution", "MinResolution", "RenditionOrder", "MediaError", "ReactPropToAttrNameMap", "isNil", "x", "isKeyOf", "k", "o", "toKebabCase", "string", "match", "toNativeAttrName", "propName", "propValue", "toNativeAttrValue", "propValue", "propName", "toNativeProps", "props", "transformedProps", "attrName", "toNativeAttrName", "attrValue", "useRef", "useEffect", "useRef", "useCombinedRefs", "refs", "targetRef", "ref", "useEffect", "hasOwnProperty", "shallowEqual", "objA", "objB", "vVal", "keysA", "keysB", "i", "defaultHasChanged", "obj", "v", "k", "defaultUpdateValue", "useObjectPropEffect", "propName", "propValue", "ref", "updateValue", "hasChanged", "useObjectPropEffect_default", "getEnvPlayerVersion", "player_version", "getPlayerVersion", "MuxPlayerInternal", "React", "children", "props", "ref", "toNativeProps", "useEventCallbackEffect", "type", "callback", "useEffect", "eventTarget", "usePlayer", "onAbort", "onCanPlay", "onCanPlayThrough", "onEmptied", "onLoadStart", "onLoadedData", "onLoadedMetadata", "onProgress", "onDurationChange", "onVolumeChange", "onRateChange", "onResize", "onWaiting", "onPlay", "onPlaying", "onTimeUpdate", "onPause", "onSeeking", "onSeeked", "onStalled", "onSuspend", "onEnded", "onError", "onCuePointChange", "onCuePointsChange", "metadata", "tokens", "paused", "playbackId", "playbackRates", "currentTime", "themeProps", "remainingProps", "useObjectPropEffect_default", "playerEl", "pausedVal", "value", "propName", "defaultHasChanged", "currentTimeVal", "playerSoftwareVersion", "getPlayerVersion", "playerSoftwareName", "MuxPlayer", "innerPlayerRef", "useRef", "playerRef", "useCombinedRefs", "src_default"]
7
+ }
@@ -29,7 +29,7 @@
29
29
  "imports": []
30
30
  },
31
31
  "src/index.tsx": {
32
- "bytes": 9283,
32
+ "bytes": 9576,
33
33
  "imports": [
34
34
  {
35
35
  "path": "src/common/utils.ts",
@@ -81,7 +81,7 @@
81
81
  "dist/lazy.mjs": {
82
82
  "imports": [
83
83
  {
84
- "path": "dist/-OJ5ZWKIA.mjs",
84
+ "path": "dist/-FXSRSRTV.mjs",
85
85
  "kind": "dynamic-import"
86
86
  }
87
87
  ],
@@ -105,22 +105,25 @@
105
105
  },
106
106
  "bytes": 2304
107
107
  },
108
- "dist/-OJ5ZWKIA.mjs.map": {
108
+ "dist/-FXSRSRTV.mjs.map": {
109
109
  "imports": [],
110
110
  "exports": [],
111
111
  "inputs": {},
112
- "bytes": 21139
112
+ "bytes": 21543
113
113
  },
114
- "dist/-OJ5ZWKIA.mjs": {
114
+ "dist/-FXSRSRTV.mjs": {
115
115
  "imports": [],
116
116
  "exports": [
117
+ "MaxResolution",
117
118
  "MediaError",
119
+ "MinResolution",
120
+ "RenditionOrder",
118
121
  "default"
119
122
  ],
120
123
  "entryPoint": "src/index.tsx",
121
124
  "inputs": {
122
125
  "src/index.tsx": {
123
- "bytesInOutput": 1748
126
+ "bytesInOutput": 1841
124
127
  },
125
128
  "src/common/utils.ts": {
126
129
  "bytesInOutput": 522
@@ -135,7 +138,7 @@
135
138
  "bytesInOutput": 71
136
139
  }
137
140
  },
138
- "bytes": 3196
141
+ "bytes": 3350
139
142
  }
140
143
  }
141
144
  }
package/dist/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var X=Object.create;var p=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var re=(e,t)=>{for(var n in t)p(e,n,{get:t[n],enumerable:!0})},m=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of ee(t))!ne.call(e,a)&&a!==n&&p(e,a,{get:()=>t[a],enumerable:!(o=B(t,a))||o.enumerable});return e};var ae=(e,t,n)=>(n=e!=null?X(te(e)):{},m(t||!e||!e.__esModule?p(n,"default",{value:e,enumerable:!0}):n,e)),oe=e=>m(p({},"__esModule",{value:!0}),e);var Te={};re(Te,{MediaError:()=>v.MediaError,default:()=>xe});module.exports=oe(Te);var y=ae(require("react")),v=require("@mux/mux-player");var E={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},ie=e=>e==null,se=(e,t)=>ie(t)?!1:e in t,le=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),ue=(e,t)=>{if(!(typeof t=="boolean"&&!t)){if(se(e,E))return E[e];if(typeof t!=null)return/[A-Z]/.test(e)?le(e):e}};var ye=(e,t)=>typeof e=="boolean"?"":e,g=(e={})=>Object.entries(e).reduce((t,[n,o])=>{let a=ue(n,o);if(!a)return t;let i=ye(o,n);return t[a]=i,t},{});var b=require("react");var c=require("react"),f=(...e)=>{let t=(0,c.useRef)(null);return(0,c.useEffect)(()=>{e.forEach(n=>{!n||(typeof n=="function"?n(t.current):n.current=t.current)})},[e]),t};var M=require("react"),pe=Object.prototype.hasOwnProperty,ce=(e,t)=>{if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.some((a,i)=>t[i]===a);let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let a=0;a<n.length;a++)if(!pe.call(t,n[a])||!Object.is(e[n[a]],t[n[a]]))return!1;return!0},d=(e,t,n)=>!ce(t,e[n]),de=(e,t,n)=>{e[n]=t},me=(e,t,n,o=de,a=d)=>(0,M.useEffect)(()=>{let i=n==null?void 0:n.current;!i||!a(i,t,e)||o(i,t,e)},[n==null?void 0:n.current,t]),l=me;var Ee=()=>{try{return"2.0.1"}catch{}return"UNKNOWN"},ge=Ee(),P=()=>ge;var fe=y.default.forwardRef(({children:e,...t},n)=>y.default.createElement("mux-player",g({...t,ref:n}),e)),r=(e,t,n)=>(0,y.useEffect)(()=>{let o=t==null?void 0:t.current;if(!(!o||!n))return o.addEventListener(e,n),()=>{o.removeEventListener(e,n)}},[t==null?void 0:t.current,n]),Me=(e,t)=>{let{onAbort:n,onCanPlay:o,onCanPlayThrough:a,onEmptied:i,onLoadStart:x,onLoadedData:T,onLoadedMetadata:h,onProgress:R,onDurationChange:k,onVolumeChange:C,onRateChange:L,onResize:O,onWaiting:S,onPlay:G,onPlaying:w,onTimeUpdate:V,onPause:A,onSeeking:N,onSeeked:I,onStalled:K,onSuspend:D,onEnded:U,onError:H,onCuePointChange:j,onCuePointsChange:z,metadata:F,tokens:W,paused:Z,playbackId:_,playbackRates:q,currentTime:J,themeProps:Y,...$}=t;return l("playbackRates",q,e),l("metadata",F,e),l("themeProps",Y,e),l("tokens",W,e),l("playbackId",_,e),l("paused",Z,e,(s,u)=>{u!=null&&(u?s.pause():s.play())},(s,u,Q)=>s.hasAttribute("autoplay")&&!s.hasPlayed?!1:d(s,u,Q)),l("currentTime",J,e,(s,u)=>{u!=null&&(s.currentTime=u)}),r("abort",e,n),r("canplay",e,o),r("canplaythrough",e,a),r("emptied",e,i),r("loadstart",e,x),r("loadeddata",e,T),r("loadedmetadata",e,h),r("progress",e,R),r("durationchange",e,k),r("volumechange",e,C),r("ratechange",e,L),r("resize",e,O),r("waiting",e,S),r("play",e,G),r("playing",e,w),r("timeupdate",e,V),r("pause",e,A),r("seeking",e,N),r("seeked",e,I),r("stalled",e,K),r("suspend",e,D),r("ended",e,U),r("error",e,H),r("cuepointchange",e,j),r("cuepointschange",e,z),[$]},Pe=P(),ve="mux-player-react",be=y.default.forwardRef((e,t)=>{let n=(0,b.useRef)(null),o=f(n,t),[a]=Me(n,e);return y.default.createElement(fe,{ref:o,playerSoftwareName:ve,playerSoftwareVersion:Pe,...a})}),xe=be;
1
+ "use strict";var B=Object.create;var p=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var ae=(e,n)=>{for(var t in n)p(e,t,{get:n[t],enumerable:!0})},E=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of ne(n))!re.call(e,a)&&a!==t&&p(e,a,{get:()=>n[a],enumerable:!(o=ee(n,a))||o.enumerable});return e};var oe=(e,n,t)=>(t=e!=null?B(te(e)):{},E(n||!e||!e.__esModule?p(t,"default",{value:e,enumerable:!0}):t,e)),ie=e=>E(p({},"__esModule",{value:!0}),e);var Re={};ae(Re,{MaxResolution:()=>d.MaxResolution,MediaError:()=>b.MediaError,MinResolution:()=>d.MinResolution,RenditionOrder:()=>d.RenditionOrder,default:()=>Te});module.exports=ie(Re);var y=oe(require("react")),d=require("@mux/playback-core"),b=require("@mux/mux-player");var g={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},se=e=>e==null,le=(e,n)=>se(n)?!1:e in n,ue=e=>e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),ye=(e,n)=>{if(!(typeof n=="boolean"&&!n)){if(le(e,g))return g[e];if(typeof n!=null)return/[A-Z]/.test(e)?ue(e):e}};var de=(e,n)=>typeof e=="boolean"?"":e,M=(e={})=>Object.entries(e).reduce((n,[t,o])=>{let a=ye(t,o);if(!a)return n;let i=de(o,t);return n[a]=i,n},{});var x=require("react");var c=require("react"),f=(...e)=>{let n=(0,c.useRef)(null);return(0,c.useEffect)(()=>{e.forEach(t=>{!t||(typeof t=="function"?t(n.current):t.current=n.current)})},[e]),n};var P=require("react"),pe=Object.prototype.hasOwnProperty,ce=(e,n)=>{if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.some((a,i)=>n[i]===a);let t=Object.keys(e),o=Object.keys(n);if(t.length!==o.length)return!1;for(let a=0;a<t.length;a++)if(!pe.call(n,t[a])||!Object.is(e[t[a]],n[t[a]]))return!1;return!0},m=(e,n,t)=>!ce(n,e[t]),me=(e,n,t)=>{e[t]=n},Ee=(e,n,t,o=me,a=m)=>(0,P.useEffect)(()=>{let i=t==null?void 0:t.current;!i||!a(i,n,e)||o(i,n,e)},[t==null?void 0:t.current,n]),l=Ee;var ge=()=>{try{return"2.1.0"}catch{}return"UNKNOWN"},Me=ge(),v=()=>Me;var fe=y.default.forwardRef(({children:e,...n},t)=>y.default.createElement("mux-player",M({...n,ref:t}),e)),r=(e,n,t)=>(0,y.useEffect)(()=>{let o=n==null?void 0:n.current;if(!(!o||!t))return o.addEventListener(e,t),()=>{o.removeEventListener(e,t)}},[n==null?void 0:n.current,t]),Pe=(e,n)=>{let{onAbort:t,onCanPlay:o,onCanPlayThrough:a,onEmptied:i,onLoadStart:T,onLoadedData:R,onLoadedMetadata:h,onProgress:k,onDurationChange:C,onVolumeChange:L,onRateChange:O,onResize:S,onWaiting:G,onPlay:w,onPlaying:V,onTimeUpdate:A,onPause:N,onSeeking:I,onSeeked:K,onStalled:D,onSuspend:U,onEnded:H,onError:j,onCuePointChange:z,onCuePointsChange:F,metadata:W,tokens:Z,paused:_,playbackId:q,playbackRates:J,currentTime:Y,themeProps:$,...Q}=n;return l("playbackRates",J,e),l("metadata",W,e),l("themeProps",$,e),l("tokens",Z,e),l("playbackId",q,e),l("paused",_,e,(s,u)=>{u!=null&&(u?s.pause():s.play())},(s,u,X)=>s.hasAttribute("autoplay")&&!s.hasPlayed?!1:m(s,u,X)),l("currentTime",Y,e,(s,u)=>{u!=null&&(s.currentTime=u)}),r("abort",e,t),r("canplay",e,o),r("canplaythrough",e,a),r("emptied",e,i),r("loadstart",e,T),r("loadeddata",e,R),r("loadedmetadata",e,h),r("progress",e,k),r("durationchange",e,C),r("volumechange",e,L),r("ratechange",e,O),r("resize",e,S),r("waiting",e,G),r("play",e,w),r("playing",e,V),r("timeupdate",e,A),r("pause",e,N),r("seeking",e,I),r("seeked",e,K),r("stalled",e,D),r("suspend",e,U),r("ended",e,H),r("error",e,j),r("cuepointchange",e,z),r("cuepointschange",e,F),[Q]},ve=v(),be="mux-player-react",xe=y.default.forwardRef((e,n)=>{let t=(0,x.useRef)(null),o=f(t,n),[a]=Pe(t,e);return y.default.createElement(fe,{ref:o,playerSoftwareName:be,playerSoftwareVersion:ve,...a})}),Te=xe;
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.tsx", "../src/common/utils.ts", "../src/useCombinedRefs.ts", "../src/useObjectPropEffect.ts", "../src/env.ts"],
4
- "sourcesContent": ["import React, { useEffect } from 'react';\nimport type { CSSProperties } from 'react';\nimport type { StreamTypes, PlaybackTypes, CmcdTypes } from '@mux/playback-core';\nimport { MediaError } from '@mux/mux-player';\nimport type MuxPlayerElement from '@mux/mux-player';\nimport type { Tokens, MuxPlayerElementEventMap } from '@mux/mux-player';\nimport { toNativeProps } from './common/utils';\nimport { useRef } from 'react';\nimport { useCombinedRefs } from './useCombinedRefs';\nimport useObjectPropEffect, { defaultHasChanged } from './useObjectPropEffect';\nimport { getPlayerVersion } from './env';\n\nexport { MediaError };\n\ntype ValueOf<T> = T[keyof T];\ninterface GenericEventListener<T extends Event = CustomEvent> {\n (evt: T): void;\n}\n\nexport type MuxPlayerRefAttributes = MuxPlayerElement;\ntype VideoApiAttributes = {\n currentTime: number;\n volume: number;\n paused: boolean;\n src: string | null;\n poster: string;\n playbackRate: number;\n playsInline: boolean;\n preload: string;\n crossOrigin: string;\n autoPlay: boolean | string;\n loop: boolean;\n muted: boolean;\n style: CSSProperties;\n};\n\ntype MuxMediaPropTypes = {\n audio: boolean;\n // envKey: Options[\"data\"][\"env_key\"];\n envKey: string;\n // debug: Options[\"debug\"] & Hls[\"config\"][\"debug\"];\n debug: boolean;\n disableCookies: boolean;\n // metadata: Partial<Options[\"data\"]>;\n metadata: { [k: string]: any };\n beaconCollectionDomain: string;\n customDomain: string;\n playbackId: string;\n preferPlayback: ValueOf<PlaybackTypes> | undefined;\n // NOTE: Explicitly adding deprecated values here for now to avoid fully breaking changes in TS envs (CJP)\n streamType: ValueOf<StreamTypes> | 'll-live' | 'live:dvr' | 'll-live:dvr';\n defaultStreamType: ValueOf<StreamTypes>;\n targetLiveWindow: number;\n startTime: number;\n storyboardSrc: string;\n preferCmcd: ValueOf<CmcdTypes> | undefined;\n children?: React.ReactNode;\n};\n\nexport type MuxPlayerProps = {\n className?: string;\n hotkeys?: string;\n nohotkeys?: boolean;\n defaultHiddenCaptions?: boolean;\n playerSoftwareVersion?: string;\n playerSoftwareName?: string;\n forwardSeekOffset?: number;\n backwardSeekOffset?: number;\n maxResolution?: string;\n metadataVideoId?: string;\n metadataVideoTitle?: string;\n metadataViewerUserId?: string;\n primaryColor?: string;\n secondaryColor?: string;\n accentColor?: string;\n placeholder?: string;\n playbackRates?: number[];\n defaultShowRemainingTime?: boolean;\n noVolumePref?: boolean;\n thumbnailTime?: number;\n title?: string;\n tokens?: Tokens;\n theme?: string;\n themeProps?: { [k: string]: any };\n onAbort?: GenericEventListener<MuxPlayerElementEventMap['abort']>;\n onCanPlay?: GenericEventListener<MuxPlayerElementEventMap['canplay']>;\n onCanPlayThrough?: GenericEventListener<MuxPlayerElementEventMap['canplaythrough']>;\n onEmptied?: GenericEventListener<MuxPlayerElementEventMap['emptied']>;\n onLoadStart?: GenericEventListener<MuxPlayerElementEventMap['loadstart']>;\n onLoadedData?: GenericEventListener<MuxPlayerElementEventMap['loadeddata']>;\n onLoadedMetadata?: GenericEventListener<MuxPlayerElementEventMap['loadedmetadata']>;\n onProgress?: GenericEventListener<MuxPlayerElementEventMap['progress']>;\n onDurationChange?: GenericEventListener<MuxPlayerElementEventMap['durationchange']>;\n onVolumeChange?: GenericEventListener<MuxPlayerElementEventMap['volumechange']>;\n onRateChange?: GenericEventListener<MuxPlayerElementEventMap['ratechange']>;\n onResize?: GenericEventListener<MuxPlayerElementEventMap['resize']>;\n onWaiting?: GenericEventListener<MuxPlayerElementEventMap['waiting']>;\n onPlay?: GenericEventListener<MuxPlayerElementEventMap['play']>;\n onPlaying?: GenericEventListener<MuxPlayerElementEventMap['playing']>;\n onTimeUpdate?: GenericEventListener<MuxPlayerElementEventMap['timeupdate']>;\n onPause?: GenericEventListener<MuxPlayerElementEventMap['pause']>;\n onSeeking?: GenericEventListener<MuxPlayerElementEventMap['seeking']>;\n onSeeked?: GenericEventListener<MuxPlayerElementEventMap['seeked']>;\n onStalled?: GenericEventListener<MuxPlayerElementEventMap['stalled']>;\n onSuspend?: GenericEventListener<MuxPlayerElementEventMap['suspend']>;\n onEnded?: GenericEventListener<MuxPlayerElementEventMap['ended']>;\n onError?: GenericEventListener<MuxPlayerElementEventMap['error']>;\n onCuePointChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointchange']>;\n onCuePointsChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointschange']>;\n // onPlayerReady?: EventListener;\n} & Partial<MuxMediaPropTypes> &\n Partial<VideoApiAttributes>;\n\nconst MuxPlayerInternal = React.forwardRef<MuxPlayerRefAttributes, MuxPlayerProps>(({ children, ...props }, ref) => {\n return React.createElement('mux-player', toNativeProps({ ...props, ref }), children);\n});\n\nconst useEventCallbackEffect = <K extends keyof MuxPlayerElementEventMap>(\n type: K,\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n callback: GenericEventListener<MuxPlayerElementEventMap[K]> | undefined\n) => {\n return useEffect(() => {\n const eventTarget = ref?.current;\n if (!eventTarget || !callback) return;\n eventTarget.addEventListener(type, callback);\n return () => {\n eventTarget.removeEventListener(type, callback);\n };\n }, [ref?.current, callback]);\n};\n\nconst usePlayer = (\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n props: MuxPlayerProps\n) => {\n const {\n onAbort,\n onCanPlay,\n onCanPlayThrough,\n onEmptied,\n onLoadStart,\n onLoadedData,\n onLoadedMetadata,\n onProgress,\n onDurationChange,\n onVolumeChange,\n onRateChange,\n onResize,\n onWaiting,\n onPlay,\n onPlaying,\n onTimeUpdate,\n onPause,\n onSeeking,\n onSeeked,\n onStalled,\n onSuspend,\n onEnded,\n onError,\n onCuePointChange,\n onCuePointsChange,\n // onPlayerReady,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n currentTime,\n themeProps,\n ...remainingProps\n } = props;\n useObjectPropEffect('playbackRates', playbackRates, ref);\n useObjectPropEffect('metadata', metadata, ref);\n useObjectPropEffect('themeProps', themeProps, ref);\n useObjectPropEffect('tokens', tokens, ref);\n useObjectPropEffect('playbackId', playbackId, ref);\n useObjectPropEffect(\n 'paused',\n paused,\n ref,\n (playerEl: HTMLMediaElement, pausedVal?: boolean) => {\n if (pausedVal == null) return;\n if (pausedVal) {\n playerEl.pause();\n } else {\n playerEl.play();\n }\n },\n (playerEl, value, propName) => {\n if (playerEl.hasAttribute('autoplay') && !playerEl.hasPlayed) {\n return false;\n }\n return defaultHasChanged(playerEl, value, propName);\n }\n );\n useObjectPropEffect('currentTime', currentTime, ref, (playerEl: HTMLMediaElement, currentTimeVal?: number) => {\n if (currentTimeVal == null) return;\n playerEl.currentTime = currentTimeVal;\n });\n useEventCallbackEffect('abort', ref, onAbort);\n useEventCallbackEffect('canplay', ref, onCanPlay);\n useEventCallbackEffect('canplaythrough', ref, onCanPlayThrough);\n useEventCallbackEffect('emptied', ref, onEmptied);\n useEventCallbackEffect('loadstart', ref, onLoadStart);\n useEventCallbackEffect('loadeddata', ref, onLoadedData);\n useEventCallbackEffect('loadedmetadata', ref, onLoadedMetadata);\n useEventCallbackEffect('progress', ref, onProgress);\n useEventCallbackEffect('durationchange', ref, onDurationChange);\n useEventCallbackEffect('volumechange', ref, onVolumeChange);\n useEventCallbackEffect('ratechange', ref, onRateChange);\n useEventCallbackEffect('resize', ref, onResize);\n useEventCallbackEffect('waiting', ref, onWaiting);\n useEventCallbackEffect('play', ref, onPlay);\n useEventCallbackEffect('playing', ref, onPlaying);\n useEventCallbackEffect('timeupdate', ref, onTimeUpdate);\n useEventCallbackEffect('pause', ref, onPause);\n useEventCallbackEffect('seeking', ref, onSeeking);\n useEventCallbackEffect('seeked', ref, onSeeked);\n useEventCallbackEffect('stalled', ref, onStalled);\n useEventCallbackEffect('suspend', ref, onSuspend);\n useEventCallbackEffect('ended', ref, onEnded);\n useEventCallbackEffect('error', ref, onError);\n useEventCallbackEffect('cuepointchange', ref, onCuePointChange);\n useEventCallbackEffect('cuepointschange', ref, onCuePointsChange);\n // useEventCallbackEffect('playerready', ref, onPlayerReady);\n return [remainingProps];\n};\n\nconst playerSoftwareVersion = getPlayerVersion();\nconst playerSoftwareName = 'mux-player-react';\n\nconst MuxPlayer = React.forwardRef<\n MuxPlayerRefAttributes,\n Omit<MuxPlayerProps, 'playerSoftwareVersion' | 'playerSoftwareName'>\n>((props, ref) => {\n const innerPlayerRef = useRef<MuxPlayerElement>(null);\n const playerRef = useCombinedRefs(innerPlayerRef, ref);\n const [remainingProps] = usePlayer(innerPlayerRef, props);\n\n return (\n <MuxPlayerInternal\n /** @TODO Fix types relationships (CJP) */\n ref={playerRef as typeof innerPlayerRef}\n playerSoftwareName={playerSoftwareName}\n playerSoftwareVersion={playerSoftwareVersion}\n {...remainingProps}\n />\n );\n});\n\nexport default MuxPlayer;\n", "// NOTE: As a forward-looking implementation, we may want to assume\n// prop names -> attribute names is always a simple name.toLowerCase()\n// and provide a mechanism for passing in per-component overrides for\n// e.g. kebab cases, as that's the way React/Preact handles these. (CJP)\nconst ReactPropToAttrNameMap = {\n className: 'class',\n classname: 'class',\n htmlFor: 'for',\n crossOrigin: 'crossorigin',\n viewBox: 'viewBox',\n playsInline: 'playsinline',\n autoPlay: 'autoplay',\n playbackRate: 'playbackrate',\n};\n\ntype KeyTypes = string | number | symbol;\ntype Maybe<T> = T | null | undefined;\n\nexport const isNil = (x: unknown): x is null | undefined => x == undefined;\n\n// Type Guard to determine if a given key is actually a key of some object of type T\nexport const isKeyOf = <T extends {} = any>(k: KeyTypes, o: Maybe<T>): k is keyof T => {\n if (isNil(o)) return false;\n return k in o;\n};\n\nconst toKebabCase = (string: string) => string.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);\n\nexport const toNativeAttrName = (propName: string, propValue: any): string | undefined => {\n if (typeof propValue === 'boolean' && !propValue) return undefined;\n if (isKeyOf(propName, ReactPropToAttrNameMap)) return ReactPropToAttrNameMap[propName];\n if (typeof propValue == undefined) return undefined;\n if (/[A-Z]/.test(propName)) return toKebabCase(propName);\n return propName;\n};\nexport const toStyleAttr = <T>(x: T) => x;\n\nexport const toNativeAttrValue = (propValue: any, propName: string) => {\n if (typeof propValue === 'boolean') return '';\n return propValue;\n};\n\nexport const toNativeProps = (props = {}) => {\n return Object.entries(props).reduce<{ [k: string]: string }>((transformedProps, [propName, propValue]) => {\n const attrName = toNativeAttrName(propName, propValue);\n\n // prop was stripped. Don't add.\n if (!attrName) {\n return transformedProps;\n }\n\n const attrValue = toNativeAttrValue(propValue, propName);\n transformedProps[attrName] = attrValue;\n return transformedProps;\n }, {});\n};\n", "import { useEffect, useRef } from 'react';\nimport type { MutableRefObject, ForwardedRef } from 'react';\n\ntype Maybe<T> = T | null | undefined;\ntype RefCb<T> = (instance: Maybe<T>) => void;\ntype RefObj<T> = MutableRefObject<Maybe<T>>;\ntype RefTypes<T> = RefObj<T> | RefCb<T> | ForwardedRef<T>;\ninterface useCombinedRefs {\n <T>(...refs: Maybe<RefTypes<T>>[]): RefObj<T>;\n}\n\nexport const useCombinedRefs: useCombinedRefs = (...refs) => {\n const targetRef = useRef(null);\n\n useEffect(() => {\n refs.forEach((ref) => {\n if (!ref) return;\n\n if (typeof ref === 'function') {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n });\n }, [refs]);\n\n return targetRef;\n};\n\n// TS assumed default export was interface def instead of function value (CJP)\nconst defaultUseCombinedRefs = useCombinedRefs;\nexport default defaultUseCombinedRefs;\n", "import { useEffect } from 'react';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Slightly modified version of React's shallowEqual, with optimizations for Arrays\n * so we may treat them specifically as unequal if they are not a) both arrays\n * or b) don't contain the same (shallowly compared) elements.\n */\nconst shallowEqual = (objA: any, objB: any): boolean => {\n if (Object.is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n if (Array.isArray(objA)) {\n // Early \"cheap\" array compares\n if (!Array.isArray(objB) || objA.length !== objB.length) return false;\n // Shallow compare for arrays\n return objA.some((vVal, i) => objB[i] === vVal);\n }\n\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (let i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const defaultHasChanged = (obj: any, v: any, k: string) => {\n return !shallowEqual(v, obj[k]);\n};\n\nconst defaultUpdateValue = (obj: any, v: any, k: string) => {\n obj[k] = v;\n};\n\nexport const useObjectPropEffect = <T extends { [k: string]: any }, V>(\n propName: string,\n propValue: V | null | undefined,\n ref: React.MutableRefObject<T | null> | null | undefined,\n updateValue = defaultUpdateValue,\n hasChanged = defaultHasChanged\n) => {\n return useEffect(() => {\n const obj = ref?.current;\n if (!obj) return;\n if (!hasChanged(obj, propValue, propName)) return;\n updateValue(obj, propValue, propName);\n }, [ref?.current, propValue]);\n};\n\nexport default useObjectPropEffect;\n", "const getEnvPlayerVersion = () => {\n try {\n // @ts-ignore\n return PLAYER_VERSION as string;\n } catch {}\n return 'UNKNOWN';\n};\n\nconst player_version: string = getEnvPlayerVersion();\n\nexport const getPlayerVersion = () => player_version;\n"],
5
- "mappings": "mkBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,yCAAAE,KAAA,eAAAC,GAAAH,IAAA,IAAAI,EAAiC,qBAGjCC,EAA2B,2BCC3B,IAAMC,EAAyB,CAC7B,UAAW,QACX,UAAW,QACX,QAAS,MACT,YAAa,cACb,QAAS,UACT,YAAa,cACb,SAAU,WACV,aAAc,cAChB,EAKaC,GAASC,GAAsCA,GAAK,KAGpDC,GAAU,CAAqBC,EAAaC,IACnDJ,GAAMI,CAAC,EAAU,GACdD,KAAKC,EAGRC,GAAeC,GAAmBA,EAAO,QAAQ,SAAWC,GAAU,IAAIA,EAAM,YAAY,GAAG,EAExFC,GAAmB,CAACC,EAAkBC,IAAuC,CACxF,GAAI,SAAOA,GAAc,WAAa,CAACA,GACvC,IAAIR,GAAQO,EAAUV,CAAsB,EAAG,OAAOA,EAAuBU,GAC7E,GAAI,OAAOC,GAAa,KACxB,MAAI,QAAQ,KAAKD,CAAQ,EAAUJ,GAAYI,CAAQ,EAChDA,EACT,EAGO,IAAME,GAAoB,CAACC,EAAgBC,IAC5C,OA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KiB,CAAY,EACtDf,EAAuB,SAAUF,EAAKkB,CAAQ,EAC9ChB,EAAuB,UAAWF,EAAKmB,CAAS,EAChDjB,EAAuB,OAAQF,EAAKoB,CAAM,EAC1ClB,EAAuB,UAAWF,EAAKqB,CAAS,EAChDnB,EAAuB,aAAcF,EAAKsB,CAAY,EACtDpB,EAAuB,QAASF,EAAKuB,CAAO,EAC5CrB,EAAuB,UAAWF,EAAKwB,CAAS,EAChDtB,EAAuB,SAAUF,EAAKyB,CAAQ,EAC9CvB,EAAuB,UAAWF,EAAK0B,CAAS,EAChDxB,EAAuB,UAAWF,EAAK2B,CAAS,EAChDzB,EAAuB,QAASF,EAAK4B,CAAO,EAC5C1B,EAAuB,QAASF,EAAK6B,CAAO,EAC5C3B,EAAuB,iBAAkBF,EAAK8B,CAAgB,EAC9D5B,EAAuB,kBAAmBF,EAAK+B,CAAiB,EAEzD,CAACQ,CAAc,CACxB,EAEMQ,GAAwBC,EAAiB,EACzCC,GAAqB,mBAErBC,GAAY,EAAArD,QAAM,WAGtB,CAACE,EAAOC,IAAQ,CAChB,IAAMmD,KAAiB,UAAyB,IAAI,EAC9CC,EAAYC,EAAgBF,EAAgBnD,CAAG,EAC/C,CAACuC,CAAc,EAAIjC,GAAU6C,EAAgBpD,CAAK,EAExD,OACE,EAAAF,QAAA,cAACD,GAAA,CAEC,IAAKwD,EACL,mBAAoBH,GACpB,sBAAuBF,GACtB,GAAGR,EACN,CAEJ,CAAC,EAEMe,GAAQJ",
6
- "names": ["src_exports", "__export", "src_default", "__toCommonJS", "import_react", "import_mux_player", "ReactPropToAttrNameMap", "isNil", "x", "isKeyOf", "k", "o", "toKebabCase", "string", "match", "toNativeAttrName", "propName", "propValue", "toNativeAttrValue", "propValue", "propName", "toNativeProps", "props", "transformedProps", "attrName", "toNativeAttrName", "attrValue", "import_react", "import_react", "useCombinedRefs", "refs", "targetRef", "ref", "import_react", "hasOwnProperty", "shallowEqual", "objA", "objB", "vVal", "keysA", "keysB", "i", "defaultHasChanged", "obj", "v", "k", "defaultUpdateValue", "useObjectPropEffect", "propName", "propValue", "ref", "updateValue", "hasChanged", "useObjectPropEffect_default", "getEnvPlayerVersion", "player_version", "getPlayerVersion", "MuxPlayerInternal", "React", "children", "props", "ref", "toNativeProps", "useEventCallbackEffect", "type", "callback", "eventTarget", "usePlayer", "onAbort", "onCanPlay", "onCanPlayThrough", "onEmptied", "onLoadStart", "onLoadedData", "onLoadedMetadata", "onProgress", "onDurationChange", "onVolumeChange", "onRateChange", "onResize", "onWaiting", "onPlay", "onPlaying", "onTimeUpdate", "onPause", "onSeeking", "onSeeked", "onStalled", "onSuspend", "onEnded", "onError", "onCuePointChange", "onCuePointsChange", "metadata", "tokens", "paused", "playbackId", "playbackRates", "currentTime", "themeProps", "remainingProps", "useObjectPropEffect_default", "playerEl", "pausedVal", "value", "propName", "defaultHasChanged", "currentTimeVal", "playerSoftwareVersion", "getPlayerVersion", "playerSoftwareName", "MuxPlayer", "innerPlayerRef", "playerRef", "useCombinedRefs", "src_default"]
4
+ "sourcesContent": ["import React, { useEffect } from 'react';\nimport type { CSSProperties } from 'react';\nimport type {\n StreamTypes,\n PlaybackTypes,\n CmcdTypes,\n MaxResolutionValue,\n MinResolutionValue,\n RenditionOrderValue,\n} from '@mux/playback-core';\nimport { MaxResolution, MinResolution, RenditionOrder } from '@mux/playback-core';\nimport { MediaError } from '@mux/mux-player';\nimport type MuxPlayerElement from '@mux/mux-player';\nimport type { Tokens, MuxPlayerElementEventMap } from '@mux/mux-player';\nimport { toNativeProps } from './common/utils';\nimport { useRef } from 'react';\nimport { useCombinedRefs } from './useCombinedRefs';\nimport useObjectPropEffect, { defaultHasChanged } from './useObjectPropEffect';\nimport { getPlayerVersion } from './env';\n\nexport { MediaError, MaxResolution, MinResolution, RenditionOrder };\n\ntype ValueOf<T> = T[keyof T];\ninterface GenericEventListener<T extends Event = CustomEvent> {\n (evt: T): void;\n}\n\nexport type MuxPlayerRefAttributes = MuxPlayerElement;\ntype VideoApiAttributes = {\n currentTime: number;\n volume: number;\n paused: boolean;\n src: string | null;\n poster: string;\n playbackRate: number;\n playsInline: boolean;\n preload: string;\n crossOrigin: string;\n autoPlay: boolean | string;\n loop: boolean;\n muted: boolean;\n style: CSSProperties;\n};\n\ntype MuxMediaPropTypes = {\n audio: boolean;\n // envKey: Options[\"data\"][\"env_key\"];\n envKey: string;\n // debug: Options[\"debug\"] & Hls[\"config\"][\"debug\"];\n debug: boolean;\n disableCookies: boolean;\n // metadata: Partial<Options[\"data\"]>;\n metadata: { [k: string]: any };\n beaconCollectionDomain: string;\n customDomain: string;\n playbackId: string;\n preferPlayback: ValueOf<PlaybackTypes> | undefined;\n // NOTE: Explicitly adding deprecated values here for now to avoid fully breaking changes in TS envs (CJP)\n streamType: ValueOf<StreamTypes> | 'll-live' | 'live:dvr' | 'll-live:dvr';\n defaultStreamType: ValueOf<StreamTypes>;\n targetLiveWindow: number;\n startTime: number;\n storyboardSrc: string;\n preferCmcd: ValueOf<CmcdTypes> | undefined;\n children?: React.ReactNode;\n};\n\nexport type MuxPlayerProps = {\n className?: string;\n hotkeys?: string;\n nohotkeys?: boolean;\n defaultHiddenCaptions?: boolean;\n playerSoftwareVersion?: string;\n playerSoftwareName?: string;\n forwardSeekOffset?: number;\n backwardSeekOffset?: number;\n maxResolution?: MaxResolutionValue;\n minResolution?: MinResolutionValue;\n renditionOrder?: RenditionOrderValue;\n metadataVideoId?: string;\n metadataVideoTitle?: string;\n metadataViewerUserId?: string;\n primaryColor?: string;\n secondaryColor?: string;\n accentColor?: string;\n placeholder?: string;\n playbackRates?: number[];\n defaultShowRemainingTime?: boolean;\n noVolumePref?: boolean;\n thumbnailTime?: number;\n title?: string;\n tokens?: Tokens;\n theme?: string;\n themeProps?: { [k: string]: any };\n onAbort?: GenericEventListener<MuxPlayerElementEventMap['abort']>;\n onCanPlay?: GenericEventListener<MuxPlayerElementEventMap['canplay']>;\n onCanPlayThrough?: GenericEventListener<MuxPlayerElementEventMap['canplaythrough']>;\n onEmptied?: GenericEventListener<MuxPlayerElementEventMap['emptied']>;\n onLoadStart?: GenericEventListener<MuxPlayerElementEventMap['loadstart']>;\n onLoadedData?: GenericEventListener<MuxPlayerElementEventMap['loadeddata']>;\n onLoadedMetadata?: GenericEventListener<MuxPlayerElementEventMap['loadedmetadata']>;\n onProgress?: GenericEventListener<MuxPlayerElementEventMap['progress']>;\n onDurationChange?: GenericEventListener<MuxPlayerElementEventMap['durationchange']>;\n onVolumeChange?: GenericEventListener<MuxPlayerElementEventMap['volumechange']>;\n onRateChange?: GenericEventListener<MuxPlayerElementEventMap['ratechange']>;\n onResize?: GenericEventListener<MuxPlayerElementEventMap['resize']>;\n onWaiting?: GenericEventListener<MuxPlayerElementEventMap['waiting']>;\n onPlay?: GenericEventListener<MuxPlayerElementEventMap['play']>;\n onPlaying?: GenericEventListener<MuxPlayerElementEventMap['playing']>;\n onTimeUpdate?: GenericEventListener<MuxPlayerElementEventMap['timeupdate']>;\n onPause?: GenericEventListener<MuxPlayerElementEventMap['pause']>;\n onSeeking?: GenericEventListener<MuxPlayerElementEventMap['seeking']>;\n onSeeked?: GenericEventListener<MuxPlayerElementEventMap['seeked']>;\n onStalled?: GenericEventListener<MuxPlayerElementEventMap['stalled']>;\n onSuspend?: GenericEventListener<MuxPlayerElementEventMap['suspend']>;\n onEnded?: GenericEventListener<MuxPlayerElementEventMap['ended']>;\n onError?: GenericEventListener<MuxPlayerElementEventMap['error']>;\n onCuePointChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointchange']>;\n onCuePointsChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointschange']>;\n // onPlayerReady?: EventListener;\n} & Partial<MuxMediaPropTypes> &\n Partial<VideoApiAttributes>;\n\nconst MuxPlayerInternal = React.forwardRef<MuxPlayerRefAttributes, MuxPlayerProps>(({ children, ...props }, ref) => {\n return React.createElement('mux-player', toNativeProps({ ...props, ref }), children);\n});\n\nconst useEventCallbackEffect = <K extends keyof MuxPlayerElementEventMap>(\n type: K,\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n callback: GenericEventListener<MuxPlayerElementEventMap[K]> | undefined\n) => {\n return useEffect(() => {\n const eventTarget = ref?.current;\n if (!eventTarget || !callback) return;\n eventTarget.addEventListener(type, callback);\n return () => {\n eventTarget.removeEventListener(type, callback);\n };\n }, [ref?.current, callback]);\n};\n\nconst usePlayer = (\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n props: MuxPlayerProps\n) => {\n const {\n onAbort,\n onCanPlay,\n onCanPlayThrough,\n onEmptied,\n onLoadStart,\n onLoadedData,\n onLoadedMetadata,\n onProgress,\n onDurationChange,\n onVolumeChange,\n onRateChange,\n onResize,\n onWaiting,\n onPlay,\n onPlaying,\n onTimeUpdate,\n onPause,\n onSeeking,\n onSeeked,\n onStalled,\n onSuspend,\n onEnded,\n onError,\n onCuePointChange,\n onCuePointsChange,\n // onPlayerReady,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n currentTime,\n themeProps,\n ...remainingProps\n } = props;\n useObjectPropEffect('playbackRates', playbackRates, ref);\n useObjectPropEffect('metadata', metadata, ref);\n useObjectPropEffect('themeProps', themeProps, ref);\n useObjectPropEffect('tokens', tokens, ref);\n useObjectPropEffect('playbackId', playbackId, ref);\n useObjectPropEffect(\n 'paused',\n paused,\n ref,\n (playerEl: HTMLMediaElement, pausedVal?: boolean) => {\n if (pausedVal == null) return;\n if (pausedVal) {\n playerEl.pause();\n } else {\n playerEl.play();\n }\n },\n (playerEl, value, propName) => {\n if (playerEl.hasAttribute('autoplay') && !playerEl.hasPlayed) {\n return false;\n }\n return defaultHasChanged(playerEl, value, propName);\n }\n );\n useObjectPropEffect('currentTime', currentTime, ref, (playerEl: HTMLMediaElement, currentTimeVal?: number) => {\n if (currentTimeVal == null) return;\n playerEl.currentTime = currentTimeVal;\n });\n useEventCallbackEffect('abort', ref, onAbort);\n useEventCallbackEffect('canplay', ref, onCanPlay);\n useEventCallbackEffect('canplaythrough', ref, onCanPlayThrough);\n useEventCallbackEffect('emptied', ref, onEmptied);\n useEventCallbackEffect('loadstart', ref, onLoadStart);\n useEventCallbackEffect('loadeddata', ref, onLoadedData);\n useEventCallbackEffect('loadedmetadata', ref, onLoadedMetadata);\n useEventCallbackEffect('progress', ref, onProgress);\n useEventCallbackEffect('durationchange', ref, onDurationChange);\n useEventCallbackEffect('volumechange', ref, onVolumeChange);\n useEventCallbackEffect('ratechange', ref, onRateChange);\n useEventCallbackEffect('resize', ref, onResize);\n useEventCallbackEffect('waiting', ref, onWaiting);\n useEventCallbackEffect('play', ref, onPlay);\n useEventCallbackEffect('playing', ref, onPlaying);\n useEventCallbackEffect('timeupdate', ref, onTimeUpdate);\n useEventCallbackEffect('pause', ref, onPause);\n useEventCallbackEffect('seeking', ref, onSeeking);\n useEventCallbackEffect('seeked', ref, onSeeked);\n useEventCallbackEffect('stalled', ref, onStalled);\n useEventCallbackEffect('suspend', ref, onSuspend);\n useEventCallbackEffect('ended', ref, onEnded);\n useEventCallbackEffect('error', ref, onError);\n useEventCallbackEffect('cuepointchange', ref, onCuePointChange);\n useEventCallbackEffect('cuepointschange', ref, onCuePointsChange);\n // useEventCallbackEffect('playerready', ref, onPlayerReady);\n return [remainingProps];\n};\n\nconst playerSoftwareVersion = getPlayerVersion();\nconst playerSoftwareName = 'mux-player-react';\n\nconst MuxPlayer = React.forwardRef<\n MuxPlayerRefAttributes,\n Omit<MuxPlayerProps, 'playerSoftwareVersion' | 'playerSoftwareName'>\n>((props, ref) => {\n const innerPlayerRef = useRef<MuxPlayerElement>(null);\n const playerRef = useCombinedRefs(innerPlayerRef, ref);\n const [remainingProps] = usePlayer(innerPlayerRef, props);\n\n return (\n <MuxPlayerInternal\n /** @TODO Fix types relationships (CJP) */\n ref={playerRef as typeof innerPlayerRef}\n playerSoftwareName={playerSoftwareName}\n playerSoftwareVersion={playerSoftwareVersion}\n {...remainingProps}\n />\n );\n});\n\nexport default MuxPlayer;\n", "// NOTE: As a forward-looking implementation, we may want to assume\n// prop names -> attribute names is always a simple name.toLowerCase()\n// and provide a mechanism for passing in per-component overrides for\n// e.g. kebab cases, as that's the way React/Preact handles these. (CJP)\nconst ReactPropToAttrNameMap = {\n className: 'class',\n classname: 'class',\n htmlFor: 'for',\n crossOrigin: 'crossorigin',\n viewBox: 'viewBox',\n playsInline: 'playsinline',\n autoPlay: 'autoplay',\n playbackRate: 'playbackrate',\n};\n\ntype KeyTypes = string | number | symbol;\ntype Maybe<T> = T | null | undefined;\n\nexport const isNil = (x: unknown): x is null | undefined => x == undefined;\n\n// Type Guard to determine if a given key is actually a key of some object of type T\nexport const isKeyOf = <T extends {} = any>(k: KeyTypes, o: Maybe<T>): k is keyof T => {\n if (isNil(o)) return false;\n return k in o;\n};\n\nconst toKebabCase = (string: string) => string.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);\n\nexport const toNativeAttrName = (propName: string, propValue: any): string | undefined => {\n if (typeof propValue === 'boolean' && !propValue) return undefined;\n if (isKeyOf(propName, ReactPropToAttrNameMap)) return ReactPropToAttrNameMap[propName];\n if (typeof propValue == undefined) return undefined;\n if (/[A-Z]/.test(propName)) return toKebabCase(propName);\n return propName;\n};\nexport const toStyleAttr = <T>(x: T) => x;\n\nexport const toNativeAttrValue = (propValue: any, propName: string) => {\n if (typeof propValue === 'boolean') return '';\n return propValue;\n};\n\nexport const toNativeProps = (props = {}) => {\n return Object.entries(props).reduce<{ [k: string]: string }>((transformedProps, [propName, propValue]) => {\n const attrName = toNativeAttrName(propName, propValue);\n\n // prop was stripped. Don't add.\n if (!attrName) {\n return transformedProps;\n }\n\n const attrValue = toNativeAttrValue(propValue, propName);\n transformedProps[attrName] = attrValue;\n return transformedProps;\n }, {});\n};\n", "import { useEffect, useRef } from 'react';\nimport type { MutableRefObject, ForwardedRef } from 'react';\n\ntype Maybe<T> = T | null | undefined;\ntype RefCb<T> = (instance: Maybe<T>) => void;\ntype RefObj<T> = MutableRefObject<Maybe<T>>;\ntype RefTypes<T> = RefObj<T> | RefCb<T> | ForwardedRef<T>;\ninterface useCombinedRefs {\n <T>(...refs: Maybe<RefTypes<T>>[]): RefObj<T>;\n}\n\nexport const useCombinedRefs: useCombinedRefs = (...refs) => {\n const targetRef = useRef(null);\n\n useEffect(() => {\n refs.forEach((ref) => {\n if (!ref) return;\n\n if (typeof ref === 'function') {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n });\n }, [refs]);\n\n return targetRef;\n};\n\n// TS assumed default export was interface def instead of function value (CJP)\nconst defaultUseCombinedRefs = useCombinedRefs;\nexport default defaultUseCombinedRefs;\n", "import { useEffect } from 'react';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Slightly modified version of React's shallowEqual, with optimizations for Arrays\n * so we may treat them specifically as unequal if they are not a) both arrays\n * or b) don't contain the same (shallowly compared) elements.\n */\nconst shallowEqual = (objA: any, objB: any): boolean => {\n if (Object.is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n if (Array.isArray(objA)) {\n // Early \"cheap\" array compares\n if (!Array.isArray(objB) || objA.length !== objB.length) return false;\n // Shallow compare for arrays\n return objA.some((vVal, i) => objB[i] === vVal);\n }\n\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (let i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const defaultHasChanged = (obj: any, v: any, k: string) => {\n return !shallowEqual(v, obj[k]);\n};\n\nconst defaultUpdateValue = (obj: any, v: any, k: string) => {\n obj[k] = v;\n};\n\nexport const useObjectPropEffect = <T extends { [k: string]: any }, V>(\n propName: string,\n propValue: V | null | undefined,\n ref: React.MutableRefObject<T | null> | null | undefined,\n updateValue = defaultUpdateValue,\n hasChanged = defaultHasChanged\n) => {\n return useEffect(() => {\n const obj = ref?.current;\n if (!obj) return;\n if (!hasChanged(obj, propValue, propName)) return;\n updateValue(obj, propValue, propName);\n }, [ref?.current, propValue]);\n};\n\nexport default useObjectPropEffect;\n", "const getEnvPlayerVersion = () => {\n try {\n // @ts-ignore\n return PLAYER_VERSION as string;\n } catch {}\n return 'UNKNOWN';\n};\n\nconst player_version: string = getEnvPlayerVersion();\n\nexport const getPlayerVersion = () => player_version;\n"],
5
+ "mappings": "qkBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,iJAAAE,KAAA,eAAAC,GAAAH,IAAA,IAAAI,EAAiC,qBAUjCC,EAA6D,8BAC7DC,EAA2B,2BCP3B,IAAMC,EAAyB,CAC7B,UAAW,QACX,UAAW,QACX,QAAS,MACT,YAAa,cACb,QAAS,UACT,YAAa,cACb,SAAU,WACV,aAAc,cAChB,EAKaC,GAASC,GAAsCA,GAAK,KAGpDC,GAAU,CAAqBC,EAAaC,IACnDJ,GAAMI,CAAC,EAAU,GACdD,KAAKC,EAGRC,GAAeC,GAAmBA,EAAO,QAAQ,SAAWC,GAAU,IAAIA,EAAM,YAAY,GAAG,EAExFC,GAAmB,CAACC,EAAkBC,IAAuC,CACxF,GAAI,SAAOA,GAAc,WAAa,CAACA,GACvC,IAAIR,GAAQO,EAAUV,CAAsB,EAAG,OAAOA,EAAuBU,GAC7E,GAAI,OAAOC,GAAa,KACxB,MAAI,QAAQ,KAAKD,CAAQ,EAAUJ,GAAYI,CAAQ,EAChDA,EACT,EAGO,IAAME,GAAoB,CAACC,EAAgBC,IAC5C,OAAOD,GAAc,UAAkB,GACpCA,EAGIE,EAAgB,CAACC,EAAQ,CAAC,IAC9B,OAAO,QAAQA,CAAK,EAAE,OAAgC,CAACC,EAAkB,CAACH,EAAUD,CAAS,IAAM,CACxG,IAAMK,EAAWC,GAAiBL,EAAUD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AAuB,aAAcF,EAAKsB,CAAY,EACtDpB,EAAuB,QAASF,EAAKuB,CAAO,EAC5CrB,EAAuB,UAAWF,EAAKwB,CAAS,EAChDtB,EAAuB,SAAUF,EAAKyB,CAAQ,EAC9CvB,EAAuB,UAAWF,EAAK0B,CAAS,EAChDxB,EAAuB,UAAWF,EAAK2B,CAAS,EAChDzB,EAAuB,QAASF,EAAK4B,CAAO,EAC5C1B,EAAuB,QAASF,EAAK6B,CAAO,EAC5C3B,EAAuB,iBAAkBF,EAAK8B,CAAgB,EAC9D5B,EAAuB,kBAAmBF,EAAK+B,CAAiB,EAEzD,CAACQ,CAAc,CACxB,EAEMQ,GAAwBC,EAAiB,EACzCC,GAAqB,mBAErBC,GAAY,EAAArD,QAAM,WAGtB,CAACE,EAAOC,IAAQ,CAChB,IAAMmD,KAAiB,UAAyB,IAAI,EAC9CC,EAAYC,EAAgBF,EAAgBnD,CAAG,EAC/C,CAACuC,CAAc,EAAIjC,GAAU6C,EAAgBpD,CAAK,EAExD,OACE,EAAAF,QAAA,cAACD,GAAA,CAEC,IAAKwD,EACL,mBAAoBH,GACpB,sBAAuBF,GACtB,GAAGR,EACN,CAEJ,CAAC,EAEMe,GAAQJ",
6
+ "names": ["src_exports", "__export", "src_default", "__toCommonJS", "import_react", "import_playback_core", "import_mux_player", "ReactPropToAttrNameMap", "isNil", "x", "isKeyOf", "k", "o", "toKebabCase", "string", "match", "toNativeAttrName", "propName", "propValue", "toNativeAttrValue", "propValue", "propName", "toNativeProps", "props", "transformedProps", "attrName", "toNativeAttrName", "attrValue", "import_react", "import_react", "useCombinedRefs", "refs", "targetRef", "ref", "import_react", "hasOwnProperty", "shallowEqual", "objA", "objB", "vVal", "keysA", "keysB", "i", "defaultHasChanged", "obj", "v", "k", "defaultUpdateValue", "useObjectPropEffect", "propName", "propValue", "ref", "updateValue", "hasChanged", "useObjectPropEffect_default", "getEnvPlayerVersion", "player_version", "getPlayerVersion", "MuxPlayerInternal", "React", "children", "props", "ref", "toNativeProps", "useEventCallbackEffect", "type", "callback", "eventTarget", "usePlayer", "onAbort", "onCanPlay", "onCanPlayThrough", "onEmptied", "onLoadStart", "onLoadedData", "onLoadedMetadata", "onProgress", "onDurationChange", "onVolumeChange", "onRateChange", "onResize", "onWaiting", "onPlay", "onPlaying", "onTimeUpdate", "onPause", "onSeeking", "onSeeked", "onStalled", "onSuspend", "onEnded", "onError", "onCuePointChange", "onCuePointsChange", "metadata", "tokens", "paused", "playbackId", "playbackRates", "currentTime", "themeProps", "remainingProps", "useObjectPropEffect_default", "playerEl", "pausedVal", "value", "propName", "defaultHasChanged", "currentTimeVal", "playerSoftwareVersion", "getPlayerVersion", "playerSoftwareName", "MuxPlayer", "innerPlayerRef", "playerRef", "useCombinedRefs", "src_default"]
7
7
  }
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import y,{useEffect as ie}from"react";import{MediaError as be}from"@mux/mux-player";var c={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},_=e=>e==null,q=(e,t)=>_(t)?!1:e in t,J=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Y=(e,t)=>{if(!(typeof t=="boolean"&&!t)){if(q(e,c))return c[e];if(typeof t!=null)return/[A-Z]/.test(e)?J(e):e}};var $=(e,t)=>typeof e=="boolean"?"":e,d=(e={})=>Object.entries(e).reduce((t,[n,o])=>{let a=Y(n,o);if(!a)return t;let i=$(o,n);return t[a]=i,t},{});import{useRef as se}from"react";import{useEffect as Q,useRef as X}from"react";var m=(...e)=>{let t=X(null);return Q(()=>{e.forEach(n=>{!n||(typeof n=="function"?n(t.current):n.current=t.current)})},[e]),t};import{useEffect as B}from"react";var ee=Object.prototype.hasOwnProperty,te=(e,t)=>{if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.some((a,i)=>t[i]===a);let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let a=0;a<n.length;a++)if(!ee.call(t,n[a])||!Object.is(e[n[a]],t[n[a]]))return!1;return!0},p=(e,t,n)=>!te(t,e[n]),ne=(e,t,n)=>{e[n]=t},re=(e,t,n,o=ne,a=p)=>B(()=>{let i=n==null?void 0:n.current;!i||!a(i,t,e)||o(i,t,e)},[n==null?void 0:n.current,t]),l=re;var ae=()=>{try{return"2.0.1"}catch{}return"UNKNOWN"},oe=ae(),E=()=>oe;var le=y.forwardRef(({children:e,...t},n)=>y.createElement("mux-player",d({...t,ref:n}),e)),r=(e,t,n)=>ie(()=>{let o=t==null?void 0:t.current;if(!(!o||!n))return o.addEventListener(e,n),()=>{o.removeEventListener(e,n)}},[t==null?void 0:t.current,n]),ue=(e,t)=>{let{onAbort:n,onCanPlay:o,onCanPlayThrough:a,onEmptied:i,onLoadStart:g,onLoadedData:f,onLoadedMetadata:M,onProgress:P,onDurationChange:v,onVolumeChange:b,onRateChange:x,onResize:T,onWaiting:h,onPlay:R,onPlaying:k,onTimeUpdate:C,onPause:L,onSeeking:O,onSeeked:S,onStalled:G,onSuspend:w,onEnded:V,onError:A,onCuePointChange:N,onCuePointsChange:I,metadata:K,tokens:D,paused:U,playbackId:H,playbackRates:j,currentTime:z,themeProps:F,...W}=t;return l("playbackRates",j,e),l("metadata",K,e),l("themeProps",F,e),l("tokens",D,e),l("playbackId",H,e),l("paused",U,e,(s,u)=>{u!=null&&(u?s.pause():s.play())},(s,u,Z)=>s.hasAttribute("autoplay")&&!s.hasPlayed?!1:p(s,u,Z)),l("currentTime",z,e,(s,u)=>{u!=null&&(s.currentTime=u)}),r("abort",e,n),r("canplay",e,o),r("canplaythrough",e,a),r("emptied",e,i),r("loadstart",e,g),r("loadeddata",e,f),r("loadedmetadata",e,M),r("progress",e,P),r("durationchange",e,v),r("volumechange",e,b),r("ratechange",e,x),r("resize",e,T),r("waiting",e,h),r("play",e,R),r("playing",e,k),r("timeupdate",e,C),r("pause",e,L),r("seeking",e,O),r("seeked",e,S),r("stalled",e,G),r("suspend",e,w),r("ended",e,V),r("error",e,A),r("cuepointchange",e,N),r("cuepointschange",e,I),[W]},ye=E(),pe="mux-player-react",ce=y.forwardRef((e,t)=>{let n=se(null),o=m(n,t),[a]=ue(n,e);return y.createElement(le,{ref:o,playerSoftwareName:pe,playerSoftwareVersion:ye,...a})}),Ce=ce;export{be as MediaError,Ce as default};
1
+ import y,{useEffect as ie}from"react";import{MaxResolution as be,MinResolution as xe,RenditionOrder as Te}from"@mux/playback-core";import{MediaError as he}from"@mux/mux-player";var p={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},_=e=>e==null,q=(e,n)=>_(n)?!1:e in n,J=e=>e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Y=(e,n)=>{if(!(typeof n=="boolean"&&!n)){if(q(e,p))return p[e];if(typeof n!=null)return/[A-Z]/.test(e)?J(e):e}};var $=(e,n)=>typeof e=="boolean"?"":e,c=(e={})=>Object.entries(e).reduce((n,[t,o])=>{let a=Y(t,o);if(!a)return n;let i=$(o,t);return n[a]=i,n},{});import{useRef as se}from"react";import{useEffect as Q,useRef as X}from"react";var m=(...e)=>{let n=X(null);return Q(()=>{e.forEach(t=>{!t||(typeof t=="function"?t(n.current):t.current=n.current)})},[e]),n};import{useEffect as B}from"react";var ee=Object.prototype.hasOwnProperty,ne=(e,n)=>{if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.some((a,i)=>n[i]===a);let t=Object.keys(e),o=Object.keys(n);if(t.length!==o.length)return!1;for(let a=0;a<t.length;a++)if(!ee.call(n,t[a])||!Object.is(e[t[a]],n[t[a]]))return!1;return!0},d=(e,n,t)=>!ne(n,e[t]),te=(e,n,t)=>{e[t]=n},re=(e,n,t,o=te,a=d)=>B(()=>{let i=t==null?void 0:t.current;!i||!a(i,n,e)||o(i,n,e)},[t==null?void 0:t.current,n]),l=re;var ae=()=>{try{return"2.1.0"}catch{}return"UNKNOWN"},oe=ae(),E=()=>oe;var le=y.forwardRef(({children:e,...n},t)=>y.createElement("mux-player",c({...n,ref:t}),e)),r=(e,n,t)=>ie(()=>{let o=n==null?void 0:n.current;if(!(!o||!t))return o.addEventListener(e,t),()=>{o.removeEventListener(e,t)}},[n==null?void 0:n.current,t]),ue=(e,n)=>{let{onAbort:t,onCanPlay:o,onCanPlayThrough:a,onEmptied:i,onLoadStart:g,onLoadedData:M,onLoadedMetadata:f,onProgress:P,onDurationChange:v,onVolumeChange:b,onRateChange:x,onResize:T,onWaiting:R,onPlay:h,onPlaying:k,onTimeUpdate:C,onPause:L,onSeeking:O,onSeeked:S,onStalled:G,onSuspend:w,onEnded:V,onError:A,onCuePointChange:N,onCuePointsChange:I,metadata:K,tokens:D,paused:U,playbackId:H,playbackRates:j,currentTime:z,themeProps:F,...W}=n;return l("playbackRates",j,e),l("metadata",K,e),l("themeProps",F,e),l("tokens",D,e),l("playbackId",H,e),l("paused",U,e,(s,u)=>{u!=null&&(u?s.pause():s.play())},(s,u,Z)=>s.hasAttribute("autoplay")&&!s.hasPlayed?!1:d(s,u,Z)),l("currentTime",z,e,(s,u)=>{u!=null&&(s.currentTime=u)}),r("abort",e,t),r("canplay",e,o),r("canplaythrough",e,a),r("emptied",e,i),r("loadstart",e,g),r("loadeddata",e,M),r("loadedmetadata",e,f),r("progress",e,P),r("durationchange",e,v),r("volumechange",e,b),r("ratechange",e,x),r("resize",e,T),r("waiting",e,R),r("play",e,h),r("playing",e,k),r("timeupdate",e,C),r("pause",e,L),r("seeking",e,O),r("seeked",e,S),r("stalled",e,G),r("suspend",e,w),r("ended",e,V),r("error",e,A),r("cuepointchange",e,N),r("cuepointschange",e,I),[W]},ye=E(),de="mux-player-react",pe=y.forwardRef((e,n)=>{let t=se(null),o=m(t,n),[a]=ue(t,e);return y.createElement(le,{ref:o,playerSoftwareName:de,playerSoftwareVersion:ye,...a})}),Ge=pe;export{be as MaxResolution,he as MediaError,xe as MinResolution,Te as RenditionOrder,Ge as default};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.tsx", "../src/common/utils.ts", "../src/useCombinedRefs.ts", "../src/useObjectPropEffect.ts", "../src/env.ts"],
4
- "sourcesContent": ["import React, { useEffect } from 'react';\nimport type { CSSProperties } from 'react';\nimport type { StreamTypes, PlaybackTypes, CmcdTypes } from '@mux/playback-core';\nimport { MediaError } from '@mux/mux-player';\nimport type MuxPlayerElement from '@mux/mux-player';\nimport type { Tokens, MuxPlayerElementEventMap } from '@mux/mux-player';\nimport { toNativeProps } from './common/utils';\nimport { useRef } from 'react';\nimport { useCombinedRefs } from './useCombinedRefs';\nimport useObjectPropEffect, { defaultHasChanged } from './useObjectPropEffect';\nimport { getPlayerVersion } from './env';\n\nexport { MediaError };\n\ntype ValueOf<T> = T[keyof T];\ninterface GenericEventListener<T extends Event = CustomEvent> {\n (evt: T): void;\n}\n\nexport type MuxPlayerRefAttributes = MuxPlayerElement;\ntype VideoApiAttributes = {\n currentTime: number;\n volume: number;\n paused: boolean;\n src: string | null;\n poster: string;\n playbackRate: number;\n playsInline: boolean;\n preload: string;\n crossOrigin: string;\n autoPlay: boolean | string;\n loop: boolean;\n muted: boolean;\n style: CSSProperties;\n};\n\ntype MuxMediaPropTypes = {\n audio: boolean;\n // envKey: Options[\"data\"][\"env_key\"];\n envKey: string;\n // debug: Options[\"debug\"] & Hls[\"config\"][\"debug\"];\n debug: boolean;\n disableCookies: boolean;\n // metadata: Partial<Options[\"data\"]>;\n metadata: { [k: string]: any };\n beaconCollectionDomain: string;\n customDomain: string;\n playbackId: string;\n preferPlayback: ValueOf<PlaybackTypes> | undefined;\n // NOTE: Explicitly adding deprecated values here for now to avoid fully breaking changes in TS envs (CJP)\n streamType: ValueOf<StreamTypes> | 'll-live' | 'live:dvr' | 'll-live:dvr';\n defaultStreamType: ValueOf<StreamTypes>;\n targetLiveWindow: number;\n startTime: number;\n storyboardSrc: string;\n preferCmcd: ValueOf<CmcdTypes> | undefined;\n children?: React.ReactNode;\n};\n\nexport type MuxPlayerProps = {\n className?: string;\n hotkeys?: string;\n nohotkeys?: boolean;\n defaultHiddenCaptions?: boolean;\n playerSoftwareVersion?: string;\n playerSoftwareName?: string;\n forwardSeekOffset?: number;\n backwardSeekOffset?: number;\n maxResolution?: string;\n metadataVideoId?: string;\n metadataVideoTitle?: string;\n metadataViewerUserId?: string;\n primaryColor?: string;\n secondaryColor?: string;\n accentColor?: string;\n placeholder?: string;\n playbackRates?: number[];\n defaultShowRemainingTime?: boolean;\n noVolumePref?: boolean;\n thumbnailTime?: number;\n title?: string;\n tokens?: Tokens;\n theme?: string;\n themeProps?: { [k: string]: any };\n onAbort?: GenericEventListener<MuxPlayerElementEventMap['abort']>;\n onCanPlay?: GenericEventListener<MuxPlayerElementEventMap['canplay']>;\n onCanPlayThrough?: GenericEventListener<MuxPlayerElementEventMap['canplaythrough']>;\n onEmptied?: GenericEventListener<MuxPlayerElementEventMap['emptied']>;\n onLoadStart?: GenericEventListener<MuxPlayerElementEventMap['loadstart']>;\n onLoadedData?: GenericEventListener<MuxPlayerElementEventMap['loadeddata']>;\n onLoadedMetadata?: GenericEventListener<MuxPlayerElementEventMap['loadedmetadata']>;\n onProgress?: GenericEventListener<MuxPlayerElementEventMap['progress']>;\n onDurationChange?: GenericEventListener<MuxPlayerElementEventMap['durationchange']>;\n onVolumeChange?: GenericEventListener<MuxPlayerElementEventMap['volumechange']>;\n onRateChange?: GenericEventListener<MuxPlayerElementEventMap['ratechange']>;\n onResize?: GenericEventListener<MuxPlayerElementEventMap['resize']>;\n onWaiting?: GenericEventListener<MuxPlayerElementEventMap['waiting']>;\n onPlay?: GenericEventListener<MuxPlayerElementEventMap['play']>;\n onPlaying?: GenericEventListener<MuxPlayerElementEventMap['playing']>;\n onTimeUpdate?: GenericEventListener<MuxPlayerElementEventMap['timeupdate']>;\n onPause?: GenericEventListener<MuxPlayerElementEventMap['pause']>;\n onSeeking?: GenericEventListener<MuxPlayerElementEventMap['seeking']>;\n onSeeked?: GenericEventListener<MuxPlayerElementEventMap['seeked']>;\n onStalled?: GenericEventListener<MuxPlayerElementEventMap['stalled']>;\n onSuspend?: GenericEventListener<MuxPlayerElementEventMap['suspend']>;\n onEnded?: GenericEventListener<MuxPlayerElementEventMap['ended']>;\n onError?: GenericEventListener<MuxPlayerElementEventMap['error']>;\n onCuePointChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointchange']>;\n onCuePointsChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointschange']>;\n // onPlayerReady?: EventListener;\n} & Partial<MuxMediaPropTypes> &\n Partial<VideoApiAttributes>;\n\nconst MuxPlayerInternal = React.forwardRef<MuxPlayerRefAttributes, MuxPlayerProps>(({ children, ...props }, ref) => {\n return React.createElement('mux-player', toNativeProps({ ...props, ref }), children);\n});\n\nconst useEventCallbackEffect = <K extends keyof MuxPlayerElementEventMap>(\n type: K,\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n callback: GenericEventListener<MuxPlayerElementEventMap[K]> | undefined\n) => {\n return useEffect(() => {\n const eventTarget = ref?.current;\n if (!eventTarget || !callback) return;\n eventTarget.addEventListener(type, callback);\n return () => {\n eventTarget.removeEventListener(type, callback);\n };\n }, [ref?.current, callback]);\n};\n\nconst usePlayer = (\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n props: MuxPlayerProps\n) => {\n const {\n onAbort,\n onCanPlay,\n onCanPlayThrough,\n onEmptied,\n onLoadStart,\n onLoadedData,\n onLoadedMetadata,\n onProgress,\n onDurationChange,\n onVolumeChange,\n onRateChange,\n onResize,\n onWaiting,\n onPlay,\n onPlaying,\n onTimeUpdate,\n onPause,\n onSeeking,\n onSeeked,\n onStalled,\n onSuspend,\n onEnded,\n onError,\n onCuePointChange,\n onCuePointsChange,\n // onPlayerReady,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n currentTime,\n themeProps,\n ...remainingProps\n } = props;\n useObjectPropEffect('playbackRates', playbackRates, ref);\n useObjectPropEffect('metadata', metadata, ref);\n useObjectPropEffect('themeProps', themeProps, ref);\n useObjectPropEffect('tokens', tokens, ref);\n useObjectPropEffect('playbackId', playbackId, ref);\n useObjectPropEffect(\n 'paused',\n paused,\n ref,\n (playerEl: HTMLMediaElement, pausedVal?: boolean) => {\n if (pausedVal == null) return;\n if (pausedVal) {\n playerEl.pause();\n } else {\n playerEl.play();\n }\n },\n (playerEl, value, propName) => {\n if (playerEl.hasAttribute('autoplay') && !playerEl.hasPlayed) {\n return false;\n }\n return defaultHasChanged(playerEl, value, propName);\n }\n );\n useObjectPropEffect('currentTime', currentTime, ref, (playerEl: HTMLMediaElement, currentTimeVal?: number) => {\n if (currentTimeVal == null) return;\n playerEl.currentTime = currentTimeVal;\n });\n useEventCallbackEffect('abort', ref, onAbort);\n useEventCallbackEffect('canplay', ref, onCanPlay);\n useEventCallbackEffect('canplaythrough', ref, onCanPlayThrough);\n useEventCallbackEffect('emptied', ref, onEmptied);\n useEventCallbackEffect('loadstart', ref, onLoadStart);\n useEventCallbackEffect('loadeddata', ref, onLoadedData);\n useEventCallbackEffect('loadedmetadata', ref, onLoadedMetadata);\n useEventCallbackEffect('progress', ref, onProgress);\n useEventCallbackEffect('durationchange', ref, onDurationChange);\n useEventCallbackEffect('volumechange', ref, onVolumeChange);\n useEventCallbackEffect('ratechange', ref, onRateChange);\n useEventCallbackEffect('resize', ref, onResize);\n useEventCallbackEffect('waiting', ref, onWaiting);\n useEventCallbackEffect('play', ref, onPlay);\n useEventCallbackEffect('playing', ref, onPlaying);\n useEventCallbackEffect('timeupdate', ref, onTimeUpdate);\n useEventCallbackEffect('pause', ref, onPause);\n useEventCallbackEffect('seeking', ref, onSeeking);\n useEventCallbackEffect('seeked', ref, onSeeked);\n useEventCallbackEffect('stalled', ref, onStalled);\n useEventCallbackEffect('suspend', ref, onSuspend);\n useEventCallbackEffect('ended', ref, onEnded);\n useEventCallbackEffect('error', ref, onError);\n useEventCallbackEffect('cuepointchange', ref, onCuePointChange);\n useEventCallbackEffect('cuepointschange', ref, onCuePointsChange);\n // useEventCallbackEffect('playerready', ref, onPlayerReady);\n return [remainingProps];\n};\n\nconst playerSoftwareVersion = getPlayerVersion();\nconst playerSoftwareName = 'mux-player-react';\n\nconst MuxPlayer = React.forwardRef<\n MuxPlayerRefAttributes,\n Omit<MuxPlayerProps, 'playerSoftwareVersion' | 'playerSoftwareName'>\n>((props, ref) => {\n const innerPlayerRef = useRef<MuxPlayerElement>(null);\n const playerRef = useCombinedRefs(innerPlayerRef, ref);\n const [remainingProps] = usePlayer(innerPlayerRef, props);\n\n return (\n <MuxPlayerInternal\n /** @TODO Fix types relationships (CJP) */\n ref={playerRef as typeof innerPlayerRef}\n playerSoftwareName={playerSoftwareName}\n playerSoftwareVersion={playerSoftwareVersion}\n {...remainingProps}\n />\n );\n});\n\nexport default MuxPlayer;\n", "// NOTE: As a forward-looking implementation, we may want to assume\n// prop names -> attribute names is always a simple name.toLowerCase()\n// and provide a mechanism for passing in per-component overrides for\n// e.g. kebab cases, as that's the way React/Preact handles these. (CJP)\nconst ReactPropToAttrNameMap = {\n className: 'class',\n classname: 'class',\n htmlFor: 'for',\n crossOrigin: 'crossorigin',\n viewBox: 'viewBox',\n playsInline: 'playsinline',\n autoPlay: 'autoplay',\n playbackRate: 'playbackrate',\n};\n\ntype KeyTypes = string | number | symbol;\ntype Maybe<T> = T | null | undefined;\n\nexport const isNil = (x: unknown): x is null | undefined => x == undefined;\n\n// Type Guard to determine if a given key is actually a key of some object of type T\nexport const isKeyOf = <T extends {} = any>(k: KeyTypes, o: Maybe<T>): k is keyof T => {\n if (isNil(o)) return false;\n return k in o;\n};\n\nconst toKebabCase = (string: string) => string.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);\n\nexport const toNativeAttrName = (propName: string, propValue: any): string | undefined => {\n if (typeof propValue === 'boolean' && !propValue) return undefined;\n if (isKeyOf(propName, ReactPropToAttrNameMap)) return ReactPropToAttrNameMap[propName];\n if (typeof propValue == undefined) return undefined;\n if (/[A-Z]/.test(propName)) return toKebabCase(propName);\n return propName;\n};\nexport const toStyleAttr = <T>(x: T) => x;\n\nexport const toNativeAttrValue = (propValue: any, propName: string) => {\n if (typeof propValue === 'boolean') return '';\n return propValue;\n};\n\nexport const toNativeProps = (props = {}) => {\n return Object.entries(props).reduce<{ [k: string]: string }>((transformedProps, [propName, propValue]) => {\n const attrName = toNativeAttrName(propName, propValue);\n\n // prop was stripped. Don't add.\n if (!attrName) {\n return transformedProps;\n }\n\n const attrValue = toNativeAttrValue(propValue, propName);\n transformedProps[attrName] = attrValue;\n return transformedProps;\n }, {});\n};\n", "import { useEffect, useRef } from 'react';\nimport type { MutableRefObject, ForwardedRef } from 'react';\n\ntype Maybe<T> = T | null | undefined;\ntype RefCb<T> = (instance: Maybe<T>) => void;\ntype RefObj<T> = MutableRefObject<Maybe<T>>;\ntype RefTypes<T> = RefObj<T> | RefCb<T> | ForwardedRef<T>;\ninterface useCombinedRefs {\n <T>(...refs: Maybe<RefTypes<T>>[]): RefObj<T>;\n}\n\nexport const useCombinedRefs: useCombinedRefs = (...refs) => {\n const targetRef = useRef(null);\n\n useEffect(() => {\n refs.forEach((ref) => {\n if (!ref) return;\n\n if (typeof ref === 'function') {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n });\n }, [refs]);\n\n return targetRef;\n};\n\n// TS assumed default export was interface def instead of function value (CJP)\nconst defaultUseCombinedRefs = useCombinedRefs;\nexport default defaultUseCombinedRefs;\n", "import { useEffect } from 'react';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Slightly modified version of React's shallowEqual, with optimizations for Arrays\n * so we may treat them specifically as unequal if they are not a) both arrays\n * or b) don't contain the same (shallowly compared) elements.\n */\nconst shallowEqual = (objA: any, objB: any): boolean => {\n if (Object.is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n if (Array.isArray(objA)) {\n // Early \"cheap\" array compares\n if (!Array.isArray(objB) || objA.length !== objB.length) return false;\n // Shallow compare for arrays\n return objA.some((vVal, i) => objB[i] === vVal);\n }\n\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (let i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const defaultHasChanged = (obj: any, v: any, k: string) => {\n return !shallowEqual(v, obj[k]);\n};\n\nconst defaultUpdateValue = (obj: any, v: any, k: string) => {\n obj[k] = v;\n};\n\nexport const useObjectPropEffect = <T extends { [k: string]: any }, V>(\n propName: string,\n propValue: V | null | undefined,\n ref: React.MutableRefObject<T | null> | null | undefined,\n updateValue = defaultUpdateValue,\n hasChanged = defaultHasChanged\n) => {\n return useEffect(() => {\n const obj = ref?.current;\n if (!obj) return;\n if (!hasChanged(obj, propValue, propName)) return;\n updateValue(obj, propValue, propName);\n }, [ref?.current, propValue]);\n};\n\nexport default useObjectPropEffect;\n", "const getEnvPlayerVersion = () => {\n try {\n // @ts-ignore\n return PLAYER_VERSION as string;\n } catch {}\n return 'UNKNOWN';\n};\n\nconst player_version: string = getEnvPlayerVersion();\n\nexport const getPlayerVersion = () => player_version;\n"],
5
- "mappings": "AAAA,OAAOA,GAAS,aAAAC,OAAiB,QAGjC,OAAS,cAAAC,OAAkB,kBCC3B,IAAMC,EAAyB,CAC7B,UAAW,QACX,UAAW,QACX,QAAS,MACT,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EAC9CC,EAAYC,EAAgBH,EAAgBpD,CAAG,EAC/C,CAACwC,CAAc,EAAIjC,GAAU6C,EAAgBrD,CAAK,EAExD,OACEF,EAAA,cAACD,GAAA,CAEC,IAAK0D,EACL,mBAAoBJ,GACpB,sBAAuBF,GACtB,GAAGR,EACN,CAEJ,CAAC,EAEMgB,GAAQL",
6
- "names": ["React", "useEffect", "MediaError", "ReactPropToAttrNameMap", "isNil", "x", "isKeyOf", "k", "o", "toKebabCase", "string", "match", "toNativeAttrName", "propName", "propValue", "toNativeAttrValue", "propValue", "propName", "toNativeProps", "props", "transformedProps", "attrName", "toNativeAttrName", "attrValue", "useRef", "useEffect", "useRef", "useCombinedRefs", "refs", "targetRef", "ref", "useEffect", "hasOwnProperty", "shallowEqual", "objA", "objB", "vVal", "keysA", "keysB", "i", "defaultHasChanged", "obj", "v", "k", "defaultUpdateValue", "useObjectPropEffect", "propName", "propValue", "ref", "updateValue", "hasChanged", "useObjectPropEffect_default", "getEnvPlayerVersion", "player_version", "getPlayerVersion", "MuxPlayerInternal", "React", "children", "props", "ref", "toNativeProps", "useEventCallbackEffect", "type", "callback", "useEffect", "eventTarget", "usePlayer", "onAbort", "onCanPlay", "onCanPlayThrough", "onEmptied", "onLoadStart", "onLoadedData", "onLoadedMetadata", "onProgress", "onDurationChange", "onVolumeChange", "onRateChange", "onResize", "onWaiting", "onPlay", "onPlaying", "onTimeUpdate", "onPause", "onSeeking", "onSeeked", "onStalled", "onSuspend", "onEnded", "onError", "onCuePointChange", "onCuePointsChange", "metadata", "tokens", "paused", "playbackId", "playbackRates", "currentTime", "themeProps", "remainingProps", "useObjectPropEffect_default", "playerEl", "pausedVal", "value", "propName", "defaultHasChanged", "currentTimeVal", "playerSoftwareVersion", "getPlayerVersion", "playerSoftwareName", "MuxPlayer", "innerPlayerRef", "useRef", "playerRef", "useCombinedRefs", "src_default"]
4
+ "sourcesContent": ["import React, { useEffect } from 'react';\nimport type { CSSProperties } from 'react';\nimport type {\n StreamTypes,\n PlaybackTypes,\n CmcdTypes,\n MaxResolutionValue,\n MinResolutionValue,\n RenditionOrderValue,\n} from '@mux/playback-core';\nimport { MaxResolution, MinResolution, RenditionOrder } from '@mux/playback-core';\nimport { MediaError } from '@mux/mux-player';\nimport type MuxPlayerElement from '@mux/mux-player';\nimport type { Tokens, MuxPlayerElementEventMap } from '@mux/mux-player';\nimport { toNativeProps } from './common/utils';\nimport { useRef } from 'react';\nimport { useCombinedRefs } from './useCombinedRefs';\nimport useObjectPropEffect, { defaultHasChanged } from './useObjectPropEffect';\nimport { getPlayerVersion } from './env';\n\nexport { MediaError, MaxResolution, MinResolution, RenditionOrder };\n\ntype ValueOf<T> = T[keyof T];\ninterface GenericEventListener<T extends Event = CustomEvent> {\n (evt: T): void;\n}\n\nexport type MuxPlayerRefAttributes = MuxPlayerElement;\ntype VideoApiAttributes = {\n currentTime: number;\n volume: number;\n paused: boolean;\n src: string | null;\n poster: string;\n playbackRate: number;\n playsInline: boolean;\n preload: string;\n crossOrigin: string;\n autoPlay: boolean | string;\n loop: boolean;\n muted: boolean;\n style: CSSProperties;\n};\n\ntype MuxMediaPropTypes = {\n audio: boolean;\n // envKey: Options[\"data\"][\"env_key\"];\n envKey: string;\n // debug: Options[\"debug\"] & Hls[\"config\"][\"debug\"];\n debug: boolean;\n disableCookies: boolean;\n // metadata: Partial<Options[\"data\"]>;\n metadata: { [k: string]: any };\n beaconCollectionDomain: string;\n customDomain: string;\n playbackId: string;\n preferPlayback: ValueOf<PlaybackTypes> | undefined;\n // NOTE: Explicitly adding deprecated values here for now to avoid fully breaking changes in TS envs (CJP)\n streamType: ValueOf<StreamTypes> | 'll-live' | 'live:dvr' | 'll-live:dvr';\n defaultStreamType: ValueOf<StreamTypes>;\n targetLiveWindow: number;\n startTime: number;\n storyboardSrc: string;\n preferCmcd: ValueOf<CmcdTypes> | undefined;\n children?: React.ReactNode;\n};\n\nexport type MuxPlayerProps = {\n className?: string;\n hotkeys?: string;\n nohotkeys?: boolean;\n defaultHiddenCaptions?: boolean;\n playerSoftwareVersion?: string;\n playerSoftwareName?: string;\n forwardSeekOffset?: number;\n backwardSeekOffset?: number;\n maxResolution?: MaxResolutionValue;\n minResolution?: MinResolutionValue;\n renditionOrder?: RenditionOrderValue;\n metadataVideoId?: string;\n metadataVideoTitle?: string;\n metadataViewerUserId?: string;\n primaryColor?: string;\n secondaryColor?: string;\n accentColor?: string;\n placeholder?: string;\n playbackRates?: number[];\n defaultShowRemainingTime?: boolean;\n noVolumePref?: boolean;\n thumbnailTime?: number;\n title?: string;\n tokens?: Tokens;\n theme?: string;\n themeProps?: { [k: string]: any };\n onAbort?: GenericEventListener<MuxPlayerElementEventMap['abort']>;\n onCanPlay?: GenericEventListener<MuxPlayerElementEventMap['canplay']>;\n onCanPlayThrough?: GenericEventListener<MuxPlayerElementEventMap['canplaythrough']>;\n onEmptied?: GenericEventListener<MuxPlayerElementEventMap['emptied']>;\n onLoadStart?: GenericEventListener<MuxPlayerElementEventMap['loadstart']>;\n onLoadedData?: GenericEventListener<MuxPlayerElementEventMap['loadeddata']>;\n onLoadedMetadata?: GenericEventListener<MuxPlayerElementEventMap['loadedmetadata']>;\n onProgress?: GenericEventListener<MuxPlayerElementEventMap['progress']>;\n onDurationChange?: GenericEventListener<MuxPlayerElementEventMap['durationchange']>;\n onVolumeChange?: GenericEventListener<MuxPlayerElementEventMap['volumechange']>;\n onRateChange?: GenericEventListener<MuxPlayerElementEventMap['ratechange']>;\n onResize?: GenericEventListener<MuxPlayerElementEventMap['resize']>;\n onWaiting?: GenericEventListener<MuxPlayerElementEventMap['waiting']>;\n onPlay?: GenericEventListener<MuxPlayerElementEventMap['play']>;\n onPlaying?: GenericEventListener<MuxPlayerElementEventMap['playing']>;\n onTimeUpdate?: GenericEventListener<MuxPlayerElementEventMap['timeupdate']>;\n onPause?: GenericEventListener<MuxPlayerElementEventMap['pause']>;\n onSeeking?: GenericEventListener<MuxPlayerElementEventMap['seeking']>;\n onSeeked?: GenericEventListener<MuxPlayerElementEventMap['seeked']>;\n onStalled?: GenericEventListener<MuxPlayerElementEventMap['stalled']>;\n onSuspend?: GenericEventListener<MuxPlayerElementEventMap['suspend']>;\n onEnded?: GenericEventListener<MuxPlayerElementEventMap['ended']>;\n onError?: GenericEventListener<MuxPlayerElementEventMap['error']>;\n onCuePointChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointchange']>;\n onCuePointsChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointschange']>;\n // onPlayerReady?: EventListener;\n} & Partial<MuxMediaPropTypes> &\n Partial<VideoApiAttributes>;\n\nconst MuxPlayerInternal = React.forwardRef<MuxPlayerRefAttributes, MuxPlayerProps>(({ children, ...props }, ref) => {\n return React.createElement('mux-player', toNativeProps({ ...props, ref }), children);\n});\n\nconst useEventCallbackEffect = <K extends keyof MuxPlayerElementEventMap>(\n type: K,\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n callback: GenericEventListener<MuxPlayerElementEventMap[K]> | undefined\n) => {\n return useEffect(() => {\n const eventTarget = ref?.current;\n if (!eventTarget || !callback) return;\n eventTarget.addEventListener(type, callback);\n return () => {\n eventTarget.removeEventListener(type, callback);\n };\n }, [ref?.current, callback]);\n};\n\nconst usePlayer = (\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n props: MuxPlayerProps\n) => {\n const {\n onAbort,\n onCanPlay,\n onCanPlayThrough,\n onEmptied,\n onLoadStart,\n onLoadedData,\n onLoadedMetadata,\n onProgress,\n onDurationChange,\n onVolumeChange,\n onRateChange,\n onResize,\n onWaiting,\n onPlay,\n onPlaying,\n onTimeUpdate,\n onPause,\n onSeeking,\n onSeeked,\n onStalled,\n onSuspend,\n onEnded,\n onError,\n onCuePointChange,\n onCuePointsChange,\n // onPlayerReady,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n currentTime,\n themeProps,\n ...remainingProps\n } = props;\n useObjectPropEffect('playbackRates', playbackRates, ref);\n useObjectPropEffect('metadata', metadata, ref);\n useObjectPropEffect('themeProps', themeProps, ref);\n useObjectPropEffect('tokens', tokens, ref);\n useObjectPropEffect('playbackId', playbackId, ref);\n useObjectPropEffect(\n 'paused',\n paused,\n ref,\n (playerEl: HTMLMediaElement, pausedVal?: boolean) => {\n if (pausedVal == null) return;\n if (pausedVal) {\n playerEl.pause();\n } else {\n playerEl.play();\n }\n },\n (playerEl, value, propName) => {\n if (playerEl.hasAttribute('autoplay') && !playerEl.hasPlayed) {\n return false;\n }\n return defaultHasChanged(playerEl, value, propName);\n }\n );\n useObjectPropEffect('currentTime', currentTime, ref, (playerEl: HTMLMediaElement, currentTimeVal?: number) => {\n if (currentTimeVal == null) return;\n playerEl.currentTime = currentTimeVal;\n });\n useEventCallbackEffect('abort', ref, onAbort);\n useEventCallbackEffect('canplay', ref, onCanPlay);\n useEventCallbackEffect('canplaythrough', ref, onCanPlayThrough);\n useEventCallbackEffect('emptied', ref, onEmptied);\n useEventCallbackEffect('loadstart', ref, onLoadStart);\n useEventCallbackEffect('loadeddata', ref, onLoadedData);\n useEventCallbackEffect('loadedmetadata', ref, onLoadedMetadata);\n useEventCallbackEffect('progress', ref, onProgress);\n useEventCallbackEffect('durationchange', ref, onDurationChange);\n useEventCallbackEffect('volumechange', ref, onVolumeChange);\n useEventCallbackEffect('ratechange', ref, onRateChange);\n useEventCallbackEffect('resize', ref, onResize);\n useEventCallbackEffect('waiting', ref, onWaiting);\n useEventCallbackEffect('play', ref, onPlay);\n useEventCallbackEffect('playing', ref, onPlaying);\n useEventCallbackEffect('timeupdate', ref, onTimeUpdate);\n useEventCallbackEffect('pause', ref, onPause);\n useEventCallbackEffect('seeking', ref, onSeeking);\n useEventCallbackEffect('seeked', ref, onSeeked);\n useEventCallbackEffect('stalled', ref, onStalled);\n useEventCallbackEffect('suspend', ref, onSuspend);\n useEventCallbackEffect('ended', ref, onEnded);\n useEventCallbackEffect('error', ref, onError);\n useEventCallbackEffect('cuepointchange', ref, onCuePointChange);\n useEventCallbackEffect('cuepointschange', ref, onCuePointsChange);\n // useEventCallbackEffect('playerready', ref, onPlayerReady);\n return [remainingProps];\n};\n\nconst playerSoftwareVersion = getPlayerVersion();\nconst playerSoftwareName = 'mux-player-react';\n\nconst MuxPlayer = React.forwardRef<\n MuxPlayerRefAttributes,\n Omit<MuxPlayerProps, 'playerSoftwareVersion' | 'playerSoftwareName'>\n>((props, ref) => {\n const innerPlayerRef = useRef<MuxPlayerElement>(null);\n const playerRef = useCombinedRefs(innerPlayerRef, ref);\n const [remainingProps] = usePlayer(innerPlayerRef, props);\n\n return (\n <MuxPlayerInternal\n /** @TODO Fix types relationships (CJP) */\n ref={playerRef as typeof innerPlayerRef}\n playerSoftwareName={playerSoftwareName}\n playerSoftwareVersion={playerSoftwareVersion}\n {...remainingProps}\n />\n );\n});\n\nexport default MuxPlayer;\n", "// NOTE: As a forward-looking implementation, we may want to assume\n// prop names -> attribute names is always a simple name.toLowerCase()\n// and provide a mechanism for passing in per-component overrides for\n// e.g. kebab cases, as that's the way React/Preact handles these. (CJP)\nconst ReactPropToAttrNameMap = {\n className: 'class',\n classname: 'class',\n htmlFor: 'for',\n crossOrigin: 'crossorigin',\n viewBox: 'viewBox',\n playsInline: 'playsinline',\n autoPlay: 'autoplay',\n playbackRate: 'playbackrate',\n};\n\ntype KeyTypes = string | number | symbol;\ntype Maybe<T> = T | null | undefined;\n\nexport const isNil = (x: unknown): x is null | undefined => x == undefined;\n\n// Type Guard to determine if a given key is actually a key of some object of type T\nexport const isKeyOf = <T extends {} = any>(k: KeyTypes, o: Maybe<T>): k is keyof T => {\n if (isNil(o)) return false;\n return k in o;\n};\n\nconst toKebabCase = (string: string) => string.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);\n\nexport const toNativeAttrName = (propName: string, propValue: any): string | undefined => {\n if (typeof propValue === 'boolean' && !propValue) return undefined;\n if (isKeyOf(propName, ReactPropToAttrNameMap)) return ReactPropToAttrNameMap[propName];\n if (typeof propValue == undefined) return undefined;\n if (/[A-Z]/.test(propName)) return toKebabCase(propName);\n return propName;\n};\nexport const toStyleAttr = <T>(x: T) => x;\n\nexport const toNativeAttrValue = (propValue: any, propName: string) => {\n if (typeof propValue === 'boolean') return '';\n return propValue;\n};\n\nexport const toNativeProps = (props = {}) => {\n return Object.entries(props).reduce<{ [k: string]: string }>((transformedProps, [propName, propValue]) => {\n const attrName = toNativeAttrName(propName, propValue);\n\n // prop was stripped. Don't add.\n if (!attrName) {\n return transformedProps;\n }\n\n const attrValue = toNativeAttrValue(propValue, propName);\n transformedProps[attrName] = attrValue;\n return transformedProps;\n }, {});\n};\n", "import { useEffect, useRef } from 'react';\nimport type { MutableRefObject, ForwardedRef } from 'react';\n\ntype Maybe<T> = T | null | undefined;\ntype RefCb<T> = (instance: Maybe<T>) => void;\ntype RefObj<T> = MutableRefObject<Maybe<T>>;\ntype RefTypes<T> = RefObj<T> | RefCb<T> | ForwardedRef<T>;\ninterface useCombinedRefs {\n <T>(...refs: Maybe<RefTypes<T>>[]): RefObj<T>;\n}\n\nexport const useCombinedRefs: useCombinedRefs = (...refs) => {\n const targetRef = useRef(null);\n\n useEffect(() => {\n refs.forEach((ref) => {\n if (!ref) return;\n\n if (typeof ref === 'function') {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n });\n }, [refs]);\n\n return targetRef;\n};\n\n// TS assumed default export was interface def instead of function value (CJP)\nconst defaultUseCombinedRefs = useCombinedRefs;\nexport default defaultUseCombinedRefs;\n", "import { useEffect } from 'react';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Slightly modified version of React's shallowEqual, with optimizations for Arrays\n * so we may treat them specifically as unequal if they are not a) both arrays\n * or b) don't contain the same (shallowly compared) elements.\n */\nconst shallowEqual = (objA: any, objB: any): boolean => {\n if (Object.is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n if (Array.isArray(objA)) {\n // Early \"cheap\" array compares\n if (!Array.isArray(objB) || objA.length !== objB.length) return false;\n // Shallow compare for arrays\n return objA.some((vVal, i) => objB[i] === vVal);\n }\n\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (let i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const defaultHasChanged = (obj: any, v: any, k: string) => {\n return !shallowEqual(v, obj[k]);\n};\n\nconst defaultUpdateValue = (obj: any, v: any, k: string) => {\n obj[k] = v;\n};\n\nexport const useObjectPropEffect = <T extends { [k: string]: any }, V>(\n propName: string,\n propValue: V | null | undefined,\n ref: React.MutableRefObject<T | null> | null | undefined,\n updateValue = defaultUpdateValue,\n hasChanged = defaultHasChanged\n) => {\n return useEffect(() => {\n const obj = ref?.current;\n if (!obj) return;\n if (!hasChanged(obj, propValue, propName)) return;\n updateValue(obj, propValue, propName);\n }, [ref?.current, propValue]);\n};\n\nexport default useObjectPropEffect;\n", "const getEnvPlayerVersion = () => {\n try {\n // @ts-ignore\n return PLAYER_VERSION as string;\n } catch {}\n return 'UNKNOWN';\n};\n\nconst player_version: string = getEnvPlayerVersion();\n\nexport const getPlayerVersion = () => player_version;\n"],
5
+ "mappings": "AAAA,OAAOA,GAAS,aAAAC,OAAiB,QAUjC,OAAS,iBAAAC,GAAe,iBAAAC,GAAe,kBAAAC,OAAsB,qBAC7D,OAAS,cAAAC,OAAkB,kBCP3B,IAAMC,EAAyB,CAC7B,UAAW,QACX,UAAW,QACX,QAAS,MACT,YAAa,cACb,QAAS,UACT,YAAa,cACb,SAAU,WACV,aAAc,cAChB,EAKaC,EAASC,GAAsCA,GAAK,KAGpDC,EAAU,CAAqBC,EAAaC,IACnDJ,EAAMI,CAAC,EAAU,GACdD,KAAKC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GACpB,sBAAuBF,GACtB,GAAGR,EACN,CAEJ,CAAC,EAEMgB,GAAQL",
6
+ "names": ["React", "useEffect", "MaxResolution", "MinResolution", "RenditionOrder", "MediaError", "ReactPropToAttrNameMap", "isNil", "x", "isKeyOf", "k", "o", "toKebabCase", "string", "match", "toNativeAttrName", "propName", "propValue", "toNativeAttrValue", "propValue", "propName", "toNativeProps", "props", "transformedProps", "attrName", "toNativeAttrName", "attrValue", "useRef", "useEffect", "useRef", "useCombinedRefs", "refs", "targetRef", "ref", "useEffect", "hasOwnProperty", "shallowEqual", "objA", "objB", "vVal", "keysA", "keysB", "i", "defaultHasChanged", "obj", "v", "k", "defaultUpdateValue", "useObjectPropEffect", "propName", "propValue", "ref", "updateValue", "hasChanged", "useObjectPropEffect_default", "getEnvPlayerVersion", "player_version", "getPlayerVersion", "MuxPlayerInternal", "React", "children", "props", "ref", "toNativeProps", "useEventCallbackEffect", "type", "callback", "useEffect", "eventTarget", "usePlayer", "onAbort", "onCanPlay", "onCanPlayThrough", "onEmptied", "onLoadStart", "onLoadedData", "onLoadedMetadata", "onProgress", "onDurationChange", "onVolumeChange", "onRateChange", "onResize", "onWaiting", "onPlay", "onPlaying", "onTimeUpdate", "onPause", "onSeeking", "onSeeked", "onStalled", "onSuspend", "onEnded", "onError", "onCuePointChange", "onCuePointsChange", "metadata", "tokens", "paused", "playbackId", "playbackRates", "currentTime", "themeProps", "remainingProps", "useObjectPropEffect_default", "playerEl", "pausedVal", "value", "propName", "defaultHasChanged", "currentTimeVal", "playerSoftwareVersion", "getPlayerVersion", "playerSoftwareName", "MuxPlayer", "innerPlayerRef", "useRef", "playerRef", "useCombinedRefs", "src_default"]
7
7
  }
package/dist/lazy.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import o,{useEffect as h,useState as k}from"react";import i,{Suspense as y}from"react";var m=({condition:t,fallback:r,children:n,...e})=>t?i.createElement(y,{fallback:r,...e},n):i.createElement(i.Fragment,null,r),c=m;import{useState as f,useEffect as b}from"react";var x=()=>{let[t,r]=f(!1);return b(()=>{typeof window!="undefined"&&r(!0)},[]),t},p=x;import{useState as P,useEffect as I}from"react";var g=(t,r)=>{let[n,e]=P(!1);return I(()=>{if(typeof IntersectionObserver=="function"){let a=new IntersectionObserver(([s])=>{e(s.isIntersecting)},r);return t.current&&a.observe(t.current),()=>{a.disconnect()}}},[t,r]),n},u=g;var M=o.lazy(()=>import("./-OJ5ZWKIA.mjs")),v=t=>{let{style:r,className:n,onIntersection:e,placeholder:a}=t,s=o.useRef(null),l=u(s);return h(()=>{l&&e&&e()},[l,e]),o.createElement(o.Fragment,null,o.createElement("mux-player",{ref:s,"data-mux-player-react-lazy-placeholder":!0,placeholder:a,style:{"--mux-player-react-lazy-placeholder":a?`url(${a});`:"",...r},className:n||"",nohotkeys:!0,"aria-hidden":!0,tabIndex:-1},o.createElement("div",{"data-mux-player-react-lazy-placeholder-overlay":!0})),o.createElement("style",null,`
1
+ import o,{useEffect as h,useState as k}from"react";import i,{Suspense as y}from"react";var m=({condition:t,fallback:r,children:n,...e})=>t?i.createElement(y,{fallback:r,...e},n):i.createElement(i.Fragment,null,r),c=m;import{useState as f,useEffect as b}from"react";var x=()=>{let[t,r]=f(!1);return b(()=>{typeof window!="undefined"&&r(!0)},[]),t},p=x;import{useState as P,useEffect as I}from"react";var g=(t,r)=>{let[n,e]=P(!1);return I(()=>{if(typeof IntersectionObserver=="function"){let a=new IntersectionObserver(([s])=>{e(s.isIntersecting)},r);return t.current&&a.observe(t.current),()=>{a.disconnect()}}},[t,r]),n},u=g;var M=o.lazy(()=>import("./-FXSRSRTV.mjs")),v=t=>{let{style:r,className:n,onIntersection:e,placeholder:a}=t,s=o.useRef(null),l=u(s);return h(()=>{l&&e&&e()},[l,e]),o.createElement(o.Fragment,null,o.createElement("mux-player",{ref:s,"data-mux-player-react-lazy-placeholder":!0,placeholder:a,style:{"--mux-player-react-lazy-placeholder":a?`url(${a});`:"",...r},className:n||"",nohotkeys:!0,"aria-hidden":!0,tabIndex:-1},o.createElement("div",{"data-mux-player-react-lazy-placeholder-overlay":!0})),o.createElement("style",null,`
2
2
  mux-player[data-mux-player-react-lazy-placeholder] {
3
3
  aspect-ratio: 16/9;
4
4
  display: block;
@@ -1 +1 @@
1
- {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/typescript/lib/lib.scripthost.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2019.full.d.ts","../../../node_modules/@types/react/global.d.ts","../../../node_modules/csstype/index.d.ts","../../../node_modules/@types/prop-types/index.d.ts","../../../node_modules/@types/scheduler/tracing.d.ts","../../../node_modules/@types/react/index.d.ts","../src/ConditionalSuspense.tsx","../src/env.ts","../../../node_modules/hls.js/dist/hls.js.d.ts","../../playback-core/dist/types/mux-embed.d.ts","../../playback-core/dist/types/hls.d.ts","../../playback-core/dist/types/errors.d.ts","../../../node_modules/media-tracks/dist/types/video-rendition.d.ts","../../../node_modules/media-tracks/dist/types/video-track.d.ts","../../../node_modules/media-tracks/dist/types/video-track-list.d.ts","../../../node_modules/media-tracks/dist/types/audio-rendition.d.ts","../../../node_modules/media-tracks/dist/types/audio-track.d.ts","../../../node_modules/media-tracks/dist/types/audio-track-list.d.ts","../../../node_modules/media-tracks/dist/types/video-rendition-list.d.ts","../../../node_modules/media-tracks/dist/types/audio-rendition-list.d.ts","../../../node_modules/media-tracks/dist/types/mixin.d.ts","../../../node_modules/media-tracks/dist/types/track-event.d.ts","../../../node_modules/media-tracks/dist/types/rendition-event.d.ts","../../../node_modules/media-tracks/dist/types/index.d.ts","../../playback-core/dist/types/types.d.ts","../../playback-core/dist/types/text-tracks.d.ts","../../playback-core/dist/types/pdt.d.ts","../../playback-core/dist/types/index.d.ts","../../../node_modules/media-chrome/dist/constants.d.ts","../../../node_modules/media-chrome/dist/labels/labels.d.ts","../../../node_modules/media-chrome/dist/utils/time.d.ts","../../../node_modules/media-chrome/dist/media-chrome-button.d.ts","../../../node_modules/media-chrome/dist/media-airplay-button.d.ts","../../../node_modules/media-chrome/dist/media-cast-button.d.ts","../../../node_modules/media-chrome/dist/media-gesture-receiver.d.ts","../../../node_modules/media-chrome/dist/media-container.d.ts","../../../node_modules/media-chrome/dist/utils/attribute-token-list.d.ts","../../../node_modules/media-chrome/dist/media-controller.d.ts","../../../node_modules/media-chrome/dist/media-chrome-range.d.ts","../../../node_modules/media-chrome/dist/media-control-bar.d.ts","../../../node_modules/media-chrome/dist/media-text-display.d.ts","../../../node_modules/media-chrome/dist/media-duration-display.d.ts","../../../node_modules/media-chrome/dist/media-time-display.d.ts","../../../node_modules/media-chrome/dist/media-captions-button.d.ts","../../../node_modules/media-chrome/dist/media-seek-forward-button.d.ts","../../../node_modules/media-chrome/dist/media-fullscreen-button.d.ts","../../../node_modules/media-chrome/dist/media-live-button.d.ts","../../../node_modules/media-chrome/dist/media-mute-button.d.ts","../../../node_modules/media-chrome/dist/media-pip-button.d.ts","../../../node_modules/media-chrome/dist/media-play-button.d.ts","../../../node_modules/media-chrome/dist/media-playback-rate-button.d.ts","../../../node_modules/media-chrome/dist/media-poster-image.d.ts","../../../node_modules/media-chrome/dist/media-seek-backward-button.d.ts","../../../node_modules/media-chrome/dist/media-preview-time-display.d.ts","../../../node_modules/media-chrome/dist/media-preview-thumbnail.d.ts","../../../node_modules/media-chrome/dist/media-time-range.d.ts","../../../node_modules/media-chrome/dist/media-loading-indicator.d.ts","../../../node_modules/media-chrome/dist/media-volume-range.d.ts","../../../node_modules/media-chrome/dist/index.d.ts","../../../node_modules/media-chrome/dist/experimental/media-chrome-listbox.d.ts","../../../node_modules/media-chrome/dist/experimental/media-chrome-option.d.ts","../../../node_modules/media-chrome/dist/experimental/media-chrome-selectmenu.d.ts","../../../node_modules/media-chrome/dist/experimental/media-captions-listbox.d.ts","../../../node_modules/media-chrome/dist/experimental/media-captions-selectmenu.d.ts","../../../node_modules/media-chrome/dist/experimental/media-playback-rate-listbox.d.ts","../../../node_modules/media-chrome/dist/experimental/media-playback-rate-selectmenu.d.ts","../../../node_modules/media-chrome/dist/experimental/media-rendition-listbox.d.ts","../../../node_modules/media-chrome/dist/experimental/media-rendition-selectmenu.d.ts","../../../node_modules/media-chrome/dist/experimental/media-audio-track-listbox.d.ts","../../../node_modules/media-chrome/dist/experimental/media-audio-track-selectmenu.d.ts","../../../node_modules/media-chrome/dist/experimental/index.d.ts","../../../node_modules/custom-media-element/custom-media-element.d.ts","../../mux-video/dist/types/index.d.ts","../../mux-player/dist/types/polyfills/index.d.ts","../../mux-player/dist/types/video-api.d.ts","../../mux-player/dist/types/helpers.d.ts","../../../node_modules/media-chrome/dist/utils/template-parts.d.ts","../../../node_modules/media-chrome/dist/media-theme-element.d.ts","../../mux-player/dist/types/themes/gerwig/index.d.ts","../../mux-player/dist/types/index.d.ts","../src/common/utils.ts","../src/useCombinedRefs.ts","../src/useObjectPropEffect.ts","../src/index.tsx","../src/useIsBrowser.ts","../src/useIsIntersecting.ts","../src/lazy.tsx","../src/themes/classic.ts","../src/themes/gerwig.ts","../src/themes/microvideo.ts","../src/themes/minimal.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18",{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true},{"version":"f3d4da15233e593eacb3965cde7960f3fddf5878528d882bcedd5cbaba0193c7","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},"1f03b495671c3a1bd24510f38b8947f0991dfd6bf0278c68eca14af15b306e1f",{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"1c29793071152b207c01ea1954e343be9a44d85234447b2b236acae9e709a383","6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"facb3daa9cb4215070b5662409638ac826681c208d701e96efe9b731d0ec39ee","affectsGlobalScope":true},{"version":"6d3aae02e573b4424749a17ecde853c18195fd6f08297da64aa7fff2057bb7c9","signature":"1cf7f7233499f56ea5b399b0b53edfe0367fcb6caf5b235b873d9f3f9e5d6a16"},{"version":"a6b7e3c103b4424b9c9d6dce7f059c16bbf037844b9f418775b86506d3d141d4","signature":"91c076ae465392962257aca34e4bf13640363d6cca8e0636d5cda95c890951e9"},"54332f5adc7aa4b215fe1895f96c16218813d37348c7236d343c53d30dbc159f",{"version":"6ff45ab1a5c3f32638dd1131cc94ecd68f11566363ea16dca3c8a7d556a81bbb","affectsGlobalScope":true},"c13fb8c7fdb84f3c59470c672220c380ac26ffb099721ccebba3c53971cb700d","de64daa4e510abaaf4b4970c6dd37e39c3b8a263cccbeb80a41c69ae5a2a34ba","2ed351b90f48ecae9c627d41e2614c6a4fe670f958e8a5a5d3bb4bc21980bdb6","8f358619bbe2b132a373c5e8381018bb1f11f55dbac8cb84c380d5279f18eb75","ba0b6859e73b5fb85f18160a3b0d741968b1c4122fdd3436398dc99a6a9736c9","9979bad516454ac2aaff1756fc7f664ca6ccfdd9b4077f306e99df3033edf0a2","323cfa8826348d6f5269abeed193b53c1ee351a9c178858bce4dee6e9b6c3ac9","24354cb3bc1d897f8321bce628352612d35d92a79dba42e6609f7f5ec7d3a697","2ad77fd12d9bf99057909e40fecb502cb4429c617161f373339f294dfaa5d6f5","8e4de702297e7c9173982f2e1af6bb29b5a0251811ac12de6beb48dba2288a9f",{"version":"f00052d58fca55867ac607515a29de91e6906fe5c999bf9eab49448bbf233519","affectsGlobalScope":true},"d86abfe8b121d0296f860e2165d243a46895e6a7fd089bc7fff4e779131acc15","f9955a6b47c6f2608087b111dca772554ef89d1ed302990104574f7cee41cb05","710bfef6f0be756ddb857985b7dd5d0cc831c67b6bdfbd1179b7dc4457819ff7","a95ce49b7c1a327fb5b9ace91c75482e0536bf00d69ac846681c5dc7e79275c3","8f34e5a4d2235a6c3748bb35a1774f322e745ac9b68e328f3263ec05d6ed926e","dccea7b665fe08ed006acd191a7e68123ba7ec49848ac7c28a164962bf21254e","fb6859c4c46487675e74e4b2ba21d509473d30b9e72efb05716da3ae69ab9e65","845ca84509510b2de25a391a6827b34159f19b806f29394bde1a20063fdcd7d4","1bca2772bfe6da518ab061f96c01d7d71485b9afe80ea04048d468b6f081889c","5e5782f6925aa6e0d6bce51846e387f44e34b13433b41724ab4bd0073c1b2068","779582ae7e3e16d96393d0ab1048188cd06eb2077127435b6cd482cceb7e6a3e","8ec8cc42974e470fa2768b688d942fad92d7e7e1d34a7f86ed07002bb949e09c","ce43de54f2637c1b47944e24c983e891638a3dfa802fc0d8abc40d4e976a3468","5944b5e138f0bfc9d8632ae755447a222ee1bae5e691f95f964155c742e7fc55","5e48e3a7af2d1a99bf6db1d2d81ff07a7a4c8964e2a4dc8b63561cd5b625f5dc","af6673ff7d61e468206445654735d6d75de5fd4df5a867ed34fc48c76105f534","9dd11239586fd0a324b5ad3eb012d830f0f6ac9b4ae7755ce624d962347bf5ac","2c5398a6e7fd82deecfa4ee93522351b0f12569c076c32c00b258fd7f960dbc7","3d45de32dd9a40289168a5dd02723a1bef365cf1ad181238d4cb5c0c8d251b15","61fe41f126c499a22b4ccb031402298d80d85e581fc491b45dadb916c45858d7","e02cb6cd62d5c1b91a37fc85dc4bf6d4a9ada21d43063fe4c3350544e804c5e5","021cf30079a41551deca6cf22a6e6447e98e3bac50254c7e610c97428f969285","1caf9e59fb74032a9c1b48a4ad9cfb67bc870a51eff0c5459225bfd9adc92356","d5baeacd8b2a19238067bb8dd2349bb7b21bd4f483a3cf3a513a1da8845a858e","46405387737f0730b5efa6a271386a0357bf833c0940dfe7023fcd796e3eb269","21a74057837664858b9e501dce325ea2c16c4009a3f8fa03841155182081eaef","1bea2c7ec5efef5f89cc6b40de1029b22e959ade5364ab8af32cce741a160a93","0d8f583a1845b587b219aaeb26c964b20f5dd06e3cbd173de3fa883cded0a2e8","a18c0c85734df82f49e58da49ecdfba83c7a9b2eec84ad1ebc4b990ac2c21c69","fa22a5101aba0c01f6d17b0840eade09ed15080a520a365303b5a2bd5b5d251d","d915f8caea7edb7cf74c66acc25f2542f204e9681e0adeda6ecb37f06bb8565c","0c044bac5d0f050328792a948845695913878ea72e25eeef980ef7774a85339e","fdc69fed0d27eb9e587a5e239a0b2cd395d3db867c640acfabd9b15eabe40349","15aa0c97eeb7e96e90ab1a2bd6322a2c77732ee5d3b0e673f3089f6ee2025e00","f496344b5f5b3e031ded1dcf7c27b0a06dfd8835953c9e246a526adbb15997d8","163123dd1f14c0c3216ed7d67601c6fb71e369c72643c9864a23f9d7cf2ca8bb","5e84c097e89491388284a6c629c8321fa07a7823367065c9399afa159b69f717","bd2c8463d331853f4fdea2785d2ccea617ec9f6fd616265177b17a5f98daa390","725eb41864b2c7e1395aa39287c17afa535733f614474304e9ca70863490b761","de0a1dd63b44f8aac7859330a0ac0d1e050e58fe898733a046bfe4969c300d50","553c002ab2998aa64cff676ef39ed54e557c793ba22a9d3cbf8a698dd0dde6aa","848aa410ea954835a59e06986c92c987166eff642b7c59b3232807a0a82b52f1","2391afe5ddc0ae68b9a117ed5a1a6b26f5ba484524edeb5108a6671bc4da41ab","39ed86c3b1a04255e4edee466f35cad837b6125bcb0930291095533265a0ccc4","1ce3c53099fbde6273c6ff4c774b2402a31160085c9882a3e803a0fd2a84e3d5","21e4691d6dfa0155d8e11b30a32231f6e33d684cbd61dd7499392b39fd9c68e5","98803688adaa2230d90a3514754aca936b3e4df1915475b6d4a0a65e141be8c3","9272ff556abd50bb2dcdc71021fffea831a45f0c4169bec6f4ada3e9dc01b494","b96a043c9943dba15c1c263666730efaf29ad8fb5c33479173bda6329da158cc","19004996c8f722db5a158a505de181ce42884d780ff2e1307e4c1c43b5684fcc","0f599eee61efba479f48f6c97d809ccf2312296a406395678fe6cb64213b3711",{"version":"bbfb3a34e5a42dad6c71e273891691a58edceafd543757d118295fd7bf12c986","affectsGlobalScope":true},"2f39ccc3f2cad7f2a1e0ad14a744877ed08dae4ae75510109ac981ceb783b566","8f2162398fdfec4d2598d0e272c9dcbe6da483129365f5bc1d2a42739a17be1e","68b73a50106aa0c13f5c8c0b47aee3e5b7e788ce2ba1042fdf944781fcbea619","6775df6b9852c7af5dbdc7ae64a0865f0b699b0927074a610261852c58927646","b69bc6279522c19db5564fdccfaec94d7dd06781a2a908a9986b766bddc91a83","f6bda70e10a8b240d52a4b7a8f488cef7768d9c0d7c13677f7982bf1610e6016","1739aa2196109fd53b9aa15930885c1dd3552dc6c4afa8110b99bad912c395fd",{"version":"498d6a91f4bbfbd412e928a5fd6306d98a8b8b49c334b3ef1b1dccd8ec327e2f","signature":"d84a480259a7bda3cd794ab264e29fda120eb72c8c9270396a584479bf5b827f"},{"version":"f21932f853b3dbd3949e14c7d31d2dcfba3418c5de50878884a54cf0ba14e904","signature":"014089c3590328e311f0651db51765945a630df49cccfaf71c884d53bafd70d2"},{"version":"721526438283d40d50c6356064d346f1c57693f7e9930a3854c20c73bf4380a5","signature":"066053c842a2d9edb616d9c88dab6b19eaf8f4630bf862c774d0d6cc98c62a91"},{"version":"ad42ccd0ae1eb167b60709d7c5451131b3be423406815f7285007aacd78dfcb9","signature":"470eccc69d0f7028139961b8feba08ae59fc2494691fc1396bff7860ece59e36"},{"version":"c7e2e472d0ba77ba41adc2422d0fb7e3eeada664eda67fbf2d1820cf6f9d49d5","signature":"d8697925fd69925c68732d55ed14c69c38bd4435b91355e974797c6f11685ee5"},{"version":"3afe879128eb0bc263123450b8211b56d7afba72c95e820cb51224fe661546b1","signature":"536ccb1a38a39569293fde322adb7b936d9a8bf81984d675bbba6e57c6569ca9"},{"version":"1989109e17e2c0b521786c4a779fda6f9c1822264dd2801dc8174e05fc4f44b8","signature":"d0466ccb6aa67bd7249306fd3cc3cc47ae0dede5826abdbfcf6c00f3667b9a65","affectsGlobalScope":true},{"version":"1bcc5ca3c413ce5845cd517fa12e791b057bed923bc66f7e4df4444e12a728dc","signature":"5a026523580a8d1a300ac0cbf514fe18ba0c1a2b833dfbc70489f98000f4a6b6"},{"version":"b68310896d0f29ac05154ac294c5d0ed417208d843f96b50af9f292aed5f5c4a","signature":"e3212c9c6c3810ecf4717ebba997ba5c14f72a5b2aaa08eefe64624c3b26abe5"},{"version":"b1b361cc38ccd9ea9ec35c5ecd537cda883ffb8e142112a4e57721f26b0b9e55","signature":"e5fa2fa2c4814d6fbbf98397afd77fa0f1a6dff2ba1fdc6de6ca35180f433a56"},{"version":"0255ebaaf6d387d6b31870d466ba42dbc1d4edc2a11b7c96bbd5b0aef025622e","signature":"eccacd5847f9abe6711b5f24b4b485f3a80bb12b98bbb4a3cbe9c66a4fbc1a8e"}],"options":{"composite":true,"declaration":true,"emitDeclarationOnly":true,"esModuleInterop":true,"jsx":2,"module":6,"noImplicitAny":true,"outDir":"./types","rootDir":"../src","skipLibCheck":false,"sourceMap":true,"strict":true,"target":6},"fileIdsList":[[37,38,39,40],[95,96,97,98,99,100,101,102,103,104,105],[95],[97],[72,95],[64,65,66,67,68,69,70,73,74,75,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],[67],[71,72],[76],[67,72],[112],[74],[51,52],[52],[51],[48,49,50,51,52,53,54,55,56,57,58],[49,50,52,53,54,55],[48,51],[49,52],[48,49],[49],[48],[41],[41,43,63,115,116,117,118],[41,42,63,119,120,121],[63],[63,94,106,108,110,111,114],[113],[59,108,109],[63,107],[44],[45,46,47,60,61,62],[60],[46,60],[45,46,47,59],[41,63,115],[41,63,115,119]],"referencedMap":[[41,1],[106,2],[104,3],[105,4],[98,3],[99,4],[100,5],[101,4],[102,3],[103,4],[94,6],[68,7],[79,7],[69,7],[73,8],[77,9],[81,7],[82,7],[83,7],[84,7],[85,7],[86,10],[89,9],[88,7],[80,7],[113,11],[78,9],[91,12],[93,12],[55,13],[53,14],[52,15],[59,16],[56,17],[58,18],[57,19],[54,20],[50,21],[49,22],[42,23],[119,24],[122,25],[117,23],[120,23],[121,23],[118,23],[111,26],[115,27],[114,28],[110,29],[108,30],[46,31],[63,32],[45,31],[62,33],[61,34],[60,35]],"exportedModulesMap":[[41,1],[106,2],[104,3],[105,4],[98,3],[99,4],[100,5],[101,4],[102,3],[103,4],[94,6],[68,7],[79,7],[69,7],[73,8],[77,9],[81,7],[82,7],[83,7],[84,7],[85,7],[86,10],[89,9],[88,7],[80,7],[113,11],[78,9],[91,12],[93,12],[55,13],[53,14],[52,15],[59,16],[56,17],[58,18],[57,19],[54,20],[50,21],[49,22],[42,23],[119,36],[122,37],[117,23],[118,23],[111,26],[115,27],[114,28],[110,29],[108,30],[46,31],[63,32],[45,31],[62,33],[61,34],[60,35]],"semanticDiagnosticsPerFile":[39,37,41,40,38,107,44,64,106,104,105,98,99,95,96,97,100,101,102,103,94,65,68,79,69,67,74,71,75,73,77,81,70,82,92,83,84,85,86,87,90,89,88,80,76,113,78,91,93,72,112,66,55,51,53,52,59,56,58,57,54,48,50,49,7,8,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,36,35,32,33,34,1,10,9,42,116,43,119,122,123,124,125,126,117,120,121,118,111,115,109,114,110,108,47,46,63,45,62,61,60],"latestChangedDtsFile":"./types/themes/minimal.d.ts"},"version":"4.9.4"}
1
+ {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/typescript/lib/lib.scripthost.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2019.full.d.ts","../../../node_modules/@types/react/global.d.ts","../../../node_modules/csstype/index.d.ts","../../../node_modules/@types/prop-types/index.d.ts","../../../node_modules/@types/scheduler/tracing.d.ts","../../../node_modules/@types/react/index.d.ts","../src/ConditionalSuspense.tsx","../src/env.ts","../../../node_modules/hls.js/dist/hls.js.d.ts","../../playback-core/dist/types/mux-embed.d.ts","../../playback-core/dist/types/hls.d.ts","../../playback-core/dist/types/errors.d.ts","../../../node_modules/media-tracks/dist/types/video-rendition.d.ts","../../../node_modules/media-tracks/dist/types/video-track.d.ts","../../../node_modules/media-tracks/dist/types/video-track-list.d.ts","../../../node_modules/media-tracks/dist/types/audio-rendition.d.ts","../../../node_modules/media-tracks/dist/types/audio-track.d.ts","../../../node_modules/media-tracks/dist/types/audio-track-list.d.ts","../../../node_modules/media-tracks/dist/types/video-rendition-list.d.ts","../../../node_modules/media-tracks/dist/types/audio-rendition-list.d.ts","../../../node_modules/media-tracks/dist/types/mixin.d.ts","../../../node_modules/media-tracks/dist/types/track-event.d.ts","../../../node_modules/media-tracks/dist/types/rendition-event.d.ts","../../../node_modules/media-tracks/dist/types/index.d.ts","../../playback-core/dist/types/types.d.ts","../../playback-core/dist/types/text-tracks.d.ts","../../playback-core/dist/types/pdt.d.ts","../../playback-core/dist/types/index.d.ts","../../../node_modules/media-chrome/dist/constants.d.ts","../../../node_modules/media-chrome/dist/labels/labels.d.ts","../../../node_modules/media-chrome/dist/utils/time.d.ts","../../../node_modules/media-chrome/dist/media-chrome-button.d.ts","../../../node_modules/media-chrome/dist/media-airplay-button.d.ts","../../../node_modules/media-chrome/dist/media-cast-button.d.ts","../../../node_modules/media-chrome/dist/media-gesture-receiver.d.ts","../../../node_modules/media-chrome/dist/media-container.d.ts","../../../node_modules/media-chrome/dist/utils/attribute-token-list.d.ts","../../../node_modules/media-chrome/dist/media-controller.d.ts","../../../node_modules/media-chrome/dist/media-chrome-range.d.ts","../../../node_modules/media-chrome/dist/media-control-bar.d.ts","../../../node_modules/media-chrome/dist/media-text-display.d.ts","../../../node_modules/media-chrome/dist/media-duration-display.d.ts","../../../node_modules/media-chrome/dist/media-time-display.d.ts","../../../node_modules/media-chrome/dist/media-captions-button.d.ts","../../../node_modules/media-chrome/dist/media-seek-forward-button.d.ts","../../../node_modules/media-chrome/dist/media-fullscreen-button.d.ts","../../../node_modules/media-chrome/dist/media-live-button.d.ts","../../../node_modules/media-chrome/dist/media-mute-button.d.ts","../../../node_modules/media-chrome/dist/media-pip-button.d.ts","../../../node_modules/media-chrome/dist/media-play-button.d.ts","../../../node_modules/media-chrome/dist/media-playback-rate-button.d.ts","../../../node_modules/media-chrome/dist/media-poster-image.d.ts","../../../node_modules/media-chrome/dist/media-seek-backward-button.d.ts","../../../node_modules/media-chrome/dist/media-preview-time-display.d.ts","../../../node_modules/media-chrome/dist/media-preview-thumbnail.d.ts","../../../node_modules/media-chrome/dist/media-time-range.d.ts","../../../node_modules/media-chrome/dist/media-loading-indicator.d.ts","../../../node_modules/media-chrome/dist/media-volume-range.d.ts","../../../node_modules/media-chrome/dist/index.d.ts","../../../node_modules/media-chrome/dist/experimental/media-chrome-listbox.d.ts","../../../node_modules/media-chrome/dist/experimental/media-chrome-option.d.ts","../../../node_modules/media-chrome/dist/experimental/media-chrome-selectmenu.d.ts","../../../node_modules/media-chrome/dist/experimental/media-captions-listbox.d.ts","../../../node_modules/media-chrome/dist/experimental/media-captions-selectmenu.d.ts","../../../node_modules/media-chrome/dist/experimental/media-playback-rate-listbox.d.ts","../../../node_modules/media-chrome/dist/experimental/media-playback-rate-selectmenu.d.ts","../../../node_modules/media-chrome/dist/experimental/media-rendition-listbox.d.ts","../../../node_modules/media-chrome/dist/experimental/media-rendition-selectmenu.d.ts","../../../node_modules/media-chrome/dist/experimental/media-audio-track-listbox.d.ts","../../../node_modules/media-chrome/dist/experimental/media-audio-track-selectmenu.d.ts","../../../node_modules/media-chrome/dist/experimental/index.d.ts","../../../node_modules/custom-media-element/custom-media-element.d.ts","../../mux-video/dist/types/index.d.ts","../../mux-player/dist/types/polyfills/index.d.ts","../../mux-player/dist/types/video-api.d.ts","../../mux-player/dist/types/helpers.d.ts","../../../node_modules/media-chrome/dist/utils/template-parts.d.ts","../../../node_modules/media-chrome/dist/media-theme-element.d.ts","../../mux-player/dist/types/themes/gerwig/index.d.ts","../../mux-player/dist/types/index.d.ts","../src/common/utils.ts","../src/useCombinedRefs.ts","../src/useObjectPropEffect.ts","../src/index.tsx","../src/useIsBrowser.ts","../src/useIsIntersecting.ts","../src/lazy.tsx","../src/themes/classic.ts","../src/themes/gerwig.ts","../src/themes/microvideo.ts","../src/themes/minimal.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18",{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true},{"version":"f3d4da15233e593eacb3965cde7960f3fddf5878528d882bcedd5cbaba0193c7","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},"1f03b495671c3a1bd24510f38b8947f0991dfd6bf0278c68eca14af15b306e1f",{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"1c29793071152b207c01ea1954e343be9a44d85234447b2b236acae9e709a383","6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"facb3daa9cb4215070b5662409638ac826681c208d701e96efe9b731d0ec39ee","affectsGlobalScope":true},{"version":"6d3aae02e573b4424749a17ecde853c18195fd6f08297da64aa7fff2057bb7c9","signature":"1cf7f7233499f56ea5b399b0b53edfe0367fcb6caf5b235b873d9f3f9e5d6a16"},{"version":"a6b7e3c103b4424b9c9d6dce7f059c16bbf037844b9f418775b86506d3d141d4","signature":"91c076ae465392962257aca34e4bf13640363d6cca8e0636d5cda95c890951e9"},"54332f5adc7aa4b215fe1895f96c16218813d37348c7236d343c53d30dbc159f",{"version":"6ff45ab1a5c3f32638dd1131cc94ecd68f11566363ea16dca3c8a7d556a81bbb","affectsGlobalScope":true},"c13fb8c7fdb84f3c59470c672220c380ac26ffb099721ccebba3c53971cb700d","de64daa4e510abaaf4b4970c6dd37e39c3b8a263cccbeb80a41c69ae5a2a34ba","2ed351b90f48ecae9c627d41e2614c6a4fe670f958e8a5a5d3bb4bc21980bdb6","8f358619bbe2b132a373c5e8381018bb1f11f55dbac8cb84c380d5279f18eb75","ba0b6859e73b5fb85f18160a3b0d741968b1c4122fdd3436398dc99a6a9736c9","9979bad516454ac2aaff1756fc7f664ca6ccfdd9b4077f306e99df3033edf0a2","323cfa8826348d6f5269abeed193b53c1ee351a9c178858bce4dee6e9b6c3ac9","24354cb3bc1d897f8321bce628352612d35d92a79dba42e6609f7f5ec7d3a697","2ad77fd12d9bf99057909e40fecb502cb4429c617161f373339f294dfaa5d6f5","8e4de702297e7c9173982f2e1af6bb29b5a0251811ac12de6beb48dba2288a9f",{"version":"f00052d58fca55867ac607515a29de91e6906fe5c999bf9eab49448bbf233519","affectsGlobalScope":true},"d86abfe8b121d0296f860e2165d243a46895e6a7fd089bc7fff4e779131acc15","f9955a6b47c6f2608087b111dca772554ef89d1ed302990104574f7cee41cb05","710bfef6f0be756ddb857985b7dd5d0cc831c67b6bdfbd1179b7dc4457819ff7","78619e384443d0416802f8f051ad3f84ab1d72069308ecdd097e32dcaed1077e","8f34e5a4d2235a6c3748bb35a1774f322e745ac9b68e328f3263ec05d6ed926e","dccea7b665fe08ed006acd191a7e68123ba7ec49848ac7c28a164962bf21254e","1b77033ac5e522a7983212d971c1852eeb938f78493df8772886925cc80b4780","845ca84509510b2de25a391a6827b34159f19b806f29394bde1a20063fdcd7d4","1bca2772bfe6da518ab061f96c01d7d71485b9afe80ea04048d468b6f081889c","5e5782f6925aa6e0d6bce51846e387f44e34b13433b41724ab4bd0073c1b2068","779582ae7e3e16d96393d0ab1048188cd06eb2077127435b6cd482cceb7e6a3e","8ec8cc42974e470fa2768b688d942fad92d7e7e1d34a7f86ed07002bb949e09c","ce43de54f2637c1b47944e24c983e891638a3dfa802fc0d8abc40d4e976a3468","5944b5e138f0bfc9d8632ae755447a222ee1bae5e691f95f964155c742e7fc55","5e48e3a7af2d1a99bf6db1d2d81ff07a7a4c8964e2a4dc8b63561cd5b625f5dc","af6673ff7d61e468206445654735d6d75de5fd4df5a867ed34fc48c76105f534","9dd11239586fd0a324b5ad3eb012d830f0f6ac9b4ae7755ce624d962347bf5ac","2c5398a6e7fd82deecfa4ee93522351b0f12569c076c32c00b258fd7f960dbc7","3d45de32dd9a40289168a5dd02723a1bef365cf1ad181238d4cb5c0c8d251b15","61fe41f126c499a22b4ccb031402298d80d85e581fc491b45dadb916c45858d7","e02cb6cd62d5c1b91a37fc85dc4bf6d4a9ada21d43063fe4c3350544e804c5e5","021cf30079a41551deca6cf22a6e6447e98e3bac50254c7e610c97428f969285","1caf9e59fb74032a9c1b48a4ad9cfb67bc870a51eff0c5459225bfd9adc92356","d5baeacd8b2a19238067bb8dd2349bb7b21bd4f483a3cf3a513a1da8845a858e","46405387737f0730b5efa6a271386a0357bf833c0940dfe7023fcd796e3eb269","21a74057837664858b9e501dce325ea2c16c4009a3f8fa03841155182081eaef","1bea2c7ec5efef5f89cc6b40de1029b22e959ade5364ab8af32cce741a160a93","0d8f583a1845b587b219aaeb26c964b20f5dd06e3cbd173de3fa883cded0a2e8","a18c0c85734df82f49e58da49ecdfba83c7a9b2eec84ad1ebc4b990ac2c21c69","fa22a5101aba0c01f6d17b0840eade09ed15080a520a365303b5a2bd5b5d251d","d915f8caea7edb7cf74c66acc25f2542f204e9681e0adeda6ecb37f06bb8565c","0c044bac5d0f050328792a948845695913878ea72e25eeef980ef7774a85339e","fdc69fed0d27eb9e587a5e239a0b2cd395d3db867c640acfabd9b15eabe40349","15aa0c97eeb7e96e90ab1a2bd6322a2c77732ee5d3b0e673f3089f6ee2025e00","f496344b5f5b3e031ded1dcf7c27b0a06dfd8835953c9e246a526adbb15997d8","163123dd1f14c0c3216ed7d67601c6fb71e369c72643c9864a23f9d7cf2ca8bb","5e84c097e89491388284a6c629c8321fa07a7823367065c9399afa159b69f717","bd2c8463d331853f4fdea2785d2ccea617ec9f6fd616265177b17a5f98daa390","725eb41864b2c7e1395aa39287c17afa535733f614474304e9ca70863490b761","de0a1dd63b44f8aac7859330a0ac0d1e050e58fe898733a046bfe4969c300d50","553c002ab2998aa64cff676ef39ed54e557c793ba22a9d3cbf8a698dd0dde6aa","848aa410ea954835a59e06986c92c987166eff642b7c59b3232807a0a82b52f1","2391afe5ddc0ae68b9a117ed5a1a6b26f5ba484524edeb5108a6671bc4da41ab","39ed86c3b1a04255e4edee466f35cad837b6125bcb0930291095533265a0ccc4","1ce3c53099fbde6273c6ff4c774b2402a31160085c9882a3e803a0fd2a84e3d5","21e4691d6dfa0155d8e11b30a32231f6e33d684cbd61dd7499392b39fd9c68e5","98803688adaa2230d90a3514754aca936b3e4df1915475b6d4a0a65e141be8c3","9272ff556abd50bb2dcdc71021fffea831a45f0c4169bec6f4ada3e9dc01b494","b96a043c9943dba15c1c263666730efaf29ad8fb5c33479173bda6329da158cc","19004996c8f722db5a158a505de181ce42884d780ff2e1307e4c1c43b5684fcc","0f599eee61efba479f48f6c97d809ccf2312296a406395678fe6cb64213b3711",{"version":"e29f69aa6e52682ebe3bc1edd1d8bdd8244cbc06f2277228f2ac483ada910c9c","affectsGlobalScope":true},"2f39ccc3f2cad7f2a1e0ad14a744877ed08dae4ae75510109ac981ceb783b566","8f2162398fdfec4d2598d0e272c9dcbe6da483129365f5bc1d2a42739a17be1e","145db5d0d0aea93b717ad941ca82e665e181815cdbf740d5a2ce034f90a69565","6775df6b9852c7af5dbdc7ae64a0865f0b699b0927074a610261852c58927646","b69bc6279522c19db5564fdccfaec94d7dd06781a2a908a9986b766bddc91a83","f6bda70e10a8b240d52a4b7a8f488cef7768d9c0d7c13677f7982bf1610e6016","1582da9d04bba1bcec0a5af5dc2cae543e57abbff202911715369b96c523d53b",{"version":"498d6a91f4bbfbd412e928a5fd6306d98a8b8b49c334b3ef1b1dccd8ec327e2f","signature":"d84a480259a7bda3cd794ab264e29fda120eb72c8c9270396a584479bf5b827f"},{"version":"f21932f853b3dbd3949e14c7d31d2dcfba3418c5de50878884a54cf0ba14e904","signature":"014089c3590328e311f0651db51765945a630df49cccfaf71c884d53bafd70d2"},{"version":"721526438283d40d50c6356064d346f1c57693f7e9930a3854c20c73bf4380a5","signature":"066053c842a2d9edb616d9c88dab6b19eaf8f4630bf862c774d0d6cc98c62a91"},{"version":"f7072de9a4e554ef33fce0e6765ec17d07910f21a0843ff335c38c33e07b7558","signature":"63ab284f6dcb88e0134584aa4f9c64b3e37b5f30cb310269671f8c33b0c0e98b"},{"version":"c7e2e472d0ba77ba41adc2422d0fb7e3eeada664eda67fbf2d1820cf6f9d49d5","signature":"d8697925fd69925c68732d55ed14c69c38bd4435b91355e974797c6f11685ee5"},{"version":"3afe879128eb0bc263123450b8211b56d7afba72c95e820cb51224fe661546b1","signature":"536ccb1a38a39569293fde322adb7b936d9a8bf81984d675bbba6e57c6569ca9"},{"version":"1989109e17e2c0b521786c4a779fda6f9c1822264dd2801dc8174e05fc4f44b8","signature":"d0466ccb6aa67bd7249306fd3cc3cc47ae0dede5826abdbfcf6c00f3667b9a65","affectsGlobalScope":true},{"version":"1bcc5ca3c413ce5845cd517fa12e791b057bed923bc66f7e4df4444e12a728dc","signature":"5a026523580a8d1a300ac0cbf514fe18ba0c1a2b833dfbc70489f98000f4a6b6"},{"version":"b68310896d0f29ac05154ac294c5d0ed417208d843f96b50af9f292aed5f5c4a","signature":"e3212c9c6c3810ecf4717ebba997ba5c14f72a5b2aaa08eefe64624c3b26abe5"},{"version":"b1b361cc38ccd9ea9ec35c5ecd537cda883ffb8e142112a4e57721f26b0b9e55","signature":"e5fa2fa2c4814d6fbbf98397afd77fa0f1a6dff2ba1fdc6de6ca35180f433a56"},{"version":"0255ebaaf6d387d6b31870d466ba42dbc1d4edc2a11b7c96bbd5b0aef025622e","signature":"eccacd5847f9abe6711b5f24b4b485f3a80bb12b98bbb4a3cbe9c66a4fbc1a8e"}],"options":{"composite":true,"declaration":true,"emitDeclarationOnly":true,"esModuleInterop":true,"jsx":2,"module":6,"noImplicitAny":true,"outDir":"./types","rootDir":"../src","skipLibCheck":false,"sourceMap":true,"strict":true,"target":6},"fileIdsList":[[37,38,39,40],[95,96,97,98,99,100,101,102,103,104,105],[95],[97],[72,95],[64,65,66,67,68,69,70,73,74,75,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],[67],[71,72],[76],[67,72],[112],[74],[51,52],[52],[51],[48,49,50,51,52,53,54,55,56,57,58],[49,50,52,53,54,55],[48,51],[49,52],[48,49],[49],[48],[41],[41,43,63,115,116,117,118],[41,42,63,119,120,121],[63],[63,94,106,108,110,111,114],[113],[59,108,109],[63,107],[44],[45,46,47,60,61,62],[60],[46,60],[45,46,47,59],[41,63,115],[41,63,115,119]],"referencedMap":[[41,1],[106,2],[104,3],[105,4],[98,3],[99,4],[100,5],[101,4],[102,3],[103,4],[94,6],[68,7],[79,7],[69,7],[73,8],[77,9],[81,7],[82,7],[83,7],[84,7],[85,7],[86,10],[89,9],[88,7],[80,7],[113,11],[78,9],[91,12],[93,12],[55,13],[53,14],[52,15],[59,16],[56,17],[58,18],[57,19],[54,20],[50,21],[49,22],[42,23],[119,24],[122,25],[117,23],[120,23],[121,23],[118,23],[111,26],[115,27],[114,28],[110,29],[108,30],[46,31],[63,32],[45,31],[62,33],[61,34],[60,35]],"exportedModulesMap":[[41,1],[106,2],[104,3],[105,4],[98,3],[99,4],[100,5],[101,4],[102,3],[103,4],[94,6],[68,7],[79,7],[69,7],[73,8],[77,9],[81,7],[82,7],[83,7],[84,7],[85,7],[86,10],[89,9],[88,7],[80,7],[113,11],[78,9],[91,12],[93,12],[55,13],[53,14],[52,15],[59,16],[56,17],[58,18],[57,19],[54,20],[50,21],[49,22],[42,23],[119,36],[122,37],[117,23],[118,23],[111,26],[115,27],[114,28],[110,29],[108,30],[46,31],[63,32],[45,31],[62,33],[61,34],[60,35]],"semanticDiagnosticsPerFile":[39,37,41,40,38,107,44,64,106,104,105,98,99,95,96,97,100,101,102,103,94,65,68,79,69,67,74,71,75,73,77,81,70,82,92,83,84,85,86,87,90,89,88,80,76,113,78,91,93,72,112,66,55,51,53,52,59,56,58,57,54,48,50,49,7,8,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,36,35,32,33,34,1,10,9,42,116,43,119,122,123,124,125,126,117,120,121,118,111,115,109,114,110,108,47,46,63,45,62,61,60],"latestChangedDtsFile":"./types/themes/minimal.d.ts"},"version":"4.9.4"}
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
2
  import type { CSSProperties } from 'react';
3
- import type { StreamTypes, PlaybackTypes, CmcdTypes } from '@mux/playback-core';
3
+ import type { StreamTypes, PlaybackTypes, CmcdTypes, MaxResolutionValue, MinResolutionValue, RenditionOrderValue } from '@mux/playback-core';
4
+ import { MaxResolution, MinResolution, RenditionOrder } from '@mux/playback-core';
4
5
  import { MediaError } from '@mux/mux-player';
5
6
  import type MuxPlayerElement from '@mux/mux-player';
6
7
  import type { Tokens, MuxPlayerElementEventMap } from '@mux/mux-player';
7
- export { MediaError };
8
+ export { MediaError, MaxResolution, MinResolution, RenditionOrder };
8
9
  type ValueOf<T> = T[keyof T];
9
10
  interface GenericEventListener<T extends Event = CustomEvent> {
10
11
  (evt: T): void;
@@ -54,7 +55,9 @@ export type MuxPlayerProps = {
54
55
  playerSoftwareName?: string;
55
56
  forwardSeekOffset?: number;
56
57
  backwardSeekOffset?: number;
57
- maxResolution?: string;
58
+ maxResolution?: MaxResolutionValue;
59
+ minResolution?: MinResolutionValue;
60
+ renditionOrder?: RenditionOrderValue;
58
61
  metadataVideoId?: string;
59
62
  metadataVideoTitle?: string;
60
63
  metadataViewerUserId?: string;
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
2
  import { CSSProperties } from 'react';
3
- import { StreamTypes, PlaybackTypes, CmcdTypes } from '@mux/playback-core';
3
+ import { StreamTypes, PlaybackTypes, CmcdTypes, MaxResolutionValue, MinResolutionValue, RenditionOrderValue } from '@mux/playback-core';
4
+ import { MaxResolution, MinResolution, RenditionOrder } from '@mux/playback-core';
4
5
  import { MediaError } from '@mux/mux-player';
5
6
  import MuxPlayerElement from '@mux/mux-player';
6
7
  import { Tokens, MuxPlayerElementEventMap } from '@mux/mux-player';
7
- export { MediaError };
8
+ export { MediaError, MaxResolution, MinResolution, RenditionOrder };
8
9
  type ValueOf<T> = T[keyof T];
9
10
  interface GenericEventListener<T extends Event = CustomEvent> {
10
11
  (evt: T): void;
@@ -54,7 +55,9 @@ export type MuxPlayerProps = {
54
55
  playerSoftwareName?: string;
55
56
  forwardSeekOffset?: number;
56
57
  backwardSeekOffset?: number;
57
- maxResolution?: string;
58
+ maxResolution?: MaxResolutionValue;
59
+ minResolution?: MinResolutionValue;
60
+ renditionOrder?: RenditionOrderValue;
58
61
  metadataVideoId?: string;
59
62
  metadataVideoTitle?: string;
60
63
  metadataViewerUserId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mux/mux-player-react",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "An open source Mux player for React that Just Works™",
5
5
  "homepage": "https://mux.com/player",
6
6
  "keywords": [
@@ -98,8 +98,8 @@
98
98
  }
99
99
  },
100
100
  "dependencies": {
101
- "@mux/mux-player": "2.0.1",
102
- "@mux/playback-core": "0.20.2",
101
+ "@mux/mux-player": "2.1.0",
102
+ "@mux/playback-core": "0.21.0",
103
103
  "prop-types": "^15.7.2"
104
104
  },
105
105
  "devDependencies": {
@@ -114,5 +114,5 @@
114
114
  "shx": "^0.3.4",
115
115
  "typescript": "^4.9.4"
116
116
  },
117
- "gitHead": "085002ac976a0ca499dd1d91fa1d31ae24d47617"
117
+ "gitHead": "fb82b3852e251f08f217bc1b4dd6ffd522d9ad79"
118
118
  }
@@ -1,2 +0,0 @@
1
- import y,{useEffect as ie}from"react";import{MediaError as be}from"@mux/mux-player";var c={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},_=e=>e==null,q=(e,t)=>_(t)?!1:e in t,J=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Y=(e,t)=>{if(!(typeof t=="boolean"&&!t)){if(q(e,c))return c[e];if(typeof t!=null)return/[A-Z]/.test(e)?J(e):e}};var $=(e,t)=>typeof e=="boolean"?"":e,d=(e={})=>Object.entries(e).reduce((t,[n,o])=>{let a=Y(n,o);if(!a)return t;let i=$(o,n);return t[a]=i,t},{});import{useRef as se}from"react";import{useEffect as Q,useRef as X}from"react";var m=(...e)=>{let t=X(null);return Q(()=>{e.forEach(n=>{!n||(typeof n=="function"?n(t.current):n.current=t.current)})},[e]),t};import{useEffect as B}from"react";var ee=Object.prototype.hasOwnProperty,te=(e,t)=>{if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.some((a,i)=>t[i]===a);let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let a=0;a<n.length;a++)if(!ee.call(t,n[a])||!Object.is(e[n[a]],t[n[a]]))return!1;return!0},p=(e,t,n)=>!te(t,e[n]),ne=(e,t,n)=>{e[n]=t},re=(e,t,n,o=ne,a=p)=>B(()=>{let i=n==null?void 0:n.current;!i||!a(i,t,e)||o(i,t,e)},[n==null?void 0:n.current,t]),l=re;var ae=()=>{try{return"2.0.1"}catch{}return"UNKNOWN"},oe=ae(),E=()=>oe;var le=y.forwardRef(({children:e,...t},n)=>y.createElement("mux-player",d({...t,ref:n}),e)),r=(e,t,n)=>ie(()=>{let o=t==null?void 0:t.current;if(!(!o||!n))return o.addEventListener(e,n),()=>{o.removeEventListener(e,n)}},[t==null?void 0:t.current,n]),ue=(e,t)=>{let{onAbort:n,onCanPlay:o,onCanPlayThrough:a,onEmptied:i,onLoadStart:g,onLoadedData:f,onLoadedMetadata:M,onProgress:P,onDurationChange:v,onVolumeChange:b,onRateChange:x,onResize:T,onWaiting:h,onPlay:R,onPlaying:k,onTimeUpdate:C,onPause:L,onSeeking:O,onSeeked:S,onStalled:G,onSuspend:w,onEnded:V,onError:A,onCuePointChange:N,onCuePointsChange:I,metadata:K,tokens:D,paused:U,playbackId:H,playbackRates:j,currentTime:z,themeProps:F,...W}=t;return l("playbackRates",j,e),l("metadata",K,e),l("themeProps",F,e),l("tokens",D,e),l("playbackId",H,e),l("paused",U,e,(s,u)=>{u!=null&&(u?s.pause():s.play())},(s,u,Z)=>s.hasAttribute("autoplay")&&!s.hasPlayed?!1:p(s,u,Z)),l("currentTime",z,e,(s,u)=>{u!=null&&(s.currentTime=u)}),r("abort",e,n),r("canplay",e,o),r("canplaythrough",e,a),r("emptied",e,i),r("loadstart",e,g),r("loadeddata",e,f),r("loadedmetadata",e,M),r("progress",e,P),r("durationchange",e,v),r("volumechange",e,b),r("ratechange",e,x),r("resize",e,T),r("waiting",e,h),r("play",e,R),r("playing",e,k),r("timeupdate",e,C),r("pause",e,L),r("seeking",e,O),r("seeked",e,S),r("stalled",e,G),r("suspend",e,w),r("ended",e,V),r("error",e,A),r("cuepointchange",e,N),r("cuepointschange",e,I),[W]},ye=E(),pe="mux-player-react",ce=y.forwardRef((e,t)=>{let n=se(null),o=m(n,t),[a]=ue(n,e);return y.createElement(le,{ref:o,playerSoftwareName:pe,playerSoftwareVersion:ye,...a})}),Ce=ce;export{be as MediaError,Ce as default};
2
- //# sourceMappingURL=-OJ5ZWKIA.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/index.tsx", "../src/common/utils.ts", "../src/useCombinedRefs.ts", "../src/useObjectPropEffect.ts", "../src/env.ts"],
4
- "sourcesContent": ["import React, { useEffect } from 'react';\nimport type { CSSProperties } from 'react';\nimport type { StreamTypes, PlaybackTypes, CmcdTypes } from '@mux/playback-core';\nimport { MediaError } from '@mux/mux-player';\nimport type MuxPlayerElement from '@mux/mux-player';\nimport type { Tokens, MuxPlayerElementEventMap } from '@mux/mux-player';\nimport { toNativeProps } from './common/utils';\nimport { useRef } from 'react';\nimport { useCombinedRefs } from './useCombinedRefs';\nimport useObjectPropEffect, { defaultHasChanged } from './useObjectPropEffect';\nimport { getPlayerVersion } from './env';\n\nexport { MediaError };\n\ntype ValueOf<T> = T[keyof T];\ninterface GenericEventListener<T extends Event = CustomEvent> {\n (evt: T): void;\n}\n\nexport type MuxPlayerRefAttributes = MuxPlayerElement;\ntype VideoApiAttributes = {\n currentTime: number;\n volume: number;\n paused: boolean;\n src: string | null;\n poster: string;\n playbackRate: number;\n playsInline: boolean;\n preload: string;\n crossOrigin: string;\n autoPlay: boolean | string;\n loop: boolean;\n muted: boolean;\n style: CSSProperties;\n};\n\ntype MuxMediaPropTypes = {\n audio: boolean;\n // envKey: Options[\"data\"][\"env_key\"];\n envKey: string;\n // debug: Options[\"debug\"] & Hls[\"config\"][\"debug\"];\n debug: boolean;\n disableCookies: boolean;\n // metadata: Partial<Options[\"data\"]>;\n metadata: { [k: string]: any };\n beaconCollectionDomain: string;\n customDomain: string;\n playbackId: string;\n preferPlayback: ValueOf<PlaybackTypes> | undefined;\n // NOTE: Explicitly adding deprecated values here for now to avoid fully breaking changes in TS envs (CJP)\n streamType: ValueOf<StreamTypes> | 'll-live' | 'live:dvr' | 'll-live:dvr';\n defaultStreamType: ValueOf<StreamTypes>;\n targetLiveWindow: number;\n startTime: number;\n storyboardSrc: string;\n preferCmcd: ValueOf<CmcdTypes> | undefined;\n children?: React.ReactNode;\n};\n\nexport type MuxPlayerProps = {\n className?: string;\n hotkeys?: string;\n nohotkeys?: boolean;\n defaultHiddenCaptions?: boolean;\n playerSoftwareVersion?: string;\n playerSoftwareName?: string;\n forwardSeekOffset?: number;\n backwardSeekOffset?: number;\n maxResolution?: string;\n metadataVideoId?: string;\n metadataVideoTitle?: string;\n metadataViewerUserId?: string;\n primaryColor?: string;\n secondaryColor?: string;\n accentColor?: string;\n placeholder?: string;\n playbackRates?: number[];\n defaultShowRemainingTime?: boolean;\n noVolumePref?: boolean;\n thumbnailTime?: number;\n title?: string;\n tokens?: Tokens;\n theme?: string;\n themeProps?: { [k: string]: any };\n onAbort?: GenericEventListener<MuxPlayerElementEventMap['abort']>;\n onCanPlay?: GenericEventListener<MuxPlayerElementEventMap['canplay']>;\n onCanPlayThrough?: GenericEventListener<MuxPlayerElementEventMap['canplaythrough']>;\n onEmptied?: GenericEventListener<MuxPlayerElementEventMap['emptied']>;\n onLoadStart?: GenericEventListener<MuxPlayerElementEventMap['loadstart']>;\n onLoadedData?: GenericEventListener<MuxPlayerElementEventMap['loadeddata']>;\n onLoadedMetadata?: GenericEventListener<MuxPlayerElementEventMap['loadedmetadata']>;\n onProgress?: GenericEventListener<MuxPlayerElementEventMap['progress']>;\n onDurationChange?: GenericEventListener<MuxPlayerElementEventMap['durationchange']>;\n onVolumeChange?: GenericEventListener<MuxPlayerElementEventMap['volumechange']>;\n onRateChange?: GenericEventListener<MuxPlayerElementEventMap['ratechange']>;\n onResize?: GenericEventListener<MuxPlayerElementEventMap['resize']>;\n onWaiting?: GenericEventListener<MuxPlayerElementEventMap['waiting']>;\n onPlay?: GenericEventListener<MuxPlayerElementEventMap['play']>;\n onPlaying?: GenericEventListener<MuxPlayerElementEventMap['playing']>;\n onTimeUpdate?: GenericEventListener<MuxPlayerElementEventMap['timeupdate']>;\n onPause?: GenericEventListener<MuxPlayerElementEventMap['pause']>;\n onSeeking?: GenericEventListener<MuxPlayerElementEventMap['seeking']>;\n onSeeked?: GenericEventListener<MuxPlayerElementEventMap['seeked']>;\n onStalled?: GenericEventListener<MuxPlayerElementEventMap['stalled']>;\n onSuspend?: GenericEventListener<MuxPlayerElementEventMap['suspend']>;\n onEnded?: GenericEventListener<MuxPlayerElementEventMap['ended']>;\n onError?: GenericEventListener<MuxPlayerElementEventMap['error']>;\n onCuePointChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointchange']>;\n onCuePointsChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointschange']>;\n // onPlayerReady?: EventListener;\n} & Partial<MuxMediaPropTypes> &\n Partial<VideoApiAttributes>;\n\nconst MuxPlayerInternal = React.forwardRef<MuxPlayerRefAttributes, MuxPlayerProps>(({ children, ...props }, ref) => {\n return React.createElement('mux-player', toNativeProps({ ...props, ref }), children);\n});\n\nconst useEventCallbackEffect = <K extends keyof MuxPlayerElementEventMap>(\n type: K,\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n callback: GenericEventListener<MuxPlayerElementEventMap[K]> | undefined\n) => {\n return useEffect(() => {\n const eventTarget = ref?.current;\n if (!eventTarget || !callback) return;\n eventTarget.addEventListener(type, callback);\n return () => {\n eventTarget.removeEventListener(type, callback);\n };\n }, [ref?.current, callback]);\n};\n\nconst usePlayer = (\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n props: MuxPlayerProps\n) => {\n const {\n onAbort,\n onCanPlay,\n onCanPlayThrough,\n onEmptied,\n onLoadStart,\n onLoadedData,\n onLoadedMetadata,\n onProgress,\n onDurationChange,\n onVolumeChange,\n onRateChange,\n onResize,\n onWaiting,\n onPlay,\n onPlaying,\n onTimeUpdate,\n onPause,\n onSeeking,\n onSeeked,\n onStalled,\n onSuspend,\n onEnded,\n onError,\n onCuePointChange,\n onCuePointsChange,\n // onPlayerReady,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n currentTime,\n themeProps,\n ...remainingProps\n } = props;\n useObjectPropEffect('playbackRates', playbackRates, ref);\n useObjectPropEffect('metadata', metadata, ref);\n useObjectPropEffect('themeProps', themeProps, ref);\n useObjectPropEffect('tokens', tokens, ref);\n useObjectPropEffect('playbackId', playbackId, ref);\n useObjectPropEffect(\n 'paused',\n paused,\n ref,\n (playerEl: HTMLMediaElement, pausedVal?: boolean) => {\n if (pausedVal == null) return;\n if (pausedVal) {\n playerEl.pause();\n } else {\n playerEl.play();\n }\n },\n (playerEl, value, propName) => {\n if (playerEl.hasAttribute('autoplay') && !playerEl.hasPlayed) {\n return false;\n }\n return defaultHasChanged(playerEl, value, propName);\n }\n );\n useObjectPropEffect('currentTime', currentTime, ref, (playerEl: HTMLMediaElement, currentTimeVal?: number) => {\n if (currentTimeVal == null) return;\n playerEl.currentTime = currentTimeVal;\n });\n useEventCallbackEffect('abort', ref, onAbort);\n useEventCallbackEffect('canplay', ref, onCanPlay);\n useEventCallbackEffect('canplaythrough', ref, onCanPlayThrough);\n useEventCallbackEffect('emptied', ref, onEmptied);\n useEventCallbackEffect('loadstart', ref, onLoadStart);\n useEventCallbackEffect('loadeddata', ref, onLoadedData);\n useEventCallbackEffect('loadedmetadata', ref, onLoadedMetadata);\n useEventCallbackEffect('progress', ref, onProgress);\n useEventCallbackEffect('durationchange', ref, onDurationChange);\n useEventCallbackEffect('volumechange', ref, onVolumeChange);\n useEventCallbackEffect('ratechange', ref, onRateChange);\n useEventCallbackEffect('resize', ref, onResize);\n useEventCallbackEffect('waiting', ref, onWaiting);\n useEventCallbackEffect('play', ref, onPlay);\n useEventCallbackEffect('playing', ref, onPlaying);\n useEventCallbackEffect('timeupdate', ref, onTimeUpdate);\n useEventCallbackEffect('pause', ref, onPause);\n useEventCallbackEffect('seeking', ref, onSeeking);\n useEventCallbackEffect('seeked', ref, onSeeked);\n useEventCallbackEffect('stalled', ref, onStalled);\n useEventCallbackEffect('suspend', ref, onSuspend);\n useEventCallbackEffect('ended', ref, onEnded);\n useEventCallbackEffect('error', ref, onError);\n useEventCallbackEffect('cuepointchange', ref, onCuePointChange);\n useEventCallbackEffect('cuepointschange', ref, onCuePointsChange);\n // useEventCallbackEffect('playerready', ref, onPlayerReady);\n return [remainingProps];\n};\n\nconst playerSoftwareVersion = getPlayerVersion();\nconst playerSoftwareName = 'mux-player-react';\n\nconst MuxPlayer = React.forwardRef<\n MuxPlayerRefAttributes,\n Omit<MuxPlayerProps, 'playerSoftwareVersion' | 'playerSoftwareName'>\n>((props, ref) => {\n const innerPlayerRef = useRef<MuxPlayerElement>(null);\n const playerRef = useCombinedRefs(innerPlayerRef, ref);\n const [remainingProps] = usePlayer(innerPlayerRef, props);\n\n return (\n <MuxPlayerInternal\n /** @TODO Fix types relationships (CJP) */\n ref={playerRef as typeof innerPlayerRef}\n playerSoftwareName={playerSoftwareName}\n playerSoftwareVersion={playerSoftwareVersion}\n {...remainingProps}\n />\n );\n});\n\nexport default MuxPlayer;\n", "// NOTE: As a forward-looking implementation, we may want to assume\n// prop names -> attribute names is always a simple name.toLowerCase()\n// and provide a mechanism for passing in per-component overrides for\n// e.g. kebab cases, as that's the way React/Preact handles these. (CJP)\nconst ReactPropToAttrNameMap = {\n className: 'class',\n classname: 'class',\n htmlFor: 'for',\n crossOrigin: 'crossorigin',\n viewBox: 'viewBox',\n playsInline: 'playsinline',\n autoPlay: 'autoplay',\n playbackRate: 'playbackrate',\n};\n\ntype KeyTypes = string | number | symbol;\ntype Maybe<T> = T | null | undefined;\n\nexport const isNil = (x: unknown): x is null | undefined => x == undefined;\n\n// Type Guard to determine if a given key is actually a key of some object of type T\nexport const isKeyOf = <T extends {} = any>(k: KeyTypes, o: Maybe<T>): k is keyof T => {\n if (isNil(o)) return false;\n return k in o;\n};\n\nconst toKebabCase = (string: string) => string.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);\n\nexport const toNativeAttrName = (propName: string, propValue: any): string | undefined => {\n if (typeof propValue === 'boolean' && !propValue) return undefined;\n if (isKeyOf(propName, ReactPropToAttrNameMap)) return ReactPropToAttrNameMap[propName];\n if (typeof propValue == undefined) return undefined;\n if (/[A-Z]/.test(propName)) return toKebabCase(propName);\n return propName;\n};\nexport const toStyleAttr = <T>(x: T) => x;\n\nexport const toNativeAttrValue = (propValue: any, propName: string) => {\n if (typeof propValue === 'boolean') return '';\n return propValue;\n};\n\nexport const toNativeProps = (props = {}) => {\n return Object.entries(props).reduce<{ [k: string]: string }>((transformedProps, [propName, propValue]) => {\n const attrName = toNativeAttrName(propName, propValue);\n\n // prop was stripped. Don't add.\n if (!attrName) {\n return transformedProps;\n }\n\n const attrValue = toNativeAttrValue(propValue, propName);\n transformedProps[attrName] = attrValue;\n return transformedProps;\n }, {});\n};\n", "import { useEffect, useRef } from 'react';\nimport type { MutableRefObject, ForwardedRef } from 'react';\n\ntype Maybe<T> = T | null | undefined;\ntype RefCb<T> = (instance: Maybe<T>) => void;\ntype RefObj<T> = MutableRefObject<Maybe<T>>;\ntype RefTypes<T> = RefObj<T> | RefCb<T> | ForwardedRef<T>;\ninterface useCombinedRefs {\n <T>(...refs: Maybe<RefTypes<T>>[]): RefObj<T>;\n}\n\nexport const useCombinedRefs: useCombinedRefs = (...refs) => {\n const targetRef = useRef(null);\n\n useEffect(() => {\n refs.forEach((ref) => {\n if (!ref) return;\n\n if (typeof ref === 'function') {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n });\n }, [refs]);\n\n return targetRef;\n};\n\n// TS assumed default export was interface def instead of function value (CJP)\nconst defaultUseCombinedRefs = useCombinedRefs;\nexport default defaultUseCombinedRefs;\n", "import { useEffect } from 'react';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Slightly modified version of React's shallowEqual, with optimizations for Arrays\n * so we may treat them specifically as unequal if they are not a) both arrays\n * or b) don't contain the same (shallowly compared) elements.\n */\nconst shallowEqual = (objA: any, objB: any): boolean => {\n if (Object.is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n if (Array.isArray(objA)) {\n // Early \"cheap\" array compares\n if (!Array.isArray(objB) || objA.length !== objB.length) return false;\n // Shallow compare for arrays\n return objA.some((vVal, i) => objB[i] === vVal);\n }\n\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (let i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const defaultHasChanged = (obj: any, v: any, k: string) => {\n return !shallowEqual(v, obj[k]);\n};\n\nconst defaultUpdateValue = (obj: any, v: any, k: string) => {\n obj[k] = v;\n};\n\nexport const useObjectPropEffect = <T extends { [k: string]: any }, V>(\n propName: string,\n propValue: V | null | undefined,\n ref: React.MutableRefObject<T | null> | null | undefined,\n updateValue = defaultUpdateValue,\n hasChanged = defaultHasChanged\n) => {\n return useEffect(() => {\n const obj = ref?.current;\n if (!obj) return;\n if (!hasChanged(obj, propValue, propName)) return;\n updateValue(obj, propValue, propName);\n }, [ref?.current, propValue]);\n};\n\nexport default useObjectPropEffect;\n", "const getEnvPlayerVersion = () => {\n try {\n // @ts-ignore\n return PLAYER_VERSION as string;\n } catch {}\n return 'UNKNOWN';\n};\n\nconst player_version: string = getEnvPlayerVersion();\n\nexport const getPlayerVersion = () => player_version;\n"],
5
- "mappings": "AAAA,OAAOA,GAAS,aAAAC,OAAiB,QAGjC,OAAS,cAAAC,OAAkB,kBCC3B,IAAMC,EAAyB,CAC7B,UAAW,QACX,UAAW,QACX,QAAS,MACT,YAAa,cACb,QA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C,EAAgBH,EAAgBpD,CAAG,EAC/C,CAACwC,CAAc,EAAIjC,GAAU6C,EAAgBrD,CAAK,EAExD,OACEF,EAAA,cAACD,GAAA,CAEC,IAAK0D,EACL,mBAAoBJ,GACpB,sBAAuBF,GACtB,GAAGR,EACN,CAEJ,CAAC,EAEMgB,GAAQL",
6
- "names": ["React", "useEffect", "MediaError", "ReactPropToAttrNameMap", "isNil", "x", "isKeyOf", "k", "o", "toKebabCase", "string", "match", "toNativeAttrName", "propName", "propValue", "toNativeAttrValue", "propValue", "propName", "toNativeProps", "props", "transformedProps", "attrName", "toNativeAttrName", "attrValue", "useRef", "useEffect", "useRef", "useCombinedRefs", "refs", "targetRef", "ref", "useEffect", "hasOwnProperty", "shallowEqual", "objA", "objB", "vVal", "keysA", "keysB", "i", "defaultHasChanged", "obj", "v", "k", "defaultUpdateValue", "useObjectPropEffect", "propName", "propValue", "ref", "updateValue", "hasChanged", "useObjectPropEffect_default", "getEnvPlayerVersion", "player_version", "getPlayerVersion", "MuxPlayerInternal", "React", "children", "props", "ref", "toNativeProps", "useEventCallbackEffect", "type", "callback", "useEffect", "eventTarget", "usePlayer", "onAbort", "onCanPlay", "onCanPlayThrough", "onEmptied", "onLoadStart", "onLoadedData", "onLoadedMetadata", "onProgress", "onDurationChange", "onVolumeChange", "onRateChange", "onResize", "onWaiting", "onPlay", "onPlaying", "onTimeUpdate", "onPause", "onSeeking", "onSeeked", "onStalled", "onSuspend", "onEnded", "onError", "onCuePointChange", "onCuePointsChange", "metadata", "tokens", "paused", "playbackId", "playbackRates", "currentTime", "themeProps", "remainingProps", "useObjectPropEffect_default", "playerEl", "pausedVal", "value", "propName", "defaultHasChanged", "currentTimeVal", "playerSoftwareVersion", "getPlayerVersion", "playerSoftwareName", "MuxPlayer", "innerPlayerRef", "useRef", "playerRef", "useCombinedRefs", "src_default"]
7
- }