@mux/mux-player-react 2.2.0-canary.0-a7c4948 → 2.2.0-canary.0-4cdc52d
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/dist/-PJBQBQCI.mjs +2 -0
- package/dist/{-A5AHX2ZL.mjs.map → -PJBQBQCI.mjs.map} +1 -1
- package/dist/cjs.json +146 -22
- package/dist/esm.json +146 -22
- package/dist/esm.lazy.json +150 -27
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/lazy.mjs +1 -1
- package/dist/lazy.mjs.map +1 -1
- package/package.json +4 -4
- package/dist/-A5AHX2ZL.mjs +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import y,{useEffect as le}from"react";import{MaxResolution as Re,MinResolution as Te,RenditionOrder as he}from"@mux/playback-core";import{MediaError as ke}from"@mux/mux-player";var c={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},J=e=>e==null,Y=(e,n)=>J(n)?!1:e in n,$=e=>e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Q=(e,n)=>{if(!(typeof n=="boolean"&&!n)){if(Y(e,c))return c[e];if(typeof n!=null)return/[A-Z]/.test(e)?$(e):e}};var X=(e,n)=>typeof e=="boolean"?"":e,p=(e={})=>Object.entries(e).reduce((n,[t,o])=>{let a=Q(t,o);if(!a)return n;let s=X(o,t);return n[a]=s,n},{});import{useRef as ue}from"react";import{useEffect as B,useRef as ee}from"react";var m=(...e)=>{let n=ee(null);return B(()=>{e.forEach(t=>{t&&(typeof t=="function"?t(n.current):t.current=n.current)})},[e]),n};import{useEffect as ne}from"react";var te=Object.prototype.hasOwnProperty,re=(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,s)=>n[s]===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(!te.call(n,t[a])||!Object.is(e[t[a]],n[t[a]]))return!1;return!0},d=(e,n,t)=>!re(n,e[t]),ae=(e,n,t)=>{e[t]=n},oe=(e,n,t,o=ae,a=d)=>ne(()=>{let s=t==null?void 0:t.current;s&&a(s,n,e)&&o(s,n,e)},[t==null?void 0:t.current,n]),i=oe;var ie=()=>{try{return"2.2.0"}catch{}return"UNKNOWN"},se=ie(),E=()=>se;var ye=y.forwardRef(({children:e,...n},t)=>y.createElement("mux-player",p({...n,ref:t}),e)),r=(e,n,t)=>le(()=>{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]),de=(e,n)=>{let{onAbort:t,onCanPlay:o,onCanPlayThrough:a,onEmptied:s,onLoadStart:g,onLoadedData:M,onLoadedMetadata:f,onProgress:P,onDurationChange:v,onVolumeChange:x,onRateChange:b,onResize:R,onWaiting:T,onPlay:h,onPlaying:C,onTimeUpdate:k,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:_,playbackRates:H,currentTime:j,themeProps:z,extraSourceParams:F,_hlsConfig:W,...Z}=n;return i("playbackRates",H,e),i("metadata",K,e),i("extraSourceParams",F,e),i("_hlsConfig",W,e),i("themeProps",z,e),i("tokens",D,e),i("playbackId",_,e),i("paused",U,e,(l,u)=>{u!=null&&(u?l.pause():l.play())},(l,u,q)=>l.hasAttribute("autoplay")&&!l.hasPlayed?!1:d(l,u,q)),i("currentTime",j,e,(l,u)=>{u!=null&&(l.currentTime=u)}),r("abort",e,t),r("canplay",e,o),r("canplaythrough",e,a),r("emptied",e,s),r("loadstart",e,g),r("loadeddata",e,M),r("loadedmetadata",e,f),r("progress",e,P),r("durationchange",e,v),r("volumechange",e,x),r("ratechange",e,b),r("resize",e,R),r("waiting",e,T),r("play",e,h),r("playing",e,C),r("timeupdate",e,k),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),[Z]},ce=E(),pe="mux-player-react",me=y.forwardRef((e,n)=>{let t=ue(null),o=m(t,n),[a]=de(t,e);return y.createElement(ye,{ref:o,playerSoftwareName:pe,playerSoftwareVersion:ce,...a})}),Ve=me;export{Re as MaxResolution,ke as MediaError,Te as MinResolution,he as RenditionOrder,Ve as default};
|
|
2
|
+
//# sourceMappingURL=-PJBQBQCI.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.tsx", "../src/common/utils.ts", "../src/useCombinedRefs.ts", "../src/useObjectPropEffect.ts", "../src/env.ts"],
|
|
4
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 disablePictureInPicture?: boolean;\n // metadata: Partial<Options[\"data\"]>;\n metadata: { [k: string]: any };\n extraSourceParams: Record<string, any>;\n _hlsConfig: MuxPlayerElement['_hlsConfig'];\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 extraSourceParams,\n _hlsConfig,\n ...remainingProps\n } = props;\n useObjectPropEffect('playbackRates', playbackRates, ref);\n useObjectPropEffect('metadata', metadata, ref);\n useObjectPropEffect('extraSourceParams', extraSourceParams, ref);\n useObjectPropEffect('_hlsConfig', _hlsConfig, 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,
|
|
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,GAA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GAAqB,mBAErBC,GAAYxD,EAAM,WAGtB,CAACE,EAAOC,IAAQ,CAChB,IAAMsD,EAAiBC,GAAyB,IAAI,EAC9CC,EAAYC,EAAgBH,EAAgBtD,CAAG,EAC/C,CAAC0C,CAAc,EAAInC,GAAU+C,EAAgBvD,CAAK,EAExD,OACEF,EAAA,cAACD,GAAA,CAEC,IAAK4D,EACL,mBAAoBJ,GACpB,sBAAuBF,GACtB,GAAGR,EACN,CAEJ,CAAC,EAEMgB,GAAQL",
|
|
6
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", "i", "keysA", "keysB", "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", "extraSourceParams", "_hlsConfig", "remainingProps", "useObjectPropEffect_default", "playerEl", "pausedVal", "value", "propName", "defaultHasChanged", "currentTimeVal", "playerSoftwareVersion", "getPlayerVersion", "playerSoftwareName", "MuxPlayer", "innerPlayerRef", "useRef", "playerRef", "useCombinedRefs", "src_default"]
|
|
7
7
|
}
|
package/dist/cjs.json
CHANGED
|
@@ -2,56 +2,125 @@
|
|
|
2
2
|
"inputs": {
|
|
3
3
|
"src/common/utils.ts": {
|
|
4
4
|
"bytes": 2048,
|
|
5
|
-
"imports": []
|
|
5
|
+
"imports": [],
|
|
6
|
+
"format": "esm"
|
|
6
7
|
},
|
|
7
8
|
"src/useCombinedRefs.ts": {
|
|
8
9
|
"bytes": 892,
|
|
9
|
-
"imports": [
|
|
10
|
+
"imports": [
|
|
11
|
+
{
|
|
12
|
+
"path": "react",
|
|
13
|
+
"kind": "import-statement",
|
|
14
|
+
"external": true
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"format": "esm"
|
|
10
18
|
},
|
|
11
19
|
"src/useObjectPropEffect.ts": {
|
|
12
20
|
"bytes": 1850,
|
|
13
|
-
"imports": [
|
|
21
|
+
"imports": [
|
|
22
|
+
{
|
|
23
|
+
"path": "react",
|
|
24
|
+
"kind": "import-statement",
|
|
25
|
+
"external": true
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"format": "esm"
|
|
14
29
|
},
|
|
15
30
|
"src/env.ts": {
|
|
16
31
|
"bytes": 245,
|
|
17
|
-
"imports": []
|
|
32
|
+
"imports": [],
|
|
33
|
+
"format": "esm"
|
|
18
34
|
},
|
|
19
35
|
"src/index.tsx": {
|
|
20
36
|
"bytes": 9862,
|
|
21
37
|
"imports": [
|
|
38
|
+
{
|
|
39
|
+
"path": "react",
|
|
40
|
+
"kind": "import-statement",
|
|
41
|
+
"external": true
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"path": "@mux/playback-core",
|
|
45
|
+
"kind": "import-statement",
|
|
46
|
+
"external": true
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"path": "@mux/mux-player",
|
|
50
|
+
"kind": "import-statement",
|
|
51
|
+
"external": true
|
|
52
|
+
},
|
|
22
53
|
{
|
|
23
54
|
"path": "src/common/utils.ts",
|
|
24
|
-
"kind": "import-statement"
|
|
55
|
+
"kind": "import-statement",
|
|
56
|
+
"original": "./common/utils"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"path": "react",
|
|
60
|
+
"kind": "import-statement",
|
|
61
|
+
"external": true
|
|
25
62
|
},
|
|
26
63
|
{
|
|
27
64
|
"path": "src/useCombinedRefs.ts",
|
|
28
|
-
"kind": "import-statement"
|
|
65
|
+
"kind": "import-statement",
|
|
66
|
+
"original": "./useCombinedRefs"
|
|
29
67
|
},
|
|
30
68
|
{
|
|
31
69
|
"path": "src/useObjectPropEffect.ts",
|
|
32
|
-
"kind": "import-statement"
|
|
70
|
+
"kind": "import-statement",
|
|
71
|
+
"original": "./useObjectPropEffect"
|
|
33
72
|
},
|
|
34
73
|
{
|
|
35
74
|
"path": "src/env.ts",
|
|
36
|
-
"kind": "import-statement"
|
|
75
|
+
"kind": "import-statement",
|
|
76
|
+
"original": "./env"
|
|
37
77
|
}
|
|
38
|
-
]
|
|
78
|
+
],
|
|
79
|
+
"format": "esm"
|
|
39
80
|
},
|
|
40
81
|
"src/themes/classic.ts": {
|
|
41
82
|
"bytes": 81,
|
|
42
|
-
"imports": [
|
|
83
|
+
"imports": [
|
|
84
|
+
{
|
|
85
|
+
"path": "@mux/mux-player/themes/classic",
|
|
86
|
+
"kind": "import-statement",
|
|
87
|
+
"external": true
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"format": "esm"
|
|
43
91
|
},
|
|
44
92
|
"src/themes/gerwig.ts": {
|
|
45
93
|
"bytes": 79,
|
|
46
|
-
"imports": [
|
|
94
|
+
"imports": [
|
|
95
|
+
{
|
|
96
|
+
"path": "@mux/mux-player/themes/gerwig",
|
|
97
|
+
"kind": "import-statement",
|
|
98
|
+
"external": true
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"format": "esm"
|
|
47
102
|
},
|
|
48
103
|
"src/themes/microvideo.ts": {
|
|
49
104
|
"bytes": 87,
|
|
50
|
-
"imports": [
|
|
105
|
+
"imports": [
|
|
106
|
+
{
|
|
107
|
+
"path": "@mux/mux-player/themes/microvideo",
|
|
108
|
+
"kind": "import-statement",
|
|
109
|
+
"external": true
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"format": "esm"
|
|
51
113
|
},
|
|
52
114
|
"src/themes/minimal.ts": {
|
|
53
115
|
"bytes": 81,
|
|
54
|
-
"imports": [
|
|
116
|
+
"imports": [
|
|
117
|
+
{
|
|
118
|
+
"path": "@mux/mux-player/themes/minimal",
|
|
119
|
+
"kind": "import-statement",
|
|
120
|
+
"external": true
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"format": "esm"
|
|
55
124
|
}
|
|
56
125
|
},
|
|
57
126
|
"outputs": {
|
|
@@ -59,10 +128,41 @@
|
|
|
59
128
|
"imports": [],
|
|
60
129
|
"exports": [],
|
|
61
130
|
"inputs": {},
|
|
62
|
-
"bytes":
|
|
131
|
+
"bytes": 22003
|
|
63
132
|
},
|
|
64
133
|
"dist/index.cjs.js": {
|
|
65
|
-
"imports": [
|
|
134
|
+
"imports": [
|
|
135
|
+
{
|
|
136
|
+
"path": "react",
|
|
137
|
+
"kind": "require-call",
|
|
138
|
+
"external": true
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"path": "@mux/playback-core",
|
|
142
|
+
"kind": "require-call",
|
|
143
|
+
"external": true
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"path": "@mux/mux-player",
|
|
147
|
+
"kind": "require-call",
|
|
148
|
+
"external": true
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"path": "react",
|
|
152
|
+
"kind": "require-call",
|
|
153
|
+
"external": true
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"path": "react",
|
|
157
|
+
"kind": "require-call",
|
|
158
|
+
"external": true
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"path": "react",
|
|
162
|
+
"kind": "require-call",
|
|
163
|
+
"external": true
|
|
164
|
+
}
|
|
165
|
+
],
|
|
66
166
|
"exports": [],
|
|
67
167
|
"entryPoint": "src/index.tsx",
|
|
68
168
|
"inputs": {
|
|
@@ -73,16 +173,16 @@
|
|
|
73
173
|
"bytesInOutput": 532
|
|
74
174
|
},
|
|
75
175
|
"src/useCombinedRefs.ts": {
|
|
76
|
-
"bytesInOutput":
|
|
176
|
+
"bytesInOutput": 170
|
|
77
177
|
},
|
|
78
178
|
"src/useObjectPropEffect.ts": {
|
|
79
|
-
"bytesInOutput":
|
|
179
|
+
"bytesInOutput": 599
|
|
80
180
|
},
|
|
81
181
|
"src/env.ts": {
|
|
82
182
|
"bytesInOutput": 71
|
|
83
183
|
}
|
|
84
184
|
},
|
|
85
|
-
"bytes":
|
|
185
|
+
"bytes": 4062
|
|
86
186
|
},
|
|
87
187
|
"dist/themes/classic.cjs.js.map": {
|
|
88
188
|
"imports": [],
|
|
@@ -91,7 +191,13 @@
|
|
|
91
191
|
"bytes": 374
|
|
92
192
|
},
|
|
93
193
|
"dist/themes/classic.cjs.js": {
|
|
94
|
-
"imports": [
|
|
194
|
+
"imports": [
|
|
195
|
+
{
|
|
196
|
+
"path": "@mux/mux-player/themes/classic",
|
|
197
|
+
"kind": "require-call",
|
|
198
|
+
"external": true
|
|
199
|
+
}
|
|
200
|
+
],
|
|
95
201
|
"exports": [],
|
|
96
202
|
"entryPoint": "src/themes/classic.ts",
|
|
97
203
|
"inputs": {
|
|
@@ -108,7 +214,13 @@
|
|
|
108
214
|
"bytes": 368
|
|
109
215
|
},
|
|
110
216
|
"dist/themes/gerwig.cjs.js": {
|
|
111
|
-
"imports": [
|
|
217
|
+
"imports": [
|
|
218
|
+
{
|
|
219
|
+
"path": "@mux/mux-player/themes/gerwig",
|
|
220
|
+
"kind": "require-call",
|
|
221
|
+
"external": true
|
|
222
|
+
}
|
|
223
|
+
],
|
|
112
224
|
"exports": [],
|
|
113
225
|
"entryPoint": "src/themes/gerwig.ts",
|
|
114
226
|
"inputs": {
|
|
@@ -125,7 +237,13 @@
|
|
|
125
237
|
"bytes": 392
|
|
126
238
|
},
|
|
127
239
|
"dist/themes/microvideo.cjs.js": {
|
|
128
|
-
"imports": [
|
|
240
|
+
"imports": [
|
|
241
|
+
{
|
|
242
|
+
"path": "@mux/mux-player/themes/microvideo",
|
|
243
|
+
"kind": "require-call",
|
|
244
|
+
"external": true
|
|
245
|
+
}
|
|
246
|
+
],
|
|
129
247
|
"exports": [],
|
|
130
248
|
"entryPoint": "src/themes/microvideo.ts",
|
|
131
249
|
"inputs": {
|
|
@@ -142,7 +260,13 @@
|
|
|
142
260
|
"bytes": 374
|
|
143
261
|
},
|
|
144
262
|
"dist/themes/minimal.cjs.js": {
|
|
145
|
-
"imports": [
|
|
263
|
+
"imports": [
|
|
264
|
+
{
|
|
265
|
+
"path": "@mux/mux-player/themes/minimal",
|
|
266
|
+
"kind": "require-call",
|
|
267
|
+
"external": true
|
|
268
|
+
}
|
|
269
|
+
],
|
|
146
270
|
"exports": [],
|
|
147
271
|
"entryPoint": "src/themes/minimal.ts",
|
|
148
272
|
"inputs": {
|
package/dist/esm.json
CHANGED
|
@@ -2,56 +2,125 @@
|
|
|
2
2
|
"inputs": {
|
|
3
3
|
"src/common/utils.ts": {
|
|
4
4
|
"bytes": 2048,
|
|
5
|
-
"imports": []
|
|
5
|
+
"imports": [],
|
|
6
|
+
"format": "esm"
|
|
6
7
|
},
|
|
7
8
|
"src/useCombinedRefs.ts": {
|
|
8
9
|
"bytes": 892,
|
|
9
|
-
"imports": [
|
|
10
|
+
"imports": [
|
|
11
|
+
{
|
|
12
|
+
"path": "react",
|
|
13
|
+
"kind": "import-statement",
|
|
14
|
+
"external": true
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"format": "esm"
|
|
10
18
|
},
|
|
11
19
|
"src/useObjectPropEffect.ts": {
|
|
12
20
|
"bytes": 1850,
|
|
13
|
-
"imports": [
|
|
21
|
+
"imports": [
|
|
22
|
+
{
|
|
23
|
+
"path": "react",
|
|
24
|
+
"kind": "import-statement",
|
|
25
|
+
"external": true
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"format": "esm"
|
|
14
29
|
},
|
|
15
30
|
"src/env.ts": {
|
|
16
31
|
"bytes": 245,
|
|
17
|
-
"imports": []
|
|
32
|
+
"imports": [],
|
|
33
|
+
"format": "esm"
|
|
18
34
|
},
|
|
19
35
|
"src/index.tsx": {
|
|
20
36
|
"bytes": 9862,
|
|
21
37
|
"imports": [
|
|
38
|
+
{
|
|
39
|
+
"path": "react",
|
|
40
|
+
"kind": "import-statement",
|
|
41
|
+
"external": true
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"path": "@mux/playback-core",
|
|
45
|
+
"kind": "import-statement",
|
|
46
|
+
"external": true
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"path": "@mux/mux-player",
|
|
50
|
+
"kind": "import-statement",
|
|
51
|
+
"external": true
|
|
52
|
+
},
|
|
22
53
|
{
|
|
23
54
|
"path": "src/common/utils.ts",
|
|
24
|
-
"kind": "import-statement"
|
|
55
|
+
"kind": "import-statement",
|
|
56
|
+
"original": "./common/utils"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"path": "react",
|
|
60
|
+
"kind": "import-statement",
|
|
61
|
+
"external": true
|
|
25
62
|
},
|
|
26
63
|
{
|
|
27
64
|
"path": "src/useCombinedRefs.ts",
|
|
28
|
-
"kind": "import-statement"
|
|
65
|
+
"kind": "import-statement",
|
|
66
|
+
"original": "./useCombinedRefs"
|
|
29
67
|
},
|
|
30
68
|
{
|
|
31
69
|
"path": "src/useObjectPropEffect.ts",
|
|
32
|
-
"kind": "import-statement"
|
|
70
|
+
"kind": "import-statement",
|
|
71
|
+
"original": "./useObjectPropEffect"
|
|
33
72
|
},
|
|
34
73
|
{
|
|
35
74
|
"path": "src/env.ts",
|
|
36
|
-
"kind": "import-statement"
|
|
75
|
+
"kind": "import-statement",
|
|
76
|
+
"original": "./env"
|
|
37
77
|
}
|
|
38
|
-
]
|
|
78
|
+
],
|
|
79
|
+
"format": "esm"
|
|
39
80
|
},
|
|
40
81
|
"src/themes/classic.ts": {
|
|
41
82
|
"bytes": 81,
|
|
42
|
-
"imports": [
|
|
83
|
+
"imports": [
|
|
84
|
+
{
|
|
85
|
+
"path": "@mux/mux-player/themes/classic",
|
|
86
|
+
"kind": "import-statement",
|
|
87
|
+
"external": true
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"format": "esm"
|
|
43
91
|
},
|
|
44
92
|
"src/themes/gerwig.ts": {
|
|
45
93
|
"bytes": 79,
|
|
46
|
-
"imports": [
|
|
94
|
+
"imports": [
|
|
95
|
+
{
|
|
96
|
+
"path": "@mux/mux-player/themes/gerwig",
|
|
97
|
+
"kind": "import-statement",
|
|
98
|
+
"external": true
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"format": "esm"
|
|
47
102
|
},
|
|
48
103
|
"src/themes/microvideo.ts": {
|
|
49
104
|
"bytes": 87,
|
|
50
|
-
"imports": [
|
|
105
|
+
"imports": [
|
|
106
|
+
{
|
|
107
|
+
"path": "@mux/mux-player/themes/microvideo",
|
|
108
|
+
"kind": "import-statement",
|
|
109
|
+
"external": true
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"format": "esm"
|
|
51
113
|
},
|
|
52
114
|
"src/themes/minimal.ts": {
|
|
53
115
|
"bytes": 81,
|
|
54
|
-
"imports": [
|
|
116
|
+
"imports": [
|
|
117
|
+
{
|
|
118
|
+
"path": "@mux/mux-player/themes/minimal",
|
|
119
|
+
"kind": "import-statement",
|
|
120
|
+
"external": true
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"format": "esm"
|
|
55
124
|
}
|
|
56
125
|
},
|
|
57
126
|
"outputs": {
|
|
@@ -59,10 +128,41 @@
|
|
|
59
128
|
"imports": [],
|
|
60
129
|
"exports": [],
|
|
61
130
|
"inputs": {},
|
|
62
|
-
"bytes":
|
|
131
|
+
"bytes": 22012
|
|
63
132
|
},
|
|
64
133
|
"dist/index.mjs": {
|
|
65
|
-
"imports": [
|
|
134
|
+
"imports": [
|
|
135
|
+
{
|
|
136
|
+
"path": "react",
|
|
137
|
+
"kind": "import-statement",
|
|
138
|
+
"external": true
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"path": "@mux/playback-core",
|
|
142
|
+
"kind": "import-statement",
|
|
143
|
+
"external": true
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"path": "@mux/mux-player",
|
|
147
|
+
"kind": "import-statement",
|
|
148
|
+
"external": true
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"path": "react",
|
|
152
|
+
"kind": "import-statement",
|
|
153
|
+
"external": true
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"path": "react",
|
|
157
|
+
"kind": "import-statement",
|
|
158
|
+
"external": true
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"path": "react",
|
|
162
|
+
"kind": "import-statement",
|
|
163
|
+
"external": true
|
|
164
|
+
}
|
|
165
|
+
],
|
|
66
166
|
"exports": [
|
|
67
167
|
"MaxResolution",
|
|
68
168
|
"MediaError",
|
|
@@ -79,16 +179,16 @@
|
|
|
79
179
|
"bytesInOutput": 522
|
|
80
180
|
},
|
|
81
181
|
"src/useCombinedRefs.ts": {
|
|
82
|
-
"bytesInOutput":
|
|
182
|
+
"bytesInOutput": 175
|
|
83
183
|
},
|
|
84
184
|
"src/useObjectPropEffect.ts": {
|
|
85
|
-
"bytesInOutput":
|
|
185
|
+
"bytesInOutput": 602
|
|
86
186
|
},
|
|
87
187
|
"src/env.ts": {
|
|
88
188
|
"bytesInOutput": 71
|
|
89
189
|
}
|
|
90
190
|
},
|
|
91
|
-
"bytes":
|
|
191
|
+
"bytes": 3427
|
|
92
192
|
},
|
|
93
193
|
"dist/themes/classic.mjs.map": {
|
|
94
194
|
"imports": [],
|
|
@@ -97,7 +197,13 @@
|
|
|
97
197
|
"bytes": 251
|
|
98
198
|
},
|
|
99
199
|
"dist/themes/classic.mjs": {
|
|
100
|
-
"imports": [
|
|
200
|
+
"imports": [
|
|
201
|
+
{
|
|
202
|
+
"path": "@mux/mux-player/themes/classic",
|
|
203
|
+
"kind": "import-statement",
|
|
204
|
+
"external": true
|
|
205
|
+
}
|
|
206
|
+
],
|
|
101
207
|
"exports": [
|
|
102
208
|
"default"
|
|
103
209
|
],
|
|
@@ -116,7 +222,13 @@
|
|
|
116
222
|
"bytes": 247
|
|
117
223
|
},
|
|
118
224
|
"dist/themes/gerwig.mjs": {
|
|
119
|
-
"imports": [
|
|
225
|
+
"imports": [
|
|
226
|
+
{
|
|
227
|
+
"path": "@mux/mux-player/themes/gerwig",
|
|
228
|
+
"kind": "import-statement",
|
|
229
|
+
"external": true
|
|
230
|
+
}
|
|
231
|
+
],
|
|
120
232
|
"exports": [
|
|
121
233
|
"default"
|
|
122
234
|
],
|
|
@@ -135,7 +247,13 @@
|
|
|
135
247
|
"bytes": 263
|
|
136
248
|
},
|
|
137
249
|
"dist/themes/microvideo.mjs": {
|
|
138
|
-
"imports": [
|
|
250
|
+
"imports": [
|
|
251
|
+
{
|
|
252
|
+
"path": "@mux/mux-player/themes/microvideo",
|
|
253
|
+
"kind": "import-statement",
|
|
254
|
+
"external": true
|
|
255
|
+
}
|
|
256
|
+
],
|
|
139
257
|
"exports": [
|
|
140
258
|
"default"
|
|
141
259
|
],
|
|
@@ -154,7 +272,13 @@
|
|
|
154
272
|
"bytes": 251
|
|
155
273
|
},
|
|
156
274
|
"dist/themes/minimal.mjs": {
|
|
157
|
-
"imports": [
|
|
275
|
+
"imports": [
|
|
276
|
+
{
|
|
277
|
+
"path": "@mux/mux-player/themes/minimal",
|
|
278
|
+
"kind": "import-statement",
|
|
279
|
+
"external": true
|
|
280
|
+
}
|
|
281
|
+
],
|
|
158
282
|
"exports": [
|
|
159
283
|
"default"
|
|
160
284
|
],
|
package/dist/esm.lazy.json
CHANGED
|
@@ -2,73 +2,145 @@
|
|
|
2
2
|
"inputs": {
|
|
3
3
|
"src/ConditionalSuspense.tsx": {
|
|
4
4
|
"bytes": 449,
|
|
5
|
-
"imports": [
|
|
5
|
+
"imports": [
|
|
6
|
+
{
|
|
7
|
+
"path": "react",
|
|
8
|
+
"kind": "import-statement",
|
|
9
|
+
"external": true
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"format": "esm"
|
|
6
13
|
},
|
|
7
14
|
"src/useIsBrowser.ts": {
|
|
8
15
|
"bytes": 286,
|
|
9
|
-
"imports": [
|
|
16
|
+
"imports": [
|
|
17
|
+
{
|
|
18
|
+
"path": "react",
|
|
19
|
+
"kind": "import-statement",
|
|
20
|
+
"external": true
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"format": "esm"
|
|
10
24
|
},
|
|
11
25
|
"src/useIsIntersecting.ts": {
|
|
12
26
|
"bytes": 645,
|
|
13
|
-
"imports": [
|
|
27
|
+
"imports": [
|
|
28
|
+
{
|
|
29
|
+
"path": "react",
|
|
30
|
+
"kind": "import-statement",
|
|
31
|
+
"external": true
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"format": "esm"
|
|
14
35
|
},
|
|
15
36
|
"src/common/utils.ts": {
|
|
16
37
|
"bytes": 2048,
|
|
17
|
-
"imports": []
|
|
38
|
+
"imports": [],
|
|
39
|
+
"format": "esm"
|
|
18
40
|
},
|
|
19
41
|
"src/useCombinedRefs.ts": {
|
|
20
42
|
"bytes": 892,
|
|
21
|
-
"imports": [
|
|
43
|
+
"imports": [
|
|
44
|
+
{
|
|
45
|
+
"path": "react",
|
|
46
|
+
"kind": "import-statement",
|
|
47
|
+
"external": true
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"format": "esm"
|
|
22
51
|
},
|
|
23
52
|
"src/useObjectPropEffect.ts": {
|
|
24
53
|
"bytes": 1850,
|
|
25
|
-
"imports": [
|
|
54
|
+
"imports": [
|
|
55
|
+
{
|
|
56
|
+
"path": "react",
|
|
57
|
+
"kind": "import-statement",
|
|
58
|
+
"external": true
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"format": "esm"
|
|
26
62
|
},
|
|
27
63
|
"src/env.ts": {
|
|
28
64
|
"bytes": 245,
|
|
29
|
-
"imports": []
|
|
65
|
+
"imports": [],
|
|
66
|
+
"format": "esm"
|
|
30
67
|
},
|
|
31
68
|
"src/index.tsx": {
|
|
32
69
|
"bytes": 9862,
|
|
33
70
|
"imports": [
|
|
71
|
+
{
|
|
72
|
+
"path": "react",
|
|
73
|
+
"kind": "import-statement",
|
|
74
|
+
"external": true
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"path": "@mux/playback-core",
|
|
78
|
+
"kind": "import-statement",
|
|
79
|
+
"external": true
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"path": "@mux/mux-player",
|
|
83
|
+
"kind": "import-statement",
|
|
84
|
+
"external": true
|
|
85
|
+
},
|
|
34
86
|
{
|
|
35
87
|
"path": "src/common/utils.ts",
|
|
36
|
-
"kind": "import-statement"
|
|
88
|
+
"kind": "import-statement",
|
|
89
|
+
"original": "./common/utils"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"path": "react",
|
|
93
|
+
"kind": "import-statement",
|
|
94
|
+
"external": true
|
|
37
95
|
},
|
|
38
96
|
{
|
|
39
97
|
"path": "src/useCombinedRefs.ts",
|
|
40
|
-
"kind": "import-statement"
|
|
98
|
+
"kind": "import-statement",
|
|
99
|
+
"original": "./useCombinedRefs"
|
|
41
100
|
},
|
|
42
101
|
{
|
|
43
102
|
"path": "src/useObjectPropEffect.ts",
|
|
44
|
-
"kind": "import-statement"
|
|
103
|
+
"kind": "import-statement",
|
|
104
|
+
"original": "./useObjectPropEffect"
|
|
45
105
|
},
|
|
46
106
|
{
|
|
47
107
|
"path": "src/env.ts",
|
|
48
|
-
"kind": "import-statement"
|
|
108
|
+
"kind": "import-statement",
|
|
109
|
+
"original": "./env"
|
|
49
110
|
}
|
|
50
|
-
]
|
|
111
|
+
],
|
|
112
|
+
"format": "esm"
|
|
51
113
|
},
|
|
52
114
|
"src/lazy.tsx": {
|
|
53
115
|
"bytes": 4339,
|
|
54
116
|
"imports": [
|
|
117
|
+
{
|
|
118
|
+
"path": "react",
|
|
119
|
+
"kind": "import-statement",
|
|
120
|
+
"external": true
|
|
121
|
+
},
|
|
55
122
|
{
|
|
56
123
|
"path": "src/ConditionalSuspense.tsx",
|
|
57
|
-
"kind": "import-statement"
|
|
124
|
+
"kind": "import-statement",
|
|
125
|
+
"original": "./ConditionalSuspense"
|
|
58
126
|
},
|
|
59
127
|
{
|
|
60
128
|
"path": "src/useIsBrowser.ts",
|
|
61
|
-
"kind": "import-statement"
|
|
129
|
+
"kind": "import-statement",
|
|
130
|
+
"original": "./useIsBrowser"
|
|
62
131
|
},
|
|
63
132
|
{
|
|
64
133
|
"path": "src/useIsIntersecting.ts",
|
|
65
|
-
"kind": "import-statement"
|
|
134
|
+
"kind": "import-statement",
|
|
135
|
+
"original": "./useIsIntersecting"
|
|
66
136
|
},
|
|
67
137
|
{
|
|
68
138
|
"path": "src/index.tsx",
|
|
69
|
-
"kind": "dynamic-import"
|
|
139
|
+
"kind": "dynamic-import",
|
|
140
|
+
"original": "./index"
|
|
70
141
|
}
|
|
71
|
-
]
|
|
142
|
+
],
|
|
143
|
+
"format": "esm"
|
|
72
144
|
}
|
|
73
145
|
},
|
|
74
146
|
"outputs": {
|
|
@@ -76,12 +148,32 @@
|
|
|
76
148
|
"imports": [],
|
|
77
149
|
"exports": [],
|
|
78
150
|
"inputs": {},
|
|
79
|
-
"bytes":
|
|
151
|
+
"bytes": 8799
|
|
80
152
|
},
|
|
81
153
|
"dist/lazy.mjs": {
|
|
82
154
|
"imports": [
|
|
83
155
|
{
|
|
84
|
-
"path": "
|
|
156
|
+
"path": "react",
|
|
157
|
+
"kind": "import-statement",
|
|
158
|
+
"external": true
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"path": "react",
|
|
162
|
+
"kind": "import-statement",
|
|
163
|
+
"external": true
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"path": "react",
|
|
167
|
+
"kind": "import-statement",
|
|
168
|
+
"external": true
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"path": "react",
|
|
172
|
+
"kind": "import-statement",
|
|
173
|
+
"external": true
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"path": "dist/-PJBQBQCI.mjs",
|
|
85
177
|
"kind": "dynamic-import"
|
|
86
178
|
}
|
|
87
179
|
],
|
|
@@ -91,7 +183,7 @@
|
|
|
91
183
|
"entryPoint": "src/lazy.tsx",
|
|
92
184
|
"inputs": {
|
|
93
185
|
"src/lazy.tsx": {
|
|
94
|
-
"bytesInOutput":
|
|
186
|
+
"bytesInOutput": 1674
|
|
95
187
|
},
|
|
96
188
|
"src/ConditionalSuspense.tsx": {
|
|
97
189
|
"bytesInOutput": 166
|
|
@@ -105,14 +197,45 @@
|
|
|
105
197
|
},
|
|
106
198
|
"bytes": 2304
|
|
107
199
|
},
|
|
108
|
-
"dist/-
|
|
200
|
+
"dist/-PJBQBQCI.mjs.map": {
|
|
109
201
|
"imports": [],
|
|
110
202
|
"exports": [],
|
|
111
203
|
"inputs": {},
|
|
112
|
-
"bytes":
|
|
204
|
+
"bytes": 22012
|
|
113
205
|
},
|
|
114
|
-
"dist/-
|
|
115
|
-
"imports": [
|
|
206
|
+
"dist/-PJBQBQCI.mjs": {
|
|
207
|
+
"imports": [
|
|
208
|
+
{
|
|
209
|
+
"path": "react",
|
|
210
|
+
"kind": "import-statement",
|
|
211
|
+
"external": true
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"path": "@mux/playback-core",
|
|
215
|
+
"kind": "import-statement",
|
|
216
|
+
"external": true
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"path": "@mux/mux-player",
|
|
220
|
+
"kind": "import-statement",
|
|
221
|
+
"external": true
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"path": "react",
|
|
225
|
+
"kind": "import-statement",
|
|
226
|
+
"external": true
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"path": "react",
|
|
230
|
+
"kind": "import-statement",
|
|
231
|
+
"external": true
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"path": "react",
|
|
235
|
+
"kind": "import-statement",
|
|
236
|
+
"external": true
|
|
237
|
+
}
|
|
238
|
+
],
|
|
116
239
|
"exports": [
|
|
117
240
|
"MaxResolution",
|
|
118
241
|
"MediaError",
|
|
@@ -129,16 +252,16 @@
|
|
|
129
252
|
"bytesInOutput": 522
|
|
130
253
|
},
|
|
131
254
|
"src/useCombinedRefs.ts": {
|
|
132
|
-
"bytesInOutput":
|
|
255
|
+
"bytesInOutput": 175
|
|
133
256
|
},
|
|
134
257
|
"src/useObjectPropEffect.ts": {
|
|
135
|
-
"bytesInOutput":
|
|
258
|
+
"bytesInOutput": 602
|
|
136
259
|
},
|
|
137
260
|
"src/env.ts": {
|
|
138
261
|
"bytesInOutput": 71
|
|
139
262
|
}
|
|
140
263
|
},
|
|
141
|
-
"bytes":
|
|
264
|
+
"bytes": 3431
|
|
142
265
|
}
|
|
143
266
|
}
|
|
144
267
|
}
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var ne=Object.create;var c=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var ae=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty;var ie=(e,n)=>{for(var t in n)c(e,t,{get:n[t],enumerable:!0})},E=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of re(n))!oe.call(e,a)&&a!==t&&c(e,a,{get:()=>n[a],enumerable:!(o=te(n,a))||o.enumerable});return e};var se=(e,n,t)=>(t=e!=null?ne(ae(e)):{},E(n||!e||!e.__esModule?c(t,"default",{value:e,enumerable:!0}):t,e)),le=e=>E(c({},"__esModule",{value:!0}),e);var Ce={};ie(Ce,{MaxResolution:()=>d.MaxResolution,MediaError:()=>x.MediaError,MinResolution:()=>d.MinResolution,RenditionOrder:()=>d.RenditionOrder,default:()=>he});module.exports=le(Ce);var y=se(require("react")),d=require("@mux/playback-core"),x=require("@mux/mux-player");var g={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},ue=e=>e==null,ye=(e,n)=>ue(n)?!1:e in n,de=e=>e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),ce=(e,n)=>{if(!(typeof n=="boolean"&&!n)){if(ye(e,g))return g[e];if(typeof n!=null)return/[A-Z]/.test(e)?de(e):e}};var pe=(e,n)=>typeof e=="boolean"?"":e,M=(e={})=>Object.entries(e).reduce((n,[t,o])=>{let a=ce(t,o);if(!a)return n;let s=pe(o,t);return n[a]=s,n},{});var b=require("react");var p=require("react"),f=(...e)=>{let n=(0,p.useRef)(null);return(0,p.useEffect)(()=>{e.forEach(t=>{
|
|
1
|
+
"use strict";var ne=Object.create;var c=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var ae=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty;var ie=(e,n)=>{for(var t in n)c(e,t,{get:n[t],enumerable:!0})},E=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of re(n))!oe.call(e,a)&&a!==t&&c(e,a,{get:()=>n[a],enumerable:!(o=te(n,a))||o.enumerable});return e};var se=(e,n,t)=>(t=e!=null?ne(ae(e)):{},E(n||!e||!e.__esModule?c(t,"default",{value:e,enumerable:!0}):t,e)),le=e=>E(c({},"__esModule",{value:!0}),e);var Ce={};ie(Ce,{MaxResolution:()=>d.MaxResolution,MediaError:()=>x.MediaError,MinResolution:()=>d.MinResolution,RenditionOrder:()=>d.RenditionOrder,default:()=>he});module.exports=le(Ce);var y=se(require("react")),d=require("@mux/playback-core"),x=require("@mux/mux-player");var g={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},ue=e=>e==null,ye=(e,n)=>ue(n)?!1:e in n,de=e=>e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),ce=(e,n)=>{if(!(typeof n=="boolean"&&!n)){if(ye(e,g))return g[e];if(typeof n!=null)return/[A-Z]/.test(e)?de(e):e}};var pe=(e,n)=>typeof e=="boolean"?"":e,M=(e={})=>Object.entries(e).reduce((n,[t,o])=>{let a=ce(t,o);if(!a)return n;let s=pe(o,t);return n[a]=s,n},{});var b=require("react");var p=require("react"),f=(...e)=>{let n=(0,p.useRef)(null);return(0,p.useEffect)(()=>{e.forEach(t=>{t&&(typeof t=="function"?t(n.current):t.current=n.current)})},[e]),n};var P=require("react"),me=Object.prototype.hasOwnProperty,Ee=(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,s)=>n[s]===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(!me.call(n,t[a])||!Object.is(e[t[a]],n[t[a]]))return!1;return!0},m=(e,n,t)=>!Ee(n,e[t]),ge=(e,n,t)=>{e[t]=n},Me=(e,n,t,o=ge,a=m)=>(0,P.useEffect)(()=>{let s=t==null?void 0:t.current;s&&a(s,n,e)&&o(s,n,e)},[t==null?void 0:t.current,n]),i=Me;var fe=()=>{try{return"2.2.0"}catch{}return"UNKNOWN"},Pe=fe(),v=()=>Pe;var ve=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]),xe=(e,n)=>{let{onAbort:t,onCanPlay:o,onCanPlayThrough:a,onEmptied:s,onLoadStart:R,onLoadedData:T,onLoadedMetadata:h,onProgress:C,onDurationChange:k,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:_,onError:H,onCuePointChange:j,onCuePointsChange:z,metadata:F,tokens:W,paused:Z,playbackId:q,playbackRates:J,currentTime:Y,themeProps:$,extraSourceParams:Q,_hlsConfig:X,...B}=n;return i("playbackRates",J,e),i("metadata",F,e),i("extraSourceParams",Q,e),i("_hlsConfig",X,e),i("themeProps",$,e),i("tokens",W,e),i("playbackId",q,e),i("paused",Z,e,(l,u)=>{u!=null&&(u?l.pause():l.play())},(l,u,ee)=>l.hasAttribute("autoplay")&&!l.hasPlayed?!1:m(l,u,ee)),i("currentTime",Y,e,(l,u)=>{u!=null&&(l.currentTime=u)}),r("abort",e,t),r("canplay",e,o),r("canplaythrough",e,a),r("emptied",e,s),r("loadstart",e,R),r("loadeddata",e,T),r("loadedmetadata",e,h),r("progress",e,C),r("durationchange",e,k),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,_),r("error",e,H),r("cuepointchange",e,j),r("cuepointschange",e,z),[B]},be=v(),Re="mux-player-react",Te=y.default.forwardRef((e,n)=>{let t=(0,b.useRef)(null),o=f(t,n),[a]=xe(t,e);return y.default.createElement(ve,{ref:o,playerSoftwareName:Re,playerSoftwareVersion:be,...a})}),he=Te;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.tsx", "../src/common/utils.ts", "../src/useCombinedRefs.ts", "../src/useObjectPropEffect.ts", "../src/env.ts"],
|
|
4
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 disablePictureInPicture?: boolean;\n // metadata: Partial<Options[\"data\"]>;\n metadata: { [k: string]: any };\n extraSourceParams: Record<string, any>;\n _hlsConfig: MuxPlayerElement['_hlsConfig'];\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 extraSourceParams,\n _hlsConfig,\n ...remainingProps\n } = props;\n useObjectPropEffect('playbackRates', playbackRates, ref);\n useObjectPropEffect('metadata', metadata, ref);\n useObjectPropEffect('extraSourceParams', extraSourceParams, ref);\n useObjectPropEffect('_hlsConfig', _hlsConfig, 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": "ukBAAA,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,
|
|
5
|
+
"mappings": "ukBAAA,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,CAAC,EAAE,EAExFC,GAAmB,CAACC,EAAkBC,IAAuC,CACxF,GAAI,SAAOA,GAAc,WAAa,CAACA,GACvC,IAAIR,GAAQO,EAAUV,CAAsB,EAAG,OAAOA,EAAuBU,CAAQ,EACrF,GAAI,OAAOC,GAAa,KACxB,MAAI,QAAQ,KAAKD,CAAQ,EAAUJ,GAAYI,CAAQ,EAChDA,EACT,EAGO,IAAME,GAAoB,CAACC,EAAgBC,IAC5C,OAAOD,GAAc,UAAkB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CAAgB,EAC9DX,EAAuB,WAAYF,EAAKc,CAAU,EAClDZ,EAAuB,iBAAkBF,EAAKe,CAAgB,EAC9Db,EAAuB,eAAgBF,EAAKgB,CAAc,EAC1Dd,EAAuB,aAAcF,EAAKiB,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,CAACU,CAAc,CACxB,EAEMQ,GAAwBC,EAAiB,EACzCC,GAAqB,mBAErBC,GAAY,EAAAvD,QAAM,WAGtB,CAACE,EAAOC,IAAQ,CAChB,IAAMqD,KAAiB,UAAyB,IAAI,EAC9CC,EAAYC,EAAgBF,EAAgBrD,CAAG,EAC/C,CAACyC,CAAc,EAAInC,GAAU+C,EAAgBtD,CAAK,EAExD,OACE,EAAAF,QAAA,cAACD,GAAA,CAEC,IAAK0D,EACL,mBAAoBH,GACpB,sBAAuBF,GACtB,GAAGR,EACN,CAEJ,CAAC,EAEMe,GAAQJ",
|
|
6
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", "i", "keysA", "keysB", "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", "extraSourceParams", "_hlsConfig", "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 le}from"react";import{MaxResolution as Re,MinResolution as Te,RenditionOrder as he}from"@mux/playback-core";import{MediaError as ke}from"@mux/mux-player";var c={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},J=e=>e==null,Y=(e,n)=>J(n)?!1:e in n,$=e=>e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Q=(e,n)=>{if(!(typeof n=="boolean"&&!n)){if(Y(e,c))return c[e];if(typeof n!=null)return/[A-Z]/.test(e)?$(e):e}};var X=(e,n)=>typeof e=="boolean"?"":e,p=(e={})=>Object.entries(e).reduce((n,[t,o])=>{let a=Q(t,o);if(!a)return n;let s=X(o,t);return n[a]=s,n},{});import{useRef as ue}from"react";import{useEffect as B,useRef as ee}from"react";var m=(...e)=>{let n=ee(null);return B(()=>{e.forEach(t=>{
|
|
1
|
+
import y,{useEffect as le}from"react";import{MaxResolution as Re,MinResolution as Te,RenditionOrder as he}from"@mux/playback-core";import{MediaError as ke}from"@mux/mux-player";var c={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},J=e=>e==null,Y=(e,n)=>J(n)?!1:e in n,$=e=>e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Q=(e,n)=>{if(!(typeof n=="boolean"&&!n)){if(Y(e,c))return c[e];if(typeof n!=null)return/[A-Z]/.test(e)?$(e):e}};var X=(e,n)=>typeof e=="boolean"?"":e,p=(e={})=>Object.entries(e).reduce((n,[t,o])=>{let a=Q(t,o);if(!a)return n;let s=X(o,t);return n[a]=s,n},{});import{useRef as ue}from"react";import{useEffect as B,useRef as ee}from"react";var m=(...e)=>{let n=ee(null);return B(()=>{e.forEach(t=>{t&&(typeof t=="function"?t(n.current):t.current=n.current)})},[e]),n};import{useEffect as ne}from"react";var te=Object.prototype.hasOwnProperty,re=(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,s)=>n[s]===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(!te.call(n,t[a])||!Object.is(e[t[a]],n[t[a]]))return!1;return!0},d=(e,n,t)=>!re(n,e[t]),ae=(e,n,t)=>{e[t]=n},oe=(e,n,t,o=ae,a=d)=>ne(()=>{let s=t==null?void 0:t.current;s&&a(s,n,e)&&o(s,n,e)},[t==null?void 0:t.current,n]),i=oe;var ie=()=>{try{return"2.2.0"}catch{}return"UNKNOWN"},se=ie(),E=()=>se;var ye=y.forwardRef(({children:e,...n},t)=>y.createElement("mux-player",p({...n,ref:t}),e)),r=(e,n,t)=>le(()=>{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]),de=(e,n)=>{let{onAbort:t,onCanPlay:o,onCanPlayThrough:a,onEmptied:s,onLoadStart:g,onLoadedData:M,onLoadedMetadata:f,onProgress:P,onDurationChange:v,onVolumeChange:x,onRateChange:b,onResize:R,onWaiting:T,onPlay:h,onPlaying:C,onTimeUpdate:k,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:_,playbackRates:H,currentTime:j,themeProps:z,extraSourceParams:F,_hlsConfig:W,...Z}=n;return i("playbackRates",H,e),i("metadata",K,e),i("extraSourceParams",F,e),i("_hlsConfig",W,e),i("themeProps",z,e),i("tokens",D,e),i("playbackId",_,e),i("paused",U,e,(l,u)=>{u!=null&&(u?l.pause():l.play())},(l,u,q)=>l.hasAttribute("autoplay")&&!l.hasPlayed?!1:d(l,u,q)),i("currentTime",j,e,(l,u)=>{u!=null&&(l.currentTime=u)}),r("abort",e,t),r("canplay",e,o),r("canplaythrough",e,a),r("emptied",e,s),r("loadstart",e,g),r("loadeddata",e,M),r("loadedmetadata",e,f),r("progress",e,P),r("durationchange",e,v),r("volumechange",e,x),r("ratechange",e,b),r("resize",e,R),r("waiting",e,T),r("play",e,h),r("playing",e,C),r("timeupdate",e,k),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),[Z]},ce=E(),pe="mux-player-react",me=y.forwardRef((e,n)=>{let t=ue(null),o=m(t,n),[a]=de(t,e);return y.createElement(ye,{ref:o,playerSoftwareName:pe,playerSoftwareVersion:ce,...a})}),Ve=me;export{Re as MaxResolution,ke as MediaError,Te as MinResolution,he as RenditionOrder,Ve as default};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.tsx", "../src/common/utils.ts", "../src/useCombinedRefs.ts", "../src/useObjectPropEffect.ts", "../src/env.ts"],
|
|
4
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 disablePictureInPicture?: boolean;\n // metadata: Partial<Options[\"data\"]>;\n metadata: { [k: string]: any };\n extraSourceParams: Record<string, any>;\n _hlsConfig: MuxPlayerElement['_hlsConfig'];\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 extraSourceParams,\n _hlsConfig,\n ...remainingProps\n } = props;\n useObjectPropEffect('playbackRates', playbackRates, ref);\n useObjectPropEffect('metadata', metadata, ref);\n useObjectPropEffect('extraSourceParams', extraSourceParams, ref);\n useObjectPropEffect('_hlsConfig', _hlsConfig, 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,
|
|
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,CAAC,EAAE,EAExFC,EAAmB,CAACC,EAAkBC,IAAuC,CACxF,GAAI,SAAOA,GAAc,WAAa,CAACA,GACvC,IAAIR,EAAQO,EA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B,sBAAuBF,GACtB,GAAGR,EACN,CAEJ,CAAC,EAEMgB,GAAQL",
|
|
6
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", "i", "keysA", "keysB", "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", "extraSourceParams", "_hlsConfig", "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("./-
|
|
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("./-PJBQBQCI.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;
|
package/dist/lazy.mjs.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/lazy.tsx", "../src/ConditionalSuspense.tsx", "../src/useIsBrowser.ts", "../src/useIsIntersecting.ts"],
|
|
4
4
|
"sourcesContent": ["import React, { useEffect, useState } from 'react';\nimport type { DetailedHTMLProps, HTMLAttributes } from 'react';\nimport type { ValueOf } from '@mux/playback-core';\n\nimport ConditionalSuspense from './ConditionalSuspense';\nimport useIsBrowser from './useIsBrowser';\nimport useIsIntersecting from './useIsIntersecting';\n\nimport type { MuxPlayerProps, MuxPlayerRefAttributes } from './index';\n\ninterface MuxPlayerElement extends DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement> {\n nohotkeys?: boolean | undefined;\n}\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n 'mux-player': MuxPlayerElement;\n }\n }\n}\n\nconst MuxPlayerIndex = React.lazy(() => import('./index'));\n\ninterface FallbackProps extends MuxPlayerProps {\n onIntersection?: () => void;\n}\nconst Fallback = (props: FallbackProps) => {\n const { style, className, onIntersection, placeholder } = props;\n\n const intersectionRef = React.useRef<HTMLElement>(null);\n const isIntersecting = useIsIntersecting(intersectionRef);\n\n useEffect(() => {\n if (isIntersecting && onIntersection) {\n onIntersection();\n }\n }, [isIntersecting, onIntersection]);\n\n return (\n /* \n Why do we have a mux-player element before the mux-player bundle is even loaded?\n Before the bundle is loaded, this mux-player element just acts like a div.\n However, by calling this placeholder \"mux-player\",\n it now gets the same CSS applied to it that the eventual \"real\" mux-player element will. \n */\n <>\n <mux-player\n ref={intersectionRef}\n data-mux-player-react-lazy-placeholder\n placeholder={placeholder}\n style={\n {\n '--mux-player-react-lazy-placeholder': placeholder ? `url(${placeholder});` : '',\n ...style,\n } as React.CSSProperties\n }\n className={className || ''}\n // since there's a possibility that the bundle loads before Suspense clears this placeholder,\n // we need to make sure that the placeholder isn't interactive and its player chrome in doesn't get rendered\n nohotkeys\n aria-hidden\n tabIndex={-1}\n >\n <div data-mux-player-react-lazy-placeholder-overlay />\n </mux-player>\n <style>{\n /* css */ `\n mux-player[data-mux-player-react-lazy-placeholder] {\n aspect-ratio: 16/9;\n display: block;\n background-color: var(--media-background-color, #000);\n width: 100%;\n position: relative;\n background-image: var(--mux-player-react-lazy-placeholder);\n background-repeat: no-repeat;\n background-size: var(--media-object-fit, contain);\n background-position: var(--media-object-position, 50% 50%);\n --controls: none;\n --controls-backdrop-color: rgba(0, 0, 0, 0.6);\n }\n mux-player [data-mux-player-react-lazy-placeholder-overlay] {\n position: absolute;\n inset: 0;\n background-color: var(--controls-backdrop-color);\n }\n `\n }</style>\n </>\n );\n};\n\ntype LoadingType = {\n PAGE: 'page';\n VIEWPORT: 'viewport';\n};\n\nconst LoadingType: LoadingType = {\n PAGE: 'page',\n VIEWPORT: 'viewport',\n};\n\ninterface MuxPlayerLazyProps extends MuxPlayerProps {\n loading?: ValueOf<LoadingType>;\n}\nconst MuxPlayer = React.forwardRef<MuxPlayerRefAttributes, MuxPlayerLazyProps>((props, ref) => {\n const { loading = LoadingType.VIEWPORT, ...playerProps } = props;\n\n // We load mux player once two conditions are met:\n // 1. We're in a browser (react.lazy doesn't work on the server in react 17)\n const isBrowser = useIsBrowser();\n // 2. The player has entered the viewport, according to the fallback (if enabled).\n const [isIntersecting, setIsIntersecting] = useState(() => (loading === LoadingType.VIEWPORT ? false : true));\n\n return (\n <ConditionalSuspense\n condition={isBrowser && isIntersecting}\n fallback={\n <Fallback\n style={playerProps.style}\n className={playerProps.className}\n placeholder={playerProps.placeholder}\n onIntersection={() => setIsIntersecting(true)}\n />\n }\n >\n <MuxPlayerIndex {...playerProps} ref={ref} />\n </ConditionalSuspense>\n );\n});\n\nexport default MuxPlayer;\n", "import React, { Suspense } from 'react';\n\ntype Props = {\n fallback: React.ReactChild | React.ReactFragment | React.ReactPortal | null;\n condition: boolean;\n children: React.ReactNode;\n};\nconst ConditionalSuspense = ({ condition, fallback, children, ...rest }: Props) => {\n return condition ? (\n <Suspense fallback={fallback} {...rest}>\n {children}\n </Suspense>\n ) : (\n <>{fallback}</>\n );\n};\n\nexport default ConditionalSuspense;\n", "import { useState, useEffect } from 'react';\n\nconst useIsBrowser = () => {\n const [isBrowser, setIsBrowser] = useState(false);\n\n useEffect(() => {\n if (typeof window !== 'undefined') {\n setIsBrowser(true);\n }\n }, []);\n\n return isBrowser;\n};\n\nexport default useIsBrowser;\n", "import { useState, useEffect } from 'react';\n\nconst useIsIntersecting = (ref: React.RefObject<HTMLElement>, options?: IntersectionObserverInit) => {\n const [isIntersecting, setIsIntersecting] = useState(false);\n\n useEffect(() => {\n if (typeof IntersectionObserver === 'function') {\n const observer = new IntersectionObserver(([entry]) => {\n setIsIntersecting(entry.isIntersecting);\n }, options);\n\n if (ref.current) {\n observer.observe(ref.current);\n }\n\n return () => {\n observer.disconnect();\n };\n }\n }, [ref, options]);\n\n return isIntersecting;\n};\n\nexport default useIsIntersecting;\n"],
|
|
5
|
-
"mappings": "AAAA,OAAOA,GAAS,aAAAC,EAAW,YAAAC,MAAgB,QCA3C,OAAOC,GAAS,YAAAC,MAAgB,QAOhC,IAAMC,EAAsB,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,SAAAC,
|
|
5
|
+
"mappings": "AAAA,OAAOA,GAAS,aAAAC,EAAW,YAAAC,MAAgB,QCA3C,OAAOC,GAAS,YAAAC,MAAgB,QAOhC,IAAMC,EAAsB,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,SAAAC,EAAU,GAAGC,CAAK,IAC7DH,EACLH,EAAA,cAACC,EAAA,CAAS,SAAUG,EAAW,GAAGE,GAC/BD,CACH,EAEAL,EAAA,cAAAA,EAAA,cAAGI,CAAS,EAITG,EAAQL,ECjBf,OAAS,YAAAM,EAAU,aAAAC,MAAiB,QAEpC,IAAMC,EAAe,IAAM,CACzB,GAAM,CAACC,EAAWC,CAAY,EAAIJ,EAAS,EAAK,EAEhD,OAAAC,EAAU,IAAM,CACV,OAAO,QAAW,aACpBG,EAAa,EAAI,CAErB,EAAG,CAAC,CAAC,EAEED,CACT,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OACN,SAAU,UACZ,EAKMC,EAAYZ,EAAM,WAAuD,CAACE,EAAOW,IAAQ,CAC7F,GAAM,CAAE,QAAAC,EAAUH,EAAY,SAAU,GAAGI,CAAY,EAAIb,EAIrDc,EAAYC,EAAa,EAEzB,CAACT,EAAgBU,CAAiB,EAAIC,EAAS,IAAOL,IAAYH,EAAY,QAAwB,EAE5G,OACEX,EAAA,cAACoB,EAAA,CACC,UAAWJ,GAAaR,EACxB,SACER,EAAA,cAACC,EAAA,CACC,MAAOc,EAAY,MACnB,UAAWA,EAAY,UACvB,YAAaA,EAAY,YACzB,eAAgB,IAAMG,EAAkB,EAAI,EAC9C,GAGFlB,EAAA,cAACD,EAAA,CAAgB,GAAGgB,EAAa,IAAKF,EAAK,CAC7C,CAEJ,CAAC,EAEMQ,EAAQT",
|
|
6
6
|
"names": ["React", "useEffect", "useState", "React", "Suspense", "ConditionalSuspense", "condition", "fallback", "children", "rest", "ConditionalSuspense_default", "useState", "useEffect", "useIsBrowser", "isBrowser", "setIsBrowser", "useIsBrowser_default", "useState", "useEffect", "useIsIntersecting", "ref", "options", "isIntersecting", "setIsIntersecting", "observer", "entry", "useIsIntersecting_default", "MuxPlayerIndex", "React", "Fallback", "props", "style", "className", "onIntersection", "placeholder", "intersectionRef", "isIntersecting", "useIsIntersecting_default", "useEffect", "LoadingType", "MuxPlayer", "ref", "loading", "playerProps", "isBrowser", "useIsBrowser_default", "setIsIntersecting", "useState", "ConditionalSuspense_default", "lazy_default"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mux/mux-player-react",
|
|
3
|
-
"version": "2.2.0-canary.0-
|
|
3
|
+
"version": "2.2.0-canary.0-4cdc52d",
|
|
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.2.0-canary.0-
|
|
102
|
-
"@mux/playback-core": "0.21.0-canary.0-
|
|
101
|
+
"@mux/mux-player": "2.2.0-canary.0-4cdc52d",
|
|
102
|
+
"@mux/playback-core": "0.21.0-canary.0-4cdc52d",
|
|
103
103
|
"prop-types": "^15.7.2"
|
|
104
104
|
},
|
|
105
105
|
"devDependencies": {
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"@types/react": "^17.0.37",
|
|
108
108
|
"@types/react-dom": "^17.0.11",
|
|
109
109
|
"downlevel-dts": "^0.11.0",
|
|
110
|
-
"esbuild": "^0.
|
|
110
|
+
"esbuild": "^0.19.8",
|
|
111
111
|
"npm-run-all": "^4.1.5",
|
|
112
112
|
"react": "^17.0.2",
|
|
113
113
|
"react-dom": "^17.0.2",
|
package/dist/-A5AHX2ZL.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import y,{useEffect as le}from"react";import{MaxResolution as Re,MinResolution as Te,RenditionOrder as he}from"@mux/playback-core";import{MediaError as ke}from"@mux/mux-player";var c={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},J=e=>e==null,Y=(e,n)=>J(n)?!1:e in n,$=e=>e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Q=(e,n)=>{if(!(typeof n=="boolean"&&!n)){if(Y(e,c))return c[e];if(typeof n!=null)return/[A-Z]/.test(e)?$(e):e}};var X=(e,n)=>typeof e=="boolean"?"":e,p=(e={})=>Object.entries(e).reduce((n,[t,o])=>{let a=Q(t,o);if(!a)return n;let s=X(o,t);return n[a]=s,n},{});import{useRef as ue}from"react";import{useEffect as B,useRef as ee}from"react";var m=(...e)=>{let n=ee(null);return B(()=>{e.forEach(t=>{!t||(typeof t=="function"?t(n.current):t.current=n.current)})},[e]),n};import{useEffect as ne}from"react";var te=Object.prototype.hasOwnProperty,re=(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,s)=>n[s]===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(!te.call(n,t[a])||!Object.is(e[t[a]],n[t[a]]))return!1;return!0},d=(e,n,t)=>!re(n,e[t]),ae=(e,n,t)=>{e[t]=n},oe=(e,n,t,o=ae,a=d)=>ne(()=>{let s=t==null?void 0:t.current;!s||!a(s,n,e)||o(s,n,e)},[t==null?void 0:t.current,n]),i=oe;var ie=()=>{try{return"2.2.0"}catch{}return"UNKNOWN"},se=ie(),E=()=>se;var ye=y.forwardRef(({children:e,...n},t)=>y.createElement("mux-player",p({...n,ref:t}),e)),r=(e,n,t)=>le(()=>{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]),de=(e,n)=>{let{onAbort:t,onCanPlay:o,onCanPlayThrough:a,onEmptied:s,onLoadStart:g,onLoadedData:M,onLoadedMetadata:f,onProgress:P,onDurationChange:v,onVolumeChange:x,onRateChange:b,onResize:R,onWaiting:T,onPlay:h,onPlaying:C,onTimeUpdate:k,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:_,playbackRates:H,currentTime:j,themeProps:z,extraSourceParams:F,_hlsConfig:W,...Z}=n;return i("playbackRates",H,e),i("metadata",K,e),i("extraSourceParams",F,e),i("_hlsConfig",W,e),i("themeProps",z,e),i("tokens",D,e),i("playbackId",_,e),i("paused",U,e,(l,u)=>{u!=null&&(u?l.pause():l.play())},(l,u,q)=>l.hasAttribute("autoplay")&&!l.hasPlayed?!1:d(l,u,q)),i("currentTime",j,e,(l,u)=>{u!=null&&(l.currentTime=u)}),r("abort",e,t),r("canplay",e,o),r("canplaythrough",e,a),r("emptied",e,s),r("loadstart",e,g),r("loadeddata",e,M),r("loadedmetadata",e,f),r("progress",e,P),r("durationchange",e,v),r("volumechange",e,x),r("ratechange",e,b),r("resize",e,R),r("waiting",e,T),r("play",e,h),r("playing",e,C),r("timeupdate",e,k),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),[Z]},ce=E(),pe="mux-player-react",me=y.forwardRef((e,n)=>{let t=ue(null),o=m(t,n),[a]=de(t,e);return y.createElement(ye,{ref:o,playerSoftwareName:pe,playerSoftwareVersion:ce,...a})}),Ve=me;export{Re as MaxResolution,ke as MediaError,Te as MinResolution,he as RenditionOrder,Ve as default};
|
|
2
|
-
//# sourceMappingURL=-A5AHX2ZL.mjs.map
|