@mux/mux-player-react 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/dist/{-QEWOA6LP.mjs → -5Z6NQIRW.mjs} +2 -2
- package/dist/-5Z6NQIRW.mjs.map +7 -0
- package/dist/esm.lazy.json +5 -5
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +2 -2
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +2 -2
- package/dist/lazy.mjs +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types-ts3.4/index.d.ts +2 -0
- package/package.json +7 -7
- package/dist/-QEWOA6LP.mjs.map +0 -7
package/README.md
CHANGED
|
@@ -5,9 +5,13 @@
|
|
|
5
5
|
<a href="https://www.npmjs.com/package/@mux/mux-player-react"><img src="https://img.shields.io/npm/l/@mux/mux-player-react.svg?sanitize=true" alt="License"></a>
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
|
-
# New release:
|
|
8
|
+
# New release: 3.0
|
|
9
9
|
|
|
10
|
-
Mux Player
|
|
10
|
+
Mux Player recently released 3.0. The most visible change in this is new tooltips that are enabled by default, as well as [other fixes and changes](https://docs.mux.com/guides/player-releases-web#300).
|
|
11
|
+
|
|
12
|
+
## Previous version: 2.0
|
|
13
|
+
|
|
14
|
+
For changes relating to the previous major release, 2.0, see the [V1 to V2 upgrade guide](https://github.com/muxinc/elements/blob/main/packages/mux-player/UPGRADING_V1_to_V2.md) and the [blog post announcement](https://www.mux.com/blog/mux-player-2-0-for-web-and-coming-soon-for-ios-and-android).
|
|
11
15
|
|
|
12
16
|
# Introduction
|
|
13
17
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import y,{useEffect as ye}from"react";import{MaxResolution as Re,MinResolution as Ce,RenditionOrder as ke}from"@mux/playback-core";import{MediaError as Oe}from"@mux/mux-player";var d={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},$=e=>e==null,Q=(e,n)=>$(n)?!1:e in n,X=e=>e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),B=(e,n)=>{if(!(typeof n=="boolean"&&!n)){if(Q(e,d))return d[e];if(typeof n!=null)return/[A-Z]/.test(e)?X(e):e}};var ee=(e,n)=>typeof e=="boolean"?"":e,p=(e={})=>Object.entries(e).reduce((n,[t,o])=>{let r=B(t,o);if(!r)return n;let s=ee(o,t);return n[r]=s,n},{});import{useRef as ce}from"react";import{useEffect as ne,useRef as te}from"react";var m=(...e)=>{let n=te(null);return ne(()=>{e.forEach(t=>{t&&(typeof t=="function"?t(n.current):t.current=n.current)})},[e]),n};import{useEffect as ae}from"react";var re=Object.prototype.hasOwnProperty,oe=(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((r,s)=>n[s]===r);let t=Object.keys(e),o=Object.keys(n);if(t.length!==o.length)return!1;for(let r=0;r<t.length;r++)if(!re.call(n,t[r])||!Object.is(e[t[r]],n[t[r]]))return!1;return!0},c=(e,n,t)=>!oe(n,e[t]),ie=(e,n,t)=>{e[t]=n},se=(e,n,t,o=ie,r=c)=>ae(()=>{let s=t==null?void 0:t.current;s&&r(s,n,e)&&o(s,n,e)},[t==null?void 0:t.current,n]),i=se;var le=()=>{try{return"3.
|
|
2
|
-
//# sourceMappingURL=-
|
|
1
|
+
"use client";import y,{useEffect as ye}from"react";import{MaxResolution as Re,MinResolution as Ce,RenditionOrder as ke}from"@mux/playback-core";import{MediaError as Oe}from"@mux/mux-player";var d={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},$=e=>e==null,Q=(e,n)=>$(n)?!1:e in n,X=e=>e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),B=(e,n)=>{if(!(typeof n=="boolean"&&!n)){if(Q(e,d))return d[e];if(typeof n!=null)return/[A-Z]/.test(e)?X(e):e}};var ee=(e,n)=>typeof e=="boolean"?"":e,p=(e={})=>Object.entries(e).reduce((n,[t,o])=>{let r=B(t,o);if(!r)return n;let s=ee(o,t);return n[r]=s,n},{});import{useRef as ce}from"react";import{useEffect as ne,useRef as te}from"react";var m=(...e)=>{let n=te(null);return ne(()=>{e.forEach(t=>{t&&(typeof t=="function"?t(n.current):t.current=n.current)})},[e]),n};import{useEffect as ae}from"react";var re=Object.prototype.hasOwnProperty,oe=(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((r,s)=>n[s]===r);let t=Object.keys(e),o=Object.keys(n);if(t.length!==o.length)return!1;for(let r=0;r<t.length;r++)if(!re.call(n,t[r])||!Object.is(e[t[r]],n[t[r]]))return!1;return!0},c=(e,n,t)=>!oe(n,e[t]),ie=(e,n,t)=>{e[t]=n},se=(e,n,t,o=ie,r=c)=>ae(()=>{let s=t==null?void 0:t.current;s&&r(s,n,e)&&o(s,n,e)},[t==null?void 0:t.current,n]),i=se;var le=()=>{try{return"3.1.0"}catch{}return"UNKNOWN"},ue=le(),E=()=>ue;var de=y.forwardRef(({children:e,...n},t)=>y.createElement("mux-player",p({...n,ref:t}),e)),a=(e,n,t)=>ye(()=>{let o=n==null?void 0:n.current;if(!(!o||!t))return o.addEventListener(e,t),()=>{o.removeEventListener(e,t)}},[n==null?void 0:n.current,t]),pe=(e,n)=>{let{onAbort:t,onCanPlay:o,onCanPlayThrough:r,onEmptied:s,onLoadStart:g,onLoadedData:M,onLoadedMetadata:f,onProgress:P,onDurationChange:b,onVolumeChange:v,onRateChange:x,onResize:h,onWaiting:T,onPlay:R,onPlaying:C,onTimeUpdate:k,onPause:L,onSeeking:O,onSeeked:S,onStalled:G,onSuspend:w,onEnded:V,onError:A,onCuePointChange:N,onCuePointsChange:D,onChapterChange:I,metadata:K,tokens:U,paused:_,playbackId:H,playbackRates:j,currentTime:z,themeProps:F,extraSourceParams:W,castCustomData:Z,_hlsConfig:q,...J}=n;return i("playbackRates",j,e),i("metadata",K,e),i("extraSourceParams",W,e),i("_hlsConfig",q,e),i("themeProps",F,e),i("tokens",U,e),i("playbackId",H,e),i("castCustomData",Z,e),i("paused",_,e,(l,u)=>{u!=null&&(u?l.pause():l.play())},(l,u,Y)=>l.hasAttribute("autoplay")&&!l.hasPlayed?!1:c(l,u,Y)),i("currentTime",z,e,(l,u)=>{u!=null&&(l.currentTime=u)}),a("abort",e,t),a("canplay",e,o),a("canplaythrough",e,r),a("emptied",e,s),a("loadstart",e,g),a("loadeddata",e,M),a("loadedmetadata",e,f),a("progress",e,P),a("durationchange",e,b),a("volumechange",e,v),a("ratechange",e,x),a("resize",e,h),a("waiting",e,T),a("play",e,R),a("playing",e,C),a("timeupdate",e,k),a("pause",e,L),a("seeking",e,O),a("seeked",e,S),a("stalled",e,G),a("suspend",e,w),a("ended",e,V),a("error",e,A),a("cuepointchange",e,N),a("cuepointschange",e,D),a("chapterchange",e,I),[J]},me=E(),Ee="mux-player-react",ge=y.forwardRef((e,n)=>{let t=ce(null),o=m(t,n),[r]=pe(t,e);return y.createElement(de,{ref:o,playerSoftwareName:Ee,playerSoftwareVersion:me,...r})}),Ne=ge;export{Re as MaxResolution,Oe as MediaError,Ce as MinResolution,ke as RenditionOrder,Ne as default};
|
|
2
|
+
//# sourceMappingURL=-5Z6NQIRW.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.tsx", "../src/common/utils.ts", "../src/useCombinedRefs.ts", "../src/useObjectPropEffect.ts", "../src/env.ts"],
|
|
4
|
+
"sourcesContent": ["'use client';\nimport 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 disableTracking: 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 castReceiver?: string | undefined;\n castCustomData?: Record<string, any> | undefined;\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 programStartTime?: number;\n programEndTime?: number;\n assetStartTime?: number;\n assetEndTime?: number;\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 defaultDuration?: number;\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 onChapterChange?: GenericEventListener<MuxPlayerElementEventMap['chapterchange']>;\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 onChapterChange,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n currentTime,\n themeProps,\n extraSourceParams,\n castCustomData,\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('castCustomData', castCustomData, 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('chapterchange', ref, onChapterChange);\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 'UNK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,EAAKuB,CAAY,EACtDrB,EAAuB,QAASF,EAAKwB,CAAO,EAC5CtB,EAAuB,UAAWF,EAAKyB,CAAS,EAChDvB,EAAuB,SAAUF,EAAK0B,CAAQ,EAC9CxB,EAAuB,UAAWF,EAAK2B,CAAS,EAChDzB,EAAuB,UAAWF,EAAK4B,CAAS,EAChD1B,EAAuB,QAASF,EAAK6B,CAAO,EAC5C3B,EAAuB,QAASF,EAAK8B,CAAO,EAC5C5B,EAAuB,iBAAkBF,EAAK+B,CAAgB,EAC9D7B,EAAuB,kBAAmBF,EAAKgC,CAAiB,EAChE9B,EAAuB,gBAAiBF,EAAKiC,CAAe,EACrD,CAACW,CAAc,CACxB,EAEMQ,GAAwBC,EAAiB,EACzCC,GAAqB,mBAErBC,GAAY1D,EAAM,WAGtB,CAACE,EAAOC,IAAQ,CAChB,IAAMwD,EAAiBC,GAAyB,IAAI,EAC9CC,EAAYC,EAAgBH,EAAgBxD,CAAG,EAC/C,CAAC4C,CAAc,EAAIrC,GAAUiD,EAAgBzD,CAAK,EAExD,OACEF,EAAA,cAACD,GAAA,CAEC,IAAK8D,EACL,mBAAoBJ,GACpB,sBAAuBF,GACtB,GAAGR,EACN,CAEJ,CAAC,EAEMgB,GAAQL",
|
|
6
|
+
"names": ["React", "useEffect", "MaxResolution", "MinResolution", "RenditionOrder", "MediaError", "ReactPropToAttrNameMap", "isNil", "x", "isKeyOf", "k", "o", "toKebabCase", "string", "match", "toNativeAttrName", "propName", "propValue", "toNativeAttrValue", "propValue", "propName", "toNativeProps", "props", "transformedProps", "attrName", "toNativeAttrName", "attrValue", "useRef", "useEffect", "useRef", "useCombinedRefs", "refs", "targetRef", "ref", "useEffect", "hasOwnProperty", "shallowEqual", "objA", "objB", "vVal", "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", "onChapterChange", "metadata", "tokens", "paused", "playbackId", "playbackRates", "currentTime", "themeProps", "extraSourceParams", "castCustomData", "_hlsConfig", "remainingProps", "useObjectPropEffect_default", "playerEl", "pausedVal", "value", "propName", "defaultHasChanged", "currentTimeVal", "playerSoftwareVersion", "getPlayerVersion", "playerSoftwareName", "MuxPlayer", "innerPlayerRef", "useRef", "playerRef", "useCombinedRefs", "src_default"]
|
|
7
|
+
}
|
package/dist/esm.lazy.json
CHANGED
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"format": "esm"
|
|
67
67
|
},
|
|
68
68
|
"src/index.tsx": {
|
|
69
|
-
"bytes":
|
|
69
|
+
"bytes": 10260,
|
|
70
70
|
"imports": [
|
|
71
71
|
{
|
|
72
72
|
"path": "react",
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
"external": true
|
|
174
174
|
},
|
|
175
175
|
{
|
|
176
|
-
"path": "dist/-
|
|
176
|
+
"path": "dist/-5Z6NQIRW.mjs",
|
|
177
177
|
"kind": "dynamic-import"
|
|
178
178
|
}
|
|
179
179
|
],
|
|
@@ -197,13 +197,13 @@
|
|
|
197
197
|
},
|
|
198
198
|
"bytes": 2330
|
|
199
199
|
},
|
|
200
|
-
"dist/-
|
|
200
|
+
"dist/-5Z6NQIRW.mjs.map": {
|
|
201
201
|
"imports": [],
|
|
202
202
|
"exports": [],
|
|
203
203
|
"inputs": {},
|
|
204
|
-
"bytes":
|
|
204
|
+
"bytes": 22551
|
|
205
205
|
},
|
|
206
|
-
"dist/-
|
|
206
|
+
"dist/-5Z6NQIRW.mjs": {
|
|
207
207
|
"imports": [
|
|
208
208
|
{
|
|
209
209
|
"path": "react",
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var ae=Object.create;var d=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var ie=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var le=(e,n)=>{for(var t in n)d(e,t,{get:n[t],enumerable:!0})},E=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of oe(n))!se.call(e,r)&&r!==t&&d(e,r,{get:()=>n[r],enumerable:!(o=re(n,r))||o.enumerable});return e};var ue=(e,n,t)=>(t=e!=null?ae(ie(e)):{},E(n||!e||!e.__esModule?d(t,"default",{value:e,enumerable:!0}):t,e)),ye=e=>E(d({},"__esModule",{value:!0}),e);var Le={};le(Le,{MaxResolution:()=>c.MaxResolution,MediaError:()=>v.MediaError,MinResolution:()=>c.MinResolution,RenditionOrder:()=>c.RenditionOrder,default:()=>ke});module.exports=ye(Le);var y=ue(require("react")),c=require("@mux/playback-core"),v=require("@mux/mux-player");var g={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},ce=e=>e==null,de=(e,n)=>ce(n)?!1:e in n,pe=e=>e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),me=(e,n)=>{if(!(typeof n=="boolean"&&!n)){if(de(e,g))return g[e];if(typeof n!=null)return/[A-Z]/.test(e)?pe(e):e}};var Ee=(e,n)=>typeof e=="boolean"?"":e,M=(e={})=>Object.entries(e).reduce((n,[t,o])=>{let r=me(t,o);if(!r)return n;let s=Ee(o,t);return n[r]=s,n},{});var x=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"),ge=Object.prototype.hasOwnProperty,Me=(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((r,s)=>n[s]===r);let t=Object.keys(e),o=Object.keys(n);if(t.length!==o.length)return!1;for(let r=0;r<t.length;r++)if(!ge.call(n,t[r])||!Object.is(e[t[r]],n[t[r]]))return!1;return!0},m=(e,n,t)=>!Me(n,e[t]),fe=(e,n,t)=>{e[t]=n},Pe=(e,n,t,o=fe,r=m)=>(0,P.useEffect)(()=>{let s=t==null?void 0:t.current;s&&r(s,n,e)&&o(s,n,e)},[t==null?void 0:t.current,n]),i=Pe;var be=()=>{try{return"3.
|
|
1
|
+
"use strict";"use client";var ae=Object.create;var d=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var ie=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var le=(e,n)=>{for(var t in n)d(e,t,{get:n[t],enumerable:!0})},E=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of oe(n))!se.call(e,r)&&r!==t&&d(e,r,{get:()=>n[r],enumerable:!(o=re(n,r))||o.enumerable});return e};var ue=(e,n,t)=>(t=e!=null?ae(ie(e)):{},E(n||!e||!e.__esModule?d(t,"default",{value:e,enumerable:!0}):t,e)),ye=e=>E(d({},"__esModule",{value:!0}),e);var Le={};le(Le,{MaxResolution:()=>c.MaxResolution,MediaError:()=>v.MediaError,MinResolution:()=>c.MinResolution,RenditionOrder:()=>c.RenditionOrder,default:()=>ke});module.exports=ye(Le);var y=ue(require("react")),c=require("@mux/playback-core"),v=require("@mux/mux-player");var g={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},ce=e=>e==null,de=(e,n)=>ce(n)?!1:e in n,pe=e=>e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),me=(e,n)=>{if(!(typeof n=="boolean"&&!n)){if(de(e,g))return g[e];if(typeof n!=null)return/[A-Z]/.test(e)?pe(e):e}};var Ee=(e,n)=>typeof e=="boolean"?"":e,M=(e={})=>Object.entries(e).reduce((n,[t,o])=>{let r=me(t,o);if(!r)return n;let s=Ee(o,t);return n[r]=s,n},{});var x=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"),ge=Object.prototype.hasOwnProperty,Me=(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((r,s)=>n[s]===r);let t=Object.keys(e),o=Object.keys(n);if(t.length!==o.length)return!1;for(let r=0;r<t.length;r++)if(!ge.call(n,t[r])||!Object.is(e[t[r]],n[t[r]]))return!1;return!0},m=(e,n,t)=>!Me(n,e[t]),fe=(e,n,t)=>{e[t]=n},Pe=(e,n,t,o=fe,r=m)=>(0,P.useEffect)(()=>{let s=t==null?void 0:t.current;s&&r(s,n,e)&&o(s,n,e)},[t==null?void 0:t.current,n]),i=Pe;var be=()=>{try{return"3.1.0"}catch{}return"UNKNOWN"},ve=be(),b=()=>ve;var xe=y.default.forwardRef(({children:e,...n},t)=>y.default.createElement("mux-player",M({...n,ref:t}),e)),a=(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]),he=(e,n)=>{let{onAbort:t,onCanPlay:o,onCanPlayThrough:r,onEmptied:s,onLoadStart:h,onLoadedData:T,onLoadedMetadata:R,onProgress:C,onDurationChange:k,onVolumeChange:L,onRateChange:O,onResize:S,onWaiting:G,onPlay:w,onPlaying:V,onTimeUpdate:A,onPause:N,onSeeking:D,onSeeked:I,onStalled:K,onSuspend:U,onEnded:_,onError:H,onCuePointChange:j,onCuePointsChange:z,onChapterChange:F,metadata:W,tokens:Z,paused:q,playbackId:J,playbackRates:Y,currentTime:$,themeProps:Q,extraSourceParams:X,castCustomData:B,_hlsConfig:ee,...ne}=n;return i("playbackRates",Y,e),i("metadata",W,e),i("extraSourceParams",X,e),i("_hlsConfig",ee,e),i("themeProps",Q,e),i("tokens",Z,e),i("playbackId",J,e),i("castCustomData",B,e),i("paused",q,e,(l,u)=>{u!=null&&(u?l.pause():l.play())},(l,u,te)=>l.hasAttribute("autoplay")&&!l.hasPlayed?!1:m(l,u,te)),i("currentTime",$,e,(l,u)=>{u!=null&&(l.currentTime=u)}),a("abort",e,t),a("canplay",e,o),a("canplaythrough",e,r),a("emptied",e,s),a("loadstart",e,h),a("loadeddata",e,T),a("loadedmetadata",e,R),a("progress",e,C),a("durationchange",e,k),a("volumechange",e,L),a("ratechange",e,O),a("resize",e,S),a("waiting",e,G),a("play",e,w),a("playing",e,V),a("timeupdate",e,A),a("pause",e,N),a("seeking",e,D),a("seeked",e,I),a("stalled",e,K),a("suspend",e,U),a("ended",e,_),a("error",e,H),a("cuepointchange",e,j),a("cuepointschange",e,z),a("chapterchange",e,F),[ne]},Te=b(),Re="mux-player-react",Ce=y.default.forwardRef((e,n)=>{let t=(0,x.useRef)(null),o=f(t,n),[r]=he(t,e);return y.default.createElement(xe,{ref:o,playerSoftwareName:Re,playerSoftwareVersion:Te,...r})}),ke=Ce;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.tsx", "../src/common/utils.ts", "../src/useCombinedRefs.ts", "../src/useObjectPropEffect.ts", "../src/env.ts"],
|
|
4
|
-
"sourcesContent": ["'use client';\nimport 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 disableTracking: 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 castReceiver?: string | undefined;\n castCustomData?: Record<string, any> | undefined;\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 programStartTime?: number;\n programEndTime?: number;\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 defaultDuration?: number;\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 onChapterChange?: GenericEventListener<MuxPlayerElementEventMap['chapterchange']>;\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 onChapterChange,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n currentTime,\n themeProps,\n extraSourceParams,\n castCustomData,\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('castCustomData', castCustomData, 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('chapterchange', ref, onChapterChange);\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 = getEnvPlay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AA,YAAAA,EAAK,QAASD,CAAS,CAAC,EAGvBI,EAAQN,GCjEf,IAAMO,GAAsB,IAAM,CAChC,GAAI,CAEF,MAAO,OACT,MAAQ,CAAC,CACT,MAAO,SACT,EAEMC,GAAyBD,GAAoB,EAEtCE,EAAmB,IAAMD,
|
|
4
|
+
"sourcesContent": ["'use client';\nimport 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 disableTracking: 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 castReceiver?: string | undefined;\n castCustomData?: Record<string, any> | undefined;\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 programStartTime?: number;\n programEndTime?: number;\n assetStartTime?: number;\n assetEndTime?: number;\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 defaultDuration?: number;\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 onChapterChange?: GenericEventListener<MuxPlayerElementEventMap['chapterchange']>;\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 onChapterChange,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n currentTime,\n themeProps,\n extraSourceParams,\n castCustomData,\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('castCustomData', castCustomData, 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('chapterchange', ref, onChapterChange);\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": "olBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,iJAAAE,KAAA,eAAAC,GAAAH,IACA,IAAAI,EAAiC,qBAUjCC,EAA6D,8BAC7DC,EAA2B,2BCR3B,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,GACpCA,EAGIE,EAAgB,CAACC,EAAQ,CAAC,IAC9B,OAAO,QAAQA,CAAK,EAAE,OAAgC,CAACC,EAAkB,CAACH,EAAUD,CAAS,IAAM,CACxG,IAAMK,EAAWC,GAAiBL,EAAUD,CAAS,EAGrD,GAAI,CAACK,EACH,OAAOD,EAGT,IAAMG,E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AcF,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,EAChE7B,EAAuB,gBAAiBF,EAAKgC,CAAe,EACrD,CAACW,EAAc,CACxB,EAEMQ,GAAwBC,EAAiB,EACzCC,GAAqB,mBAErBC,GAAY,EAAAzD,QAAM,WAGtB,CAACE,EAAOC,IAAQ,CAChB,IAAMuD,KAAiB,UAAyB,IAAI,EAC9CC,EAAYC,EAAgBF,EAAgBvD,CAAG,EAC/C,CAAC2C,CAAc,EAAIrC,GAAUiD,EAAgBxD,CAAK,EAExD,OACE,EAAAF,QAAA,cAACD,GAAA,CAEC,IAAK4D,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", "onChapterChange", "metadata", "tokens", "paused", "playbackId", "playbackRates", "currentTime", "themeProps", "extraSourceParams", "castCustomData", "_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
|
-
"use client";import y,{useEffect as ye}from"react";import{MaxResolution as Re,MinResolution as Ce,RenditionOrder as ke}from"@mux/playback-core";import{MediaError as Oe}from"@mux/mux-player";var d={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},$=e=>e==null,Q=(e,n)=>$(n)?!1:e in n,X=e=>e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),B=(e,n)=>{if(!(typeof n=="boolean"&&!n)){if(Q(e,d))return d[e];if(typeof n!=null)return/[A-Z]/.test(e)?X(e):e}};var ee=(e,n)=>typeof e=="boolean"?"":e,p=(e={})=>Object.entries(e).reduce((n,[t,o])=>{let r=B(t,o);if(!r)return n;let s=ee(o,t);return n[r]=s,n},{});import{useRef as ce}from"react";import{useEffect as ne,useRef as te}from"react";var m=(...e)=>{let n=te(null);return ne(()=>{e.forEach(t=>{t&&(typeof t=="function"?t(n.current):t.current=n.current)})},[e]),n};import{useEffect as ae}from"react";var re=Object.prototype.hasOwnProperty,oe=(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((r,s)=>n[s]===r);let t=Object.keys(e),o=Object.keys(n);if(t.length!==o.length)return!1;for(let r=0;r<t.length;r++)if(!re.call(n,t[r])||!Object.is(e[t[r]],n[t[r]]))return!1;return!0},c=(e,n,t)=>!oe(n,e[t]),ie=(e,n,t)=>{e[t]=n},se=(e,n,t,o=ie,r=c)=>ae(()=>{let s=t==null?void 0:t.current;s&&r(s,n,e)&&o(s,n,e)},[t==null?void 0:t.current,n]),i=se;var le=()=>{try{return"3.
|
|
1
|
+
"use client";import y,{useEffect as ye}from"react";import{MaxResolution as Re,MinResolution as Ce,RenditionOrder as ke}from"@mux/playback-core";import{MediaError as Oe}from"@mux/mux-player";var d={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},$=e=>e==null,Q=(e,n)=>$(n)?!1:e in n,X=e=>e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),B=(e,n)=>{if(!(typeof n=="boolean"&&!n)){if(Q(e,d))return d[e];if(typeof n!=null)return/[A-Z]/.test(e)?X(e):e}};var ee=(e,n)=>typeof e=="boolean"?"":e,p=(e={})=>Object.entries(e).reduce((n,[t,o])=>{let r=B(t,o);if(!r)return n;let s=ee(o,t);return n[r]=s,n},{});import{useRef as ce}from"react";import{useEffect as ne,useRef as te}from"react";var m=(...e)=>{let n=te(null);return ne(()=>{e.forEach(t=>{t&&(typeof t=="function"?t(n.current):t.current=n.current)})},[e]),n};import{useEffect as ae}from"react";var re=Object.prototype.hasOwnProperty,oe=(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((r,s)=>n[s]===r);let t=Object.keys(e),o=Object.keys(n);if(t.length!==o.length)return!1;for(let r=0;r<t.length;r++)if(!re.call(n,t[r])||!Object.is(e[t[r]],n[t[r]]))return!1;return!0},c=(e,n,t)=>!oe(n,e[t]),ie=(e,n,t)=>{e[t]=n},se=(e,n,t,o=ie,r=c)=>ae(()=>{let s=t==null?void 0:t.current;s&&r(s,n,e)&&o(s,n,e)},[t==null?void 0:t.current,n]),i=se;var le=()=>{try{return"3.1.0"}catch{}return"UNKNOWN"},ue=le(),E=()=>ue;var de=y.forwardRef(({children:e,...n},t)=>y.createElement("mux-player",p({...n,ref:t}),e)),a=(e,n,t)=>ye(()=>{let o=n==null?void 0:n.current;if(!(!o||!t))return o.addEventListener(e,t),()=>{o.removeEventListener(e,t)}},[n==null?void 0:n.current,t]),pe=(e,n)=>{let{onAbort:t,onCanPlay:o,onCanPlayThrough:r,onEmptied:s,onLoadStart:g,onLoadedData:M,onLoadedMetadata:f,onProgress:P,onDurationChange:b,onVolumeChange:v,onRateChange:x,onResize:h,onWaiting:T,onPlay:R,onPlaying:C,onTimeUpdate:k,onPause:L,onSeeking:O,onSeeked:S,onStalled:G,onSuspend:w,onEnded:V,onError:A,onCuePointChange:N,onCuePointsChange:D,onChapterChange:I,metadata:K,tokens:U,paused:_,playbackId:H,playbackRates:j,currentTime:z,themeProps:F,extraSourceParams:W,castCustomData:Z,_hlsConfig:q,...J}=n;return i("playbackRates",j,e),i("metadata",K,e),i("extraSourceParams",W,e),i("_hlsConfig",q,e),i("themeProps",F,e),i("tokens",U,e),i("playbackId",H,e),i("castCustomData",Z,e),i("paused",_,e,(l,u)=>{u!=null&&(u?l.pause():l.play())},(l,u,Y)=>l.hasAttribute("autoplay")&&!l.hasPlayed?!1:c(l,u,Y)),i("currentTime",z,e,(l,u)=>{u!=null&&(l.currentTime=u)}),a("abort",e,t),a("canplay",e,o),a("canplaythrough",e,r),a("emptied",e,s),a("loadstart",e,g),a("loadeddata",e,M),a("loadedmetadata",e,f),a("progress",e,P),a("durationchange",e,b),a("volumechange",e,v),a("ratechange",e,x),a("resize",e,h),a("waiting",e,T),a("play",e,R),a("playing",e,C),a("timeupdate",e,k),a("pause",e,L),a("seeking",e,O),a("seeked",e,S),a("stalled",e,G),a("suspend",e,w),a("ended",e,V),a("error",e,A),a("cuepointchange",e,N),a("cuepointschange",e,D),a("chapterchange",e,I),[J]},me=E(),Ee="mux-player-react",ge=y.forwardRef((e,n)=>{let t=ce(null),o=m(t,n),[r]=pe(t,e);return y.createElement(de,{ref:o,playerSoftwareName:Ee,playerSoftwareVersion:me,...r})}),Ne=ge;export{Re as MaxResolution,Oe as MediaError,Ce as MinResolution,ke as RenditionOrder,Ne as default};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.tsx", "../src/common/utils.ts", "../src/useCombinedRefs.ts", "../src/useObjectPropEffect.ts", "../src/env.ts"],
|
|
4
|
-
"sourcesContent": ["'use client';\nimport 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 disableTracking: 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 castReceiver?: string | undefined;\n castCustomData?: Record<string, any> | undefined;\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 programStartTime?: number;\n programEndTime?: number;\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 defaultDuration?: number;\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 onChapterChange?: GenericEventListener<MuxPlayerElementEventMap['chapterchange']>;\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 onChapterChange,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n currentTime,\n themeProps,\n extraSourceParams,\n castCustomData,\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('castCustomData', castCustomData, 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('chapterchange', ref, onChapterChange);\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": "aACA,OAAOA,GAAS,aAAAC,OAAiB,QAUjC,OAAS,iBAAAC,GAAe,iBAAAC,GAAe,kBAAAC,OAAsB,qBAC7D,OAAS,cAAAC,OAAkB,kBCR3B,IAAMC,EAAyB,CAC7B,UAAW,QACX,UAAW,QACX,QAAS,MACT,YAAa,cACb,QAAS,UACT,YAAa,cACb,SAAU,WACV,aAAc,cAChB,EAKaC,EAASC,GAAsCA,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AOD,GAAS,UAAYA,IAAS,MAAQ,OAAOC,GAAS,UAAYA,IAAS,KACpF,MAAO,GAGT,GAAI,MAAM,QAAQD,CAAI,EAEpB,MAAI,CAAC,MAAM,QAAQC,CAAI,GAAKD,EAAK,SAAWC,EAAK,OAAe,GAEzDD,EAAK,KAAK,CAACE,EAAMC,IAAMF,EAAKE,CAAC,IAAMD,CAAI,EAGhD,IAAME,EAAQ,OAAO,KAAKJ,CAAI,EACxBK,EAAQ,OAAO,KAAKJ,CAAI,EAE9B,GAAIG,EAAM,SAAWC,EAAM,OACzB,MAAO,GAIT,QAASF,EAAI,EAAGA,EAAIC,EAAM,OAAQD,IAChC,GAAI,CAACL,GAAe,KAAKG,EAAMG,EAAMD,CAAC,CAAC,GAAK,CAAC,OAAO,GAAGH,EAAKI,EAAMD,CAAC,CAAC,EAAGF,EAAKG,EAAMD,CAAC,CAAC,CAAC,EACnF,MAAO,GAIX,MAAO,EACT,EAEaG,EAAoB,CAACC,EAAUC,EAAQC,IAC3C,CAACV,GAAaS,EAAGD,EAAIE,CAAC,CAAC,EAG1BC,GAAqB,CAACH,EAAUC,EAAQC,IAAc,CAC1DF,EAAIE,CAAC,EAAID,CACX,EAEaG,GAAsB,CACjCC,EACAC,EACAC,EACAC,EAAcL,GACdM,EAAaV,IAENT,GAAU,IAAM,CACrB,IAAMU,EAAMO,GAAA,YAAAA,EAAK,QACZP,GACAS,EAAWT,EAAKM,EAAWD,CAAQ,GACxCG,EAAYR,EAAKM,EAAWD,CAAQ,CACtC,EAAG,CAACE,GAAA,YAAAA,EAAK,QAASD,CAAS,CAAC,EAGvBI,EAAQN,GCjEf,IAAMO,GAAsB,IAAM,CAChC,GAAI,CAEF,MAAO,OACT,MAAQ,CAAC,CACT,MAAO,SACT,EAEMC,GAAyBD,GAAoB,EAEtCE,EAAmB,IAAMD,
|
|
4
|
+
"sourcesContent": ["'use client';\nimport 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 disableTracking: 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 castReceiver?: string | undefined;\n castCustomData?: Record<string, any> | undefined;\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 programStartTime?: number;\n programEndTime?: number;\n assetStartTime?: number;\n assetEndTime?: number;\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 defaultDuration?: number;\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 onChapterChange?: GenericEventListener<MuxPlayerElementEventMap['chapterchange']>;\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 onChapterChange,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n currentTime,\n themeProps,\n extraSourceParams,\n castCustomData,\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('castCustomData', castCustomData, 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('chapterchange', ref, onChapterChange);\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 getPlayer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AC5CtB,EAAuB,UAAWF,EAAKyB,CAAS,EAChDvB,EAAuB,SAAUF,EAAK0B,CAAQ,EAC9CxB,EAAuB,UAAWF,EAAK2B,CAAS,EAChDzB,EAAuB,UAAWF,EAAK4B,CAAS,EAChD1B,EAAuB,QAASF,EAAK6B,CAAO,EAC5C3B,EAAuB,QAASF,EAAK8B,CAAO,EAC5C5B,EAAuB,iBAAkBF,EAAK+B,CAAgB,EAC9D7B,EAAuB,kBAAmBF,EAAKgC,CAAiB,EAChE9B,EAAuB,gBAAiBF,EAAKiC,CAAe,EACrD,CAACW,CAAc,CACxB,EAEMQ,GAAwBC,EAAiB,EACzCC,GAAqB,mBAErBC,GAAY1D,EAAM,WAGtB,CAACE,EAAOC,IAAQ,CAChB,IAAMwD,EAAiBC,GAAyB,IAAI,EAC9CC,EAAYC,EAAgBH,EAAgBxD,CAAG,EAC/C,CAAC4C,CAAc,EAAIrC,GAAUiD,EAAgBzD,CAAK,EAExD,OACEF,EAAA,cAACD,GAAA,CAEC,IAAK8D,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", "onChapterChange", "metadata", "tokens", "paused", "playbackId", "playbackRates", "currentTime", "themeProps", "extraSourceParams", "castCustomData", "_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
|
-
"use client";import a,{useEffect as h,useState as k}from"react";import c,{Suspense as y}from"react";var m=({condition:t,fallback:r,children:n,...e})=>t?c.createElement(y,{fallback:r,...e},n):c.createElement(c.Fragment,null,r),i=m;import{useState as f,useEffect as x}from"react";var b=()=>{let[t,r]=f(!1);return x(()=>{typeof window!="undefined"&&r(!0)},[]),t},u=b;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 o=new IntersectionObserver(([s])=>{e(s.isIntersecting)},r);return t.current&&o.observe(t.current),()=>{o.disconnect()}}},[t,r]),n},p=g;var v=a.lazy(()=>import("./-
|
|
1
|
+
"use client";import a,{useEffect as h,useState as k}from"react";import c,{Suspense as y}from"react";var m=({condition:t,fallback:r,children:n,...e})=>t?c.createElement(y,{fallback:r,...e},n):c.createElement(c.Fragment,null,r),i=m;import{useState as f,useEffect as x}from"react";var b=()=>{let[t,r]=f(!1);return x(()=>{typeof window!="undefined"&&r(!0)},[]),t},u=b;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 o=new IntersectionObserver(([s])=>{e(s.isIntersecting)},r);return t.current&&o.observe(t.current),()=>{o.disconnect()}}},[t,r]),n},p=g;var v=a.lazy(()=>import("./-5Z6NQIRW.mjs")),R=t=>{let{style:r,className:n,onIntersection:e,placeholder:o}=t,s=a.useRef(null),l=p(s);return h(()=>{l&&e&&e()},[l,e]),a.createElement(a.Fragment,null,a.createElement("mux-player",{ref:s,"data-mux-player-react-lazy-placeholder":!0,placeholder:o!=null?o:"",style:{"--mux-player-react-lazy-placeholder":o?`url('${o}');`:"",...r},className:n||"",nohotkeys:!0,"aria-hidden":!0,tabIndex:-1},a.createElement("div",{"data-mux-player-react-lazy-placeholder-overlay":!0})),a.createElement("style",null,`
|
|
2
2
|
mux-player[data-mux-player-react-lazy-placeholder] {
|
|
3
3
|
aspect-ratio: 16/9;
|
|
4
4
|
display: block;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.dom.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/typescript/lib/lib.scripthost.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/typescript/lib/lib.es2019.full.d.ts","../../../node_modules/@types/react/global.d.ts","../../../node_modules/csstype/index.d.ts","../../../node_modules/@types/prop-types/index.d.ts","../../../node_modules/@types/react/index.d.ts","../src/ConditionalSuspense.tsx","../src/env.ts","../../../node_modules/mux-embed/dist/types/mux-embed.d.ts","../../playback-core/dist/types/errors.d.ts","../../../node_modules/hls.js/dist/hls.js.d.ts","../../playback-core/dist/types/types.d.ts","../../playback-core/dist/types/hls.d.ts","../../playback-core/dist/types/text-tracks.d.ts","../../playback-core/dist/types/pdt.d.ts","../../playback-core/dist/types/index.d.ts","../../../node_modules/media-chrome/dist/constants.d.ts","../../../node_modules/media-chrome/dist/labels/labels.d.ts","../../../node_modules/media-chrome/dist/utils/time.d.ts","../../../node_modules/media-chrome/dist/utils/server-safe-globals.d.ts","../../../node_modules/media-chrome/dist/media-gesture-receiver.d.ts","../../../node_modules/media-chrome/dist/media-container.d.ts","../../../node_modules/media-chrome/dist/utils/attribute-token-list.d.ts","../../../node_modules/media-chrome/dist/media-store/state-mediator.d.ts","../../../node_modules/media-chrome/dist/media-store/request-map.d.ts","../../../node_modules/media-chrome/dist/media-store/media-store.d.ts","../../../node_modules/media-chrome/dist/media-controller.d.ts","../../../node_modules/media-chrome/dist/media-tooltip.d.ts","../../../node_modules/media-chrome/dist/media-chrome-button.d.ts","../../../node_modules/media-chrome/dist/media-airplay-button.d.ts","../../../node_modules/media-chrome/dist/utils/TextTrackLike.d.ts","../../../node_modules/media-chrome/dist/media-captions-button.d.ts","../../../node_modules/media-chrome/dist/media-cast-button.d.ts","../../../node_modules/media-chrome/dist/media-chrome-dialog.d.ts","../../../node_modules/media-chrome/dist/media-chrome-range.d.ts","../../../node_modules/media-chrome/dist/media-control-bar.d.ts","../../../node_modules/media-chrome/dist/media-text-display.d.ts","../../../node_modules/media-chrome/dist/media-duration-display.d.ts","../../../node_modules/media-chrome/dist/media-fullscreen-button.d.ts","../../../node_modules/media-chrome/dist/media-live-button.d.ts","../../../node_modules/media-chrome/dist/media-loading-indicator.d.ts","../../../node_modules/media-chrome/dist/media-mute-button.d.ts","../../../node_modules/media-chrome/dist/media-pip-button.d.ts","../../../node_modules/media-chrome/dist/media-playback-rate-button.d.ts","../../../node_modules/media-chrome/dist/media-play-button.d.ts","../../../node_modules/media-chrome/dist/media-poster-image.d.ts","../../../node_modules/media-chrome/dist/media-preview-chapter-display.d.ts","../../../node_modules/media-chrome/dist/media-preview-thumbnail.d.ts","../../../node_modules/media-chrome/dist/media-preview-time-display.d.ts","../../../node_modules/media-chrome/dist/media-seek-backward-button.d.ts","../../../node_modules/media-chrome/dist/media-seek-forward-button.d.ts","../../../node_modules/media-chrome/dist/media-time-display.d.ts","../../../node_modules/media-chrome/dist/media-time-range.d.ts","../../../node_modules/media-chrome/dist/media-volume-range.d.ts","../../../node_modules/media-chrome/dist/index.d.ts","../../../node_modules/media-chrome/dist/experimental/index.d.ts","../../../node_modules/custom-media-element/custom-media-element.d.ts","../../../node_modules/media-tracks/dist/video-rendition.d.ts","../../../node_modules/media-tracks/dist/video-track.d.ts","../../../node_modules/media-tracks/dist/video-track-list.d.ts","../../../node_modules/media-tracks/dist/audio-rendition.d.ts","../../../node_modules/media-tracks/dist/audio-track.d.ts","../../../node_modules/media-tracks/dist/audio-track-list.d.ts","../../../node_modules/media-tracks/dist/video-rendition-list.d.ts","../../../node_modules/media-tracks/dist/audio-rendition-list.d.ts","../../../node_modules/media-tracks/dist/mixin.d.ts","../../../node_modules/media-tracks/dist/track-event.d.ts","../../../node_modules/media-tracks/dist/rendition-event.d.ts","../../../node_modules/media-tracks/dist/index.d.ts","../../mux-video/dist/types/index.d.ts","../../mux-player/dist/types/polyfills/index.d.ts","../../mux-player/dist/types/video-api.d.ts","../../mux-player/dist/types/helpers.d.ts","../../../node_modules/media-chrome/dist/utils/template-parts.d.ts","../../../node_modules/media-chrome/dist/media-theme-element.d.ts","../../../node_modules/media-chrome/dist/menu/media-chrome-menu-item.d.ts","../../../node_modules/media-chrome/dist/menu/media-chrome-menu.d.ts","../../../node_modules/media-chrome/dist/menu/media-settings-menu.d.ts","../../../node_modules/media-chrome/dist/menu/media-settings-menu-item.d.ts","../../../node_modules/media-chrome/dist/menu/media-chrome-menu-button.d.ts","../../../node_modules/media-chrome/dist/menu/media-settings-menu-button.d.ts","../../../node_modules/media-chrome/dist/menu/media-audio-track-menu.d.ts","../../../node_modules/media-chrome/dist/menu/media-audio-track-menu-button.d.ts","../../../node_modules/media-chrome/dist/menu/media-captions-menu.d.ts","../../../node_modules/media-chrome/dist/menu/media-captions-menu-button.d.ts","../../../node_modules/media-chrome/dist/menu/media-playback-rate-menu.d.ts","../../../node_modules/media-chrome/dist/menu/media-playback-rate-menu-button.d.ts","../../../node_modules/media-chrome/dist/menu/media-rendition-menu.d.ts","../../../node_modules/media-chrome/dist/menu/media-rendition-menu-button.d.ts","../../../node_modules/media-chrome/dist/menu/index.d.ts","../../mux-player/dist/types/themes/gerwig/index.d.ts","../../mux-player/dist/types/index.d.ts","../src/common/utils.ts","../src/useCombinedRefs.ts","../src/useObjectPropEffect.ts","../src/index.tsx","../src/useIsBrowser.ts","../src/useIsIntersecting.ts","../src/lazy.tsx","../src/themes/classic.ts","../src/themes/gerwig.ts","../src/themes/microvideo.ts","../src/themes/minimal.ts"],"fileInfos":[{"version":"44e584d4f6444f58791784f1d530875970993129442a847597db702a073ca68c","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7",{"version":"4af6b0c727b7a2896463d512fafd23634229adf69ac7c00e2ae15a09cb084fad","affectsGlobalScope":true},{"version":"9c00a480825408b6a24c63c1b71362232927247595d7c97659bc24dc68ae0757","affectsGlobalScope":true},{"version":"0c9e4447ddca10e8097a736ce41bb37ac3389ede46e419ee78c1161a14e9e8ba","affectsGlobalScope":true},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true},{"version":"6920e1448680767498a0b77c6a00a8e77d14d62c3da8967b171f1ddffa3c18e4","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"08f6861df84fba9719c14d5adc3ba40be9f0c687639e6c4df3c05b9301b8ff94",{"version":"55461596dc873b866911ef4e640fae4c39da7ac1fbc7ef5e649cb2f2fb42c349","affectsGlobalScope":true},"8a8eb4ebffd85e589a1cc7c178e291626c359543403d58c9cd22b81fab5b1fb9","247a952efd811d780e5630f8cfd76f495196f5fa74f6f0fee39ac8ba4a3c9800",{"version":"8117d2726c78497306ceef07b4ccd08a863a9bd6e1fd7ff9ed6332f0e49bbb1a","affectsGlobalScope":true},{"version":"6d3aae02e573b4424749a17ecde853c18195fd6f08297da64aa7fff2057bb7c9","signature":"62d2aa1ca48b93c01d429fb0e92482da2b27b65fe11f1941a33052b6534b6282"},{"version":"a6b7e3c103b4424b9c9d6dce7f059c16bbf037844b9f418775b86506d3d141d4","signature":"91c076ae465392962257aca34e4bf13640363d6cca8e0636d5cda95c890951e9"},{"version":"5b5c872830a799ebdd42d46b0554ac3ec447dda8e96cbe30e6f55dfabcf224b1","affectsGlobalScope":true},"de64daa4e510abaaf4b4970c6dd37e39c3b8a263cccbeb80a41c69ae5a2a34ba","92361bb81bc685fd927aa2c6131a0a5e5c5e4a4e3c22ea1c25ce0d18d81a0f03","e3c6c9289bac4af918020eb31bf014c424c4a8f20962470b4d60c8275e52cf23","c13fb8c7fdb84f3c59470c672220c380ac26ffb099721ccebba3c53971cb700d","19afd7f4812facaa313356113070795a2fe90fcef4bfe6462db0dcbc503c92f1","dccea7b665fe08ed006acd191a7e68123ba7ec49848ac7c28a164962bf21254e",{"version":"332432f1a8b3197b9fb0cdb22ad957d4b6cb793a6c86295dc5d548042fbff44a","affectsGlobalScope":true},"058cc7729d1bcb3e2d5bb1cc04017ebeebfc81ade135d7d1e0cca9507603c216","55c6de56f15d31b45af77753c708a137e9899dbd3f6e1d17d481397e520d4a38","386a58b5a3bacacc1eab6b5b87c81f192fc43a2504a909c7f0e01b1611156268","8b6de5c9c9bb6ec79adbe0e947c43b072b83a5ae1b64003926c64d6884ff89c3","4f4c296924ffa7eddafb240bbda70f7ba3daaeafdab5fd8b3fc6c077fa9aed40","f840987b41333cb4d54aa1cbd23037e7ae3b862efb76ed61760d930001f1d3fb","085471b526dfadb5539da3101130aa5fa4b9e97d7dad4f90442c819a962b11f6","3ebd69fb7f78e02690412952a36013230a0d35ce1fd90fda787cdc6db2019cd1","9c152ed82b194bd5f5a260745ab08163913d32bc583e8ebd58a6d5c50063af88","5cc73e2a1c308ce7c08647aec345b84ede7c14f422072a94c4bfee881b8dee8d","bf5e6d96dcce9ee78e27f903b21c61ec83bda1402a3e803216e269ffbb92b66f","588d951f72eee1c74c86da6b126186bdddd56e1045af04d4b2eab188f3cd2d63","ab41e99b7fe358b9bd34baf113b8a2680fab63e7b0082a5ea2859ec3b8d8c8d7","9ea8786d39654040b4e71e3de846ec46fc0ff59a25e7cfd3f1f5467fc4010211","ad3cb516cc81f90293f97027b35d448f2077099484044f0b3b40ac16c748c4cd","19ca0e902de20493a93177ee8419386b2e8840e1ccb356aa7a09eafb9f2aa4a6","491fc9190753711b585bf8985557b41e2745c3fa78703c5d8aef8023cd2da588","37570faa043e51cf519edaf0dcbdf5d68967c0d4f6cffc444eb29dd2def6d0a4","ff1ab0162ee07bde9e0b48c141da0b8f1ffff9f96d61cc559f1345e548de6707","52a0596e22d25055409623e232a59fbbb0277670f0f3f491cb7fe244f8cce082","fd963b23fc1f2afb8d70d941c76ce3e581c52df8aa2b5fa987ebccf92d549655","addb0d289747cd5d2b7d177b1fca4288153dcd1d127448b32c8ba516cb78df65","29abecb032cd4fa8a5fbfa28894dc27bd78f9ee8eabce6261ed9427b04c1d462","544a1b99ab9d3b43a96081d4605d8c4e28e7900fbb7b7a3e2e4cf39a85d42ec5","b90bc63ea1d617f0718aec306e100d60ddca70276f8ffe09eec6cdb1a59d3336","8791f09b3d94bd2e015d704d99bd5a58d8634ffe088a628aa3474eaac1ebbde0","aaf1f91b84d91e224493aeae688fa2f05d91d96b7f608bac16c089df5c857525","08de824f24eb94f50f04e467ee0c51c03f47d0cccf13178eea175295bef26c16","bbf70094b304deff2f9e829e17e68642c70f805344b9ac5cd41a57e1d0201b67","4fda12edf6e96432c1e1816e9b473f75aebb884c0e5cd05ff5364dfde708300a","29268f1a3a04237844ef737d15f98e390f3289ee161c3e57d23d6e0f78b7786a","eb781f3ee7987336bf269ea0adcbea63591965c19e9209d168962329259473ac","ebaed8b8ffe506df064984cce634c6979d946d4901ba2e2a8cd080ede2125f81","9cd1579ffd2f933e4a7c31301c2f66c56669e5d58168106173e6a356eef5818c","42b4ec9803afa012deeb2b2f60d00149ec19b4bedf65b3eae36a3bf9ff8823b2","e80fd4b1506c5e7b437651461d06e25512c4517094ddab913a1229aa41d4a128","e583580fee0737a8c657aebcea932d5d7fa4edfeab33d2ded3eff36205746aad","191edd9d9ee3a2a4ea1d156132c03a16070318b481af0c8e4633d66e34fb9349","e66a935f12d810773bcb40b22bff502af44cd838610e528d862c0aa942b62a99","e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","1ce9bee7c394636bf6eeba7d1aca1d56983691a1b4a756c04c9c1d7032bc5e91","2ed351b90f48ecae9c627d41e2614c6a4fe670f958e8a5a5d3bb4bc21980bdb6","8f358619bbe2b132a373c5e8381018bb1f11f55dbac8cb84c380d5279f18eb75","ba0b6859e73b5fb85f18160a3b0d741968b1c4122fdd3436398dc99a6a9736c9","9979bad516454ac2aaff1756fc7f664ca6ccfdd9b4077f306e99df3033edf0a2","323cfa8826348d6f5269abeed193b53c1ee351a9c178858bce4dee6e9b6c3ac9","24354cb3bc1d897f8321bce628352612d35d92a79dba42e6609f7f5ec7d3a697","2ad77fd12d9bf99057909e40fecb502cb4429c617161f373339f294dfaa5d6f5","8e4de702297e7c9173982f2e1af6bb29b5a0251811ac12de6beb48dba2288a9f","b3b2e1206c3037779459c39c896f282e22edb992458a118137066807f8dbb899","d86abfe8b121d0296f860e2165d243a46895e6a7fd089bc7fff4e779131acc15","f9955a6b47c6f2608087b111dca772554ef89d1ed302990104574f7cee41cb05","710bfef6f0be756ddb857985b7dd5d0cc831c67b6bdfbd1179b7dc4457819ff7",{"version":"9fae9d830d6a6bd13e060431e6027f2f0831aee8647563b6af90cbcc656dcbbc","affectsGlobalScope":true},"2f39ccc3f2cad7f2a1e0ad14a744877ed08dae4ae75510109ac981ceb783b566","e4166888216bfa688fc37dfc7e3d67d04b5fce9351343a76f6cd00df687f3863","df74973a1543e7afb93d66eb338ff92b59ebf58e2b8c9d1702a62c7677332a2f","c10b802cb3571aa26feaff4500aa0ca18a8215b3dbffdcf19fea6ca6bb25e859","395795805d83a39809c9a363e6a7cfb7a58b2b0277a5727fd386f2ca00f702a4","1c8bc9c36eba281b38cafa426f4bb9aca70af588f0ca004396dba50ef51e1d44","dd025e95e94043d29643e698c71417d21798869630a0235a265ec87cdd48cd36","f1488fc78a82b1833b644078f59bd893d554996ff23078a04a9c9c9811d73247","fa045e1fe36ab479ddcb7dc4e23738ad611207d96a0b4dc1917cbc77cd5824bf","cf610df351130166852e0221c13ae91edd4cc6e564d2ff2d9dba2e76b0b23531","45ea15e3d2b7ce097ae3b2059150e27ba61e4b6338edb35d24696185b39d3f72","0fea6160584f18d27139fd1b215070e0b89b9bdabefca986f852f2dd48d84fde","4cada8d5f7933f0fee93574a28cae2c9dc177884a7bc415871f3f901acae2164","ea4b83bf793d9710935ccb3e999fe34a8ce32749220b56faae64bc27dc9a3059","79be6ebf6b85f66ddddf4a820edcf4e342de3c123bb8dfa8012fc25a26f40df9","1bbf3bb73876d08716cb96188dd5f6a5d174842b6a943a1b4111442ccf383a37","8002e759f61231d62afaf8cc6f1cae0a1dc9359649d3800d1947faeb5c199008","4d844a40823399dec0f0aad4308f8b2cbdd48ee78315d9d0088676793609cdb9","ce506cd6ccb5d7a1ccc73857d48791c037d84a896aa2ded6ab2f66c83c1afe4d","b717a39248ea611ac2b155a804d278c8d579c6391962943e3a9d0e6378ca41c8","320da014495cf377ce9d215a0e205cfeece4965fd8291caf73ba5631dba5c4ee","ae210611405a0379a73717194809d4565420212f054bc8a08060773d0979998a",{"version":"498d6a91f4bbfbd412e928a5fd6306d98a8b8b49c334b3ef1b1dccd8ec327e2f","signature":"d84a480259a7bda3cd794ab264e29fda120eb72c8c9270396a584479bf5b827f"},{"version":"f21932f853b3dbd3949e14c7d31d2dcfba3418c5de50878884a54cf0ba14e904","signature":"014089c3590328e311f0651db51765945a630df49cccfaf71c884d53bafd70d2"},{"version":"721526438283d40d50c6356064d346f1c57693f7e9930a3854c20c73bf4380a5","signature":"c4fd6b7393d54385949abe647b9b489a07bde7ccf1edf4331a154b311e17602b"},{"version":"705dbafe7728fa9f441e36446fad5424192eb0abaff4af777f92a8fbef7a9712","signature":"ed91e6464200ebfe83499e0f8706cb7a15a669161181e206046556b9719b73b3"},{"version":"1b71f45ead6f14b83fa35f86f43d760f8f5754f62ab638384f30a1e1a56e5b9c","signature":"d8697925fd69925c68732d55ed14c69c38bd4435b91355e974797c6f11685ee5"},{"version":"3afe879128eb0bc263123450b8211b56d7afba72c95e820cb51224fe661546b1","signature":"536ccb1a38a39569293fde322adb7b936d9a8bf81984d675bbba6e57c6569ca9"},{"version":"53357ea7aa47e2176c65f70cd0a13566a505e4a223ccba7e2834b0058ef899af","signature":"11cde0da98999aeac834deb7713a95b100fa2f6795c6eb908f4258382ba43620","affectsGlobalScope":true},{"version":"fa85dd99897bc23086ceca44325d3b49e9901da2f93bcc9ee7a2400305b9a1dc","signature":"5a026523580a8d1a300ac0cbf514fe18ba0c1a2b833dfbc70489f98000f4a6b6"},{"version":"346172d6bd31ef8b97a710c8b6a7a18155d1e4aeeb259229f91b795826e140fe","signature":"e3212c9c6c3810ecf4717ebba997ba5c14f72a5b2aaa08eefe64624c3b26abe5"},{"version":"db877f66f13227c49079ec30fe36cf22b702b4fa8d9005e63f451684b4cd7416","signature":"e5fa2fa2c4814d6fbbf98397afd77fa0f1a6dff2ba1fdc6de6ca35180f433a56"},{"version":"27be6309b4e9f9a8044955a0a7243c223c489ccb1d517c27c48f264d1aced267","signature":"eccacd5847f9abe6711b5f24b4b485f3a80bb12b98bbb4a3cbe9c66a4fbc1a8e"}],"root":[46,47,[132,142]],"options":{"composite":true,"declaration":true,"emitDeclarationOnly":true,"esModuleInterop":true,"jsx":2,"module":6,"noImplicitAny":true,"outDir":"./types","rootDir":"../src","skipLibCheck":false,"sourceMap":true,"strict":true,"target":6},"fileIdsList":[[42,43,44],[56,57,58,60,66,67,68,69,71,72,73,74,75,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],[68],[68,70],[59,67],[59],[59,60],[61,62,65],[76],[62,68],[63,64],[56,63,65],[56],[59,66,113],[74,86,87,88],[74],[115,116,117,118,120,121,122,123,124,125,126,127,128],[119],[70,116],[70,119],[59,116],[59,115],[62,119],[62,116],[63,116],[115],[116],[100,101],[101],[100],[97,98,99,100,101,102,103,104,105,106,107],[98,99,101,102,103,104],[97,100],[98,101],[97,98],[98],[97],[45],[45,47,55,131,132,133,134],[45,46,55,131,135,136,137],[55],[48,50,55,94,109,111,112,130],[114,129],[108,109,110],[48,50,55,96,108],[50],[48,49,50,51,52,53,54],[51],[51,52],[48,49,50]],"referencedMap":[[45,1],[94,2],[69,3],[71,4],[72,3],[68,5],[73,6],[74,6],[61,7],[75,6],[66,8],[77,9],[78,3],[60,6],[79,3],[80,6],[81,3],[82,3],[84,3],[83,10],[85,6],[86,9],[87,6],[88,9],[89,3],[90,3],[65,11],[64,12],[63,13],[76,6],[114,14],[91,9],[92,15],[67,6],[93,16],[129,17],[122,18],[121,19],[124,20],[123,19],[119,3],[115,21],[116,22],[126,23],[125,24],[128,18],[127,25],[120,18],[118,26],[117,27],[70,13],[113,6],[104,28],[102,29],[101,30],[108,31],[105,32],[107,33],[106,34],[103,35],[99,36],[98,37],[46,38],[135,39],[138,40],[133,38],[136,38],[137,38],[134,38],[112,41],[131,42],[130,43],[111,44],[109,45],[52,46],[55,47],[54,48],[53,49],[51,50]],"latestChangedDtsFile":"./types/themes/minimal.d.ts"},"version":"5.5.4"}
|
|
1
|
+
{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.dom.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/typescript/lib/lib.scripthost.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/typescript/lib/lib.es2019.full.d.ts","../../../node_modules/@types/react/global.d.ts","../../../node_modules/csstype/index.d.ts","../../../node_modules/@types/prop-types/index.d.ts","../../../node_modules/@types/react/index.d.ts","../src/ConditionalSuspense.tsx","../src/env.ts","../../../node_modules/mux-embed/dist/types/mux-embed.d.ts","../../playback-core/dist/types/errors.d.ts","../../../node_modules/hls.js/dist/hls.js.d.ts","../../playback-core/dist/types/types.d.ts","../../playback-core/dist/types/hls.d.ts","../../playback-core/dist/types/text-tracks.d.ts","../../playback-core/dist/types/pdt.d.ts","../../playback-core/dist/types/util.d.ts","../../playback-core/dist/types/request-errors.d.ts","../../playback-core/dist/types/index.d.ts","../../../node_modules/media-chrome/dist/constants.d.ts","../../../node_modules/media-chrome/dist/labels/labels.d.ts","../../../node_modules/media-chrome/dist/utils/time.d.ts","../../../node_modules/media-chrome/dist/utils/server-safe-globals.d.ts","../../../node_modules/media-chrome/dist/media-gesture-receiver.d.ts","../../../node_modules/media-chrome/dist/media-container.d.ts","../../../node_modules/media-chrome/dist/utils/attribute-token-list.d.ts","../../../node_modules/media-chrome/dist/media-store/state-mediator.d.ts","../../../node_modules/media-chrome/dist/media-store/request-map.d.ts","../../../node_modules/media-chrome/dist/media-store/media-store.d.ts","../../../node_modules/media-chrome/dist/media-controller.d.ts","../../../node_modules/media-chrome/dist/media-tooltip.d.ts","../../../node_modules/media-chrome/dist/media-chrome-button.d.ts","../../../node_modules/media-chrome/dist/media-airplay-button.d.ts","../../../node_modules/media-chrome/dist/utils/TextTrackLike.d.ts","../../../node_modules/media-chrome/dist/media-captions-button.d.ts","../../../node_modules/media-chrome/dist/media-cast-button.d.ts","../../../node_modules/media-chrome/dist/media-chrome-dialog.d.ts","../../../node_modules/media-chrome/dist/media-chrome-range.d.ts","../../../node_modules/media-chrome/dist/media-control-bar.d.ts","../../../node_modules/media-chrome/dist/media-text-display.d.ts","../../../node_modules/media-chrome/dist/media-duration-display.d.ts","../../../node_modules/media-chrome/dist/media-fullscreen-button.d.ts","../../../node_modules/media-chrome/dist/media-live-button.d.ts","../../../node_modules/media-chrome/dist/media-loading-indicator.d.ts","../../../node_modules/media-chrome/dist/media-mute-button.d.ts","../../../node_modules/media-chrome/dist/media-pip-button.d.ts","../../../node_modules/media-chrome/dist/media-playback-rate-button.d.ts","../../../node_modules/media-chrome/dist/media-play-button.d.ts","../../../node_modules/media-chrome/dist/media-poster-image.d.ts","../../../node_modules/media-chrome/dist/media-preview-chapter-display.d.ts","../../../node_modules/media-chrome/dist/media-preview-thumbnail.d.ts","../../../node_modules/media-chrome/dist/media-preview-time-display.d.ts","../../../node_modules/media-chrome/dist/media-seek-backward-button.d.ts","../../../node_modules/media-chrome/dist/media-seek-forward-button.d.ts","../../../node_modules/media-chrome/dist/media-time-display.d.ts","../../../node_modules/media-chrome/dist/media-time-range.d.ts","../../../node_modules/media-chrome/dist/media-volume-range.d.ts","../../../node_modules/media-chrome/dist/index.d.ts","../../../node_modules/media-chrome/dist/experimental/index.d.ts","../../../node_modules/custom-media-element/custom-media-element.d.ts","../../../node_modules/media-tracks/dist/video-rendition.d.ts","../../../node_modules/media-tracks/dist/video-track.d.ts","../../../node_modules/media-tracks/dist/video-track-list.d.ts","../../../node_modules/media-tracks/dist/audio-rendition.d.ts","../../../node_modules/media-tracks/dist/audio-track.d.ts","../../../node_modules/media-tracks/dist/audio-track-list.d.ts","../../../node_modules/media-tracks/dist/video-rendition-list.d.ts","../../../node_modules/media-tracks/dist/audio-rendition-list.d.ts","../../../node_modules/media-tracks/dist/mixin.d.ts","../../../node_modules/media-tracks/dist/track-event.d.ts","../../../node_modules/media-tracks/dist/rendition-event.d.ts","../../../node_modules/media-tracks/dist/index.d.ts","../../mux-video/dist/types/index.d.ts","../../mux-player/dist/types/polyfills/index.d.ts","../../mux-player/dist/types/video-api.d.ts","../../mux-player/dist/types/helpers.d.ts","../../../node_modules/media-chrome/dist/utils/template-parts.d.ts","../../../node_modules/media-chrome/dist/media-theme-element.d.ts","../../../node_modules/media-chrome/dist/menu/media-chrome-menu-item.d.ts","../../../node_modules/media-chrome/dist/menu/media-chrome-menu.d.ts","../../../node_modules/media-chrome/dist/menu/media-settings-menu.d.ts","../../../node_modules/media-chrome/dist/menu/media-settings-menu-item.d.ts","../../../node_modules/media-chrome/dist/menu/media-chrome-menu-button.d.ts","../../../node_modules/media-chrome/dist/menu/media-settings-menu-button.d.ts","../../../node_modules/media-chrome/dist/menu/media-audio-track-menu.d.ts","../../../node_modules/media-chrome/dist/menu/media-audio-track-menu-button.d.ts","../../../node_modules/media-chrome/dist/menu/media-captions-menu.d.ts","../../../node_modules/media-chrome/dist/menu/media-captions-menu-button.d.ts","../../../node_modules/media-chrome/dist/menu/media-playback-rate-menu.d.ts","../../../node_modules/media-chrome/dist/menu/media-playback-rate-menu-button.d.ts","../../../node_modules/media-chrome/dist/menu/media-rendition-menu.d.ts","../../../node_modules/media-chrome/dist/menu/media-rendition-menu-button.d.ts","../../../node_modules/media-chrome/dist/menu/index.d.ts","../../mux-player/dist/types/themes/gerwig/index.d.ts","../../mux-player/dist/types/index.d.ts","../src/common/utils.ts","../src/useCombinedRefs.ts","../src/useObjectPropEffect.ts","../src/index.tsx","../src/useIsBrowser.ts","../src/useIsIntersecting.ts","../src/lazy.tsx","../src/themes/classic.ts","../src/themes/gerwig.ts","../src/themes/microvideo.ts","../src/themes/minimal.ts"],"fileIdsList":[[42,43,44],[58,59,60,62,68,69,70,71,73,74,75,76,77,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95],[70],[70,72],[61,69],[61],[61,62],[63,64,67],[78],[64,70],[65,66],[58,65,67],[58],[61,68,115],[76,88,89,90],[76],[117,118,119,120,122,123,124,125,126,127,128,129,130],[121],[72,118],[72,121],[61,118],[61,117],[64,121],[64,118],[65,118],[117],[118],[102,103],[103],[102],[99,100,101,102,103,104,105,106,107,108,109],[100,101,103,104,105,106],[99,102],[100,103],[99,100],[100],[99],[45],[45,47,57,133,134,135,136],[45,46,57,133,137,138,139],[57],[48,50,57,96,111,113,114,132],[116,131],[110,111,112],[48,50,57,98,110],[50],[48,49,50,51,52,53,54,55,56],[51],[49,50,51],[51,52],[48,49,50]],"fileInfos":[{"version":"44e584d4f6444f58791784f1d530875970993129442a847597db702a073ca68c","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"9e8ca8ed051c2697578c023d9c29d6df689a083561feba5c14aedee895853999","affectsGlobalScope":true,"impliedFormat":1},{"version":"69e65d976bf166ce4a9e6f6c18f94d2424bf116e90837ace179610dbccad9b42","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7a3c8b952931daebdfc7a2897c53c0a1c73624593fa070e46bd537e64dcd20a","affectsGlobalScope":true,"impliedFormat":1},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true,"impliedFormat":1},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true,"impliedFormat":1},{"version":"6920e1448680767498a0b77c6a00a8e77d14d62c3da8967b171f1ddffa3c18e4","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"45d8ccb3dfd57355eb29749919142d4321a0aa4df6acdfc54e30433d7176600a","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true,"impliedFormat":1},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"08f6861df84fba9719c14d5adc3ba40be9f0c687639e6c4df3c05b9301b8ff94","impliedFormat":1},{"version":"36a2e4c9a67439aca5f91bb304611d5ae6e20d420503e96c230cf8fcdc948d94","affectsGlobalScope":true,"impliedFormat":1},{"version":"8a8eb4ebffd85e589a1cc7c178e291626c359543403d58c9cd22b81fab5b1fb9","impliedFormat":1},{"version":"ed6b820c54de95b2510bb673490d61c7f2187f532a339d8d04981645a918961f","impliedFormat":1},{"version":"78e9a9dec8fcd712a2a775d8b67bf7d166c2fb06644bba3132f33dbef06db781","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3aae02e573b4424749a17ecde853c18195fd6f08297da64aa7fff2057bb7c9","signature":"62d2aa1ca48b93c01d429fb0e92482da2b27b65fe11f1941a33052b6534b6282"},{"version":"a6b7e3c103b4424b9c9d6dce7f059c16bbf037844b9f418775b86506d3d141d4","signature":"91c076ae465392962257aca34e4bf13640363d6cca8e0636d5cda95c890951e9"},{"version":"5b5c872830a799ebdd42d46b0554ac3ec447dda8e96cbe30e6f55dfabcf224b1","affectsGlobalScope":true,"impliedFormat":1},"e116f0c265fb804d67da5f1360d78edc5cdf37dd9e8ce08c8bd0c3829b7f66bd",{"version":"565754cab3838cf74fc46fc6eb98a76a5ee86396c571f6245f4c04d6575f8631","impliedFormat":1},"a1365a8c16e1c65a39d78bd2f6518368cfb7496b2f1de0832a3aa9165292123b","c13fb8c7fdb84f3c59470c672220c380ac26ffb099721ccebba3c53971cb700d","3be94ff5800bf4567d511f1d716237ef30f753ef916bf855209a7f4c2cd741e1","dccea7b665fe08ed006acd191a7e68123ba7ec49848ac7c28a164962bf21254e","f3b0f40a4bb983dddc80f47f172c8c1bcc5a18f38eae03d14431826f613bcad4","62f761999e69713bd78cc26873c6d17c3cbd43abbe41fbef437bf22d51ca9e4d",{"version":"b64ede7c3a5cba655077bb77692848394dc47530b67cf9e49b449dc4d71b8605","affectsGlobalScope":true},{"version":"058cc7729d1bcb3e2d5bb1cc04017ebeebfc81ade135d7d1e0cca9507603c216","impliedFormat":99},{"version":"55c6de56f15d31b45af77753c708a137e9899dbd3f6e1d17d481397e520d4a38","impliedFormat":99},{"version":"386a58b5a3bacacc1eab6b5b87c81f192fc43a2504a909c7f0e01b1611156268","impliedFormat":99},{"version":"8b6de5c9c9bb6ec79adbe0e947c43b072b83a5ae1b64003926c64d6884ff89c3","impliedFormat":99},{"version":"4f4c296924ffa7eddafb240bbda70f7ba3daaeafdab5fd8b3fc6c077fa9aed40","impliedFormat":99},{"version":"f840987b41333cb4d54aa1cbd23037e7ae3b862efb76ed61760d930001f1d3fb","impliedFormat":99},{"version":"085471b526dfadb5539da3101130aa5fa4b9e97d7dad4f90442c819a962b11f6","impliedFormat":99},{"version":"3ebd69fb7f78e02690412952a36013230a0d35ce1fd90fda787cdc6db2019cd1","impliedFormat":99},{"version":"9c152ed82b194bd5f5a260745ab08163913d32bc583e8ebd58a6d5c50063af88","impliedFormat":99},{"version":"5cc73e2a1c308ce7c08647aec345b84ede7c14f422072a94c4bfee881b8dee8d","impliedFormat":99},{"version":"bf5e6d96dcce9ee78e27f903b21c61ec83bda1402a3e803216e269ffbb92b66f","impliedFormat":99},{"version":"588d951f72eee1c74c86da6b126186bdddd56e1045af04d4b2eab188f3cd2d63","impliedFormat":99},{"version":"3c718f0ea66c71ca5b22b26d1826845fd12b0129c7b376ce87d7e01cb82ca307","impliedFormat":99},{"version":"9ea8786d39654040b4e71e3de846ec46fc0ff59a25e7cfd3f1f5467fc4010211","impliedFormat":99},{"version":"ad3cb516cc81f90293f97027b35d448f2077099484044f0b3b40ac16c748c4cd","impliedFormat":99},{"version":"19ca0e902de20493a93177ee8419386b2e8840e1ccb356aa7a09eafb9f2aa4a6","impliedFormat":99},{"version":"491fc9190753711b585bf8985557b41e2745c3fa78703c5d8aef8023cd2da588","impliedFormat":99},{"version":"37570faa043e51cf519edaf0dcbdf5d68967c0d4f6cffc444eb29dd2def6d0a4","impliedFormat":99},{"version":"28577f4936c0825d8650a06aed35bba26950b56e1131c45321fdc1a79b41a6f6","impliedFormat":99},{"version":"52a0596e22d25055409623e232a59fbbb0277670f0f3f491cb7fe244f8cce082","impliedFormat":99},{"version":"fd963b23fc1f2afb8d70d941c76ce3e581c52df8aa2b5fa987ebccf92d549655","impliedFormat":99},{"version":"addb0d289747cd5d2b7d177b1fca4288153dcd1d127448b32c8ba516cb78df65","impliedFormat":99},{"version":"29abecb032cd4fa8a5fbfa28894dc27bd78f9ee8eabce6261ed9427b04c1d462","impliedFormat":99},{"version":"544a1b99ab9d3b43a96081d4605d8c4e28e7900fbb7b7a3e2e4cf39a85d42ec5","impliedFormat":99},{"version":"b90bc63ea1d617f0718aec306e100d60ddca70276f8ffe09eec6cdb1a59d3336","impliedFormat":99},{"version":"8791f09b3d94bd2e015d704d99bd5a58d8634ffe088a628aa3474eaac1ebbde0","impliedFormat":99},{"version":"aaf1f91b84d91e224493aeae688fa2f05d91d96b7f608bac16c089df5c857525","impliedFormat":99},{"version":"08de824f24eb94f50f04e467ee0c51c03f47d0cccf13178eea175295bef26c16","impliedFormat":99},{"version":"bbf70094b304deff2f9e829e17e68642c70f805344b9ac5cd41a57e1d0201b67","impliedFormat":99},{"version":"4fda12edf6e96432c1e1816e9b473f75aebb884c0e5cd05ff5364dfde708300a","impliedFormat":99},{"version":"29268f1a3a04237844ef737d15f98e390f3289ee161c3e57d23d6e0f78b7786a","impliedFormat":99},{"version":"eb781f3ee7987336bf269ea0adcbea63591965c19e9209d168962329259473ac","impliedFormat":99},{"version":"ebaed8b8ffe506df064984cce634c6979d946d4901ba2e2a8cd080ede2125f81","impliedFormat":99},{"version":"9cd1579ffd2f933e4a7c31301c2f66c56669e5d58168106173e6a356eef5818c","impliedFormat":99},{"version":"42b4ec9803afa012deeb2b2f60d00149ec19b4bedf65b3eae36a3bf9ff8823b2","impliedFormat":99},{"version":"e80fd4b1506c5e7b437651461d06e25512c4517094ddab913a1229aa41d4a128","impliedFormat":99},{"version":"10c728d882ef68368f0dc1879b44ea5cb47bff147366647a04c64e24a6fce2b9","impliedFormat":99},{"version":"191edd9d9ee3a2a4ea1d156132c03a16070318b481af0c8e4633d66e34fb9349","impliedFormat":99},{"version":"e66a935f12d810773bcb40b22bff502af44cd838610e528d862c0aa942b62a99","impliedFormat":99},{"version":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","impliedFormat":99},{"version":"1ce9bee7c394636bf6eeba7d1aca1d56983691a1b4a756c04c9c1d7032bc5e91","impliedFormat":99},{"version":"2ed351b90f48ecae9c627d41e2614c6a4fe670f958e8a5a5d3bb4bc21980bdb6","impliedFormat":99},{"version":"8f358619bbe2b132a373c5e8381018bb1f11f55dbac8cb84c380d5279f18eb75","impliedFormat":99},{"version":"ba0b6859e73b5fb85f18160a3b0d741968b1c4122fdd3436398dc99a6a9736c9","impliedFormat":99},{"version":"9979bad516454ac2aaff1756fc7f664ca6ccfdd9b4077f306e99df3033edf0a2","impliedFormat":99},{"version":"323cfa8826348d6f5269abeed193b53c1ee351a9c178858bce4dee6e9b6c3ac9","impliedFormat":99},{"version":"24354cb3bc1d897f8321bce628352612d35d92a79dba42e6609f7f5ec7d3a697","impliedFormat":99},{"version":"2ad77fd12d9bf99057909e40fecb502cb4429c617161f373339f294dfaa5d6f5","impliedFormat":99},{"version":"8e4de702297e7c9173982f2e1af6bb29b5a0251811ac12de6beb48dba2288a9f","impliedFormat":99},{"version":"b3b2e1206c3037779459c39c896f282e22edb992458a118137066807f8dbb899","impliedFormat":99},{"version":"d86abfe8b121d0296f860e2165d243a46895e6a7fd089bc7fff4e779131acc15","impliedFormat":99},{"version":"f9955a6b47c6f2608087b111dca772554ef89d1ed302990104574f7cee41cb05","impliedFormat":99},{"version":"710bfef6f0be756ddb857985b7dd5d0cc831c67b6bdfbd1179b7dc4457819ff7","impliedFormat":99},{"version":"9f6fe1e4ddaeff1d6c2955a98e7a0ef0ea1f5e33a9425d22a4c1808e7b3bd6af","affectsGlobalScope":true},"2f39ccc3f2cad7f2a1e0ad14a744877ed08dae4ae75510109ac981ceb783b566","e4166888216bfa688fc37dfc7e3d67d04b5fce9351343a76f6cd00df687f3863","8c750b8bdfd4dc5e22cda56d4a74166e62e63bed6990d5a3021b641003cd6581",{"version":"c10b802cb3571aa26feaff4500aa0ca18a8215b3dbffdcf19fea6ca6bb25e859","impliedFormat":99},{"version":"395795805d83a39809c9a363e6a7cfb7a58b2b0277a5727fd386f2ca00f702a4","impliedFormat":99},{"version":"1c8bc9c36eba281b38cafa426f4bb9aca70af588f0ca004396dba50ef51e1d44","impliedFormat":99},{"version":"dd025e95e94043d29643e698c71417d21798869630a0235a265ec87cdd48cd36","impliedFormat":99},{"version":"f1488fc78a82b1833b644078f59bd893d554996ff23078a04a9c9c9811d73247","impliedFormat":99},{"version":"fa045e1fe36ab479ddcb7dc4e23738ad611207d96a0b4dc1917cbc77cd5824bf","impliedFormat":99},{"version":"cf610df351130166852e0221c13ae91edd4cc6e564d2ff2d9dba2e76b0b23531","impliedFormat":99},{"version":"45ea15e3d2b7ce097ae3b2059150e27ba61e4b6338edb35d24696185b39d3f72","impliedFormat":99},{"version":"0fea6160584f18d27139fd1b215070e0b89b9bdabefca986f852f2dd48d84fde","impliedFormat":99},{"version":"4cada8d5f7933f0fee93574a28cae2c9dc177884a7bc415871f3f901acae2164","impliedFormat":99},{"version":"ea4b83bf793d9710935ccb3e999fe34a8ce32749220b56faae64bc27dc9a3059","impliedFormat":99},{"version":"79be6ebf6b85f66ddddf4a820edcf4e342de3c123bb8dfa8012fc25a26f40df9","impliedFormat":99},{"version":"1bbf3bb73876d08716cb96188dd5f6a5d174842b6a943a1b4111442ccf383a37","impliedFormat":99},{"version":"8002e759f61231d62afaf8cc6f1cae0a1dc9359649d3800d1947faeb5c199008","impliedFormat":99},{"version":"4d844a40823399dec0f0aad4308f8b2cbdd48ee78315d9d0088676793609cdb9","impliedFormat":99},{"version":"ce506cd6ccb5d7a1ccc73857d48791c037d84a896aa2ded6ab2f66c83c1afe4d","impliedFormat":99},{"version":"b717a39248ea611ac2b155a804d278c8d579c6391962943e3a9d0e6378ca41c8","impliedFormat":99},"320da014495cf377ce9d215a0e205cfeece4965fd8291caf73ba5631dba5c4ee","609de065df868fc2f4bb40d8105d76584577b386cf6fdd7f49b92c7d4ffdbe05",{"version":"498d6a91f4bbfbd412e928a5fd6306d98a8b8b49c334b3ef1b1dccd8ec327e2f","signature":"d84a480259a7bda3cd794ab264e29fda120eb72c8c9270396a584479bf5b827f"},{"version":"f21932f853b3dbd3949e14c7d31d2dcfba3418c5de50878884a54cf0ba14e904","signature":"014089c3590328e311f0651db51765945a630df49cccfaf71c884d53bafd70d2"},{"version":"721526438283d40d50c6356064d346f1c57693f7e9930a3854c20c73bf4380a5","signature":"c4fd6b7393d54385949abe647b9b489a07bde7ccf1edf4331a154b311e17602b"},{"version":"d2b7e30bbf29ddd298a3bb384c25558027838e48cc71e125a7f85d0d44b9fbd0","signature":"4efa97c4f050b87806f0df8beb787ba7276bb9fbf6fde37251dd3a9d923c76a5"},{"version":"1b71f45ead6f14b83fa35f86f43d760f8f5754f62ab638384f30a1e1a56e5b9c","signature":"d8697925fd69925c68732d55ed14c69c38bd4435b91355e974797c6f11685ee5"},{"version":"3afe879128eb0bc263123450b8211b56d7afba72c95e820cb51224fe661546b1","signature":"536ccb1a38a39569293fde322adb7b936d9a8bf81984d675bbba6e57c6569ca9"},{"version":"53357ea7aa47e2176c65f70cd0a13566a505e4a223ccba7e2834b0058ef899af","signature":"11cde0da98999aeac834deb7713a95b100fa2f6795c6eb908f4258382ba43620","affectsGlobalScope":true},{"version":"fa85dd99897bc23086ceca44325d3b49e9901da2f93bcc9ee7a2400305b9a1dc","signature":"5a026523580a8d1a300ac0cbf514fe18ba0c1a2b833dfbc70489f98000f4a6b6"},{"version":"346172d6bd31ef8b97a710c8b6a7a18155d1e4aeeb259229f91b795826e140fe","signature":"e3212c9c6c3810ecf4717ebba997ba5c14f72a5b2aaa08eefe64624c3b26abe5"},{"version":"db877f66f13227c49079ec30fe36cf22b702b4fa8d9005e63f451684b4cd7416","signature":"e5fa2fa2c4814d6fbbf98397afd77fa0f1a6dff2ba1fdc6de6ca35180f433a56"},{"version":"27be6309b4e9f9a8044955a0a7243c223c489ccb1d517c27c48f264d1aced267","signature":"eccacd5847f9abe6711b5f24b4b485f3a80bb12b98bbb4a3cbe9c66a4fbc1a8e"}],"root":[46,47,[134,144]],"options":{"composite":true,"declaration":true,"emitDeclarationOnly":true,"esModuleInterop":true,"jsx":2,"module":6,"noImplicitAny":true,"outDir":"./types","rootDir":"../src","skipLibCheck":false,"sourceMap":true,"strict":true,"target":6},"referencedMap":[[45,1],[96,2],[71,3],[73,4],[74,3],[70,5],[75,6],[76,6],[63,7],[77,6],[68,8],[79,9],[80,3],[62,6],[81,3],[82,6],[83,3],[84,3],[86,3],[85,10],[87,6],[88,9],[89,6],[90,9],[91,3],[92,3],[67,11],[66,12],[65,13],[78,6],[116,14],[93,9],[94,15],[69,6],[95,16],[131,17],[124,18],[123,19],[126,20],[125,19],[121,3],[117,21],[118,22],[128,23],[127,24],[130,18],[129,25],[122,18],[120,26],[119,27],[72,13],[115,6],[106,28],[104,29],[103,30],[110,31],[107,32],[109,33],[108,34],[105,35],[101,36],[100,37],[46,38],[137,39],[140,40],[135,38],[138,38],[139,38],[136,38],[114,41],[133,42],[132,43],[113,44],[111,45],[52,46],[57,47],[54,48],[56,49],[53,50],[51,51],[55,48]],"latestChangedDtsFile":"./types/themes/minimal.d.ts","version":"5.6.2"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -66,6 +66,8 @@ export type MuxPlayerProps = {
|
|
|
66
66
|
renditionOrder?: RenditionOrderValue;
|
|
67
67
|
programStartTime?: number;
|
|
68
68
|
programEndTime?: number;
|
|
69
|
+
assetStartTime?: number;
|
|
70
|
+
assetEndTime?: number;
|
|
69
71
|
metadataVideoId?: string;
|
|
70
72
|
metadataVideoTitle?: string;
|
|
71
73
|
metadataViewerUserId?: string;
|
|
@@ -66,6 +66,8 @@ export type MuxPlayerProps = {
|
|
|
66
66
|
renditionOrder?: RenditionOrderValue;
|
|
67
67
|
programStartTime?: number;
|
|
68
68
|
programEndTime?: number;
|
|
69
|
+
assetStartTime?: number;
|
|
70
|
+
assetEndTime?: number;
|
|
69
71
|
metadataVideoId?: string;
|
|
70
72
|
metadataVideoTitle?: string;
|
|
71
73
|
metadataViewerUserId?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mux/mux-player-react",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "An open source Mux player for React that Just Works™",
|
|
5
5
|
"homepage": "https://mux.com/player",
|
|
6
6
|
"keywords": [
|
|
@@ -85,9 +85,9 @@
|
|
|
85
85
|
"publish-release": "../../scripts/publish.sh"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"@types/react": "^17.0.0 || ^18 || ^19",
|
|
89
|
-
"react": "^17.0.2 || ^18 || ^19",
|
|
90
|
-
"react-dom": "^17.0.2 || ^18 || ^19"
|
|
88
|
+
"@types/react": "^17.0.0 || ^17.0.0-0 || ^18 || ^18.0.0-0 || ^19 || ^19.0.0-0",
|
|
89
|
+
"react": "^17.0.2 || ^17.0.0-0 || ^18 || ^18.0.0-0 || ^19 || ^19.0.0-0",
|
|
90
|
+
"react-dom": "^17.0.2 || ^17.0.2-0 || ^18 || ^18.0.0-0 || ^19 || ^19.0.0-0"
|
|
91
91
|
},
|
|
92
92
|
"peerDependenciesMeta": {
|
|
93
93
|
"@types/react": {
|
|
@@ -98,8 +98,8 @@
|
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
100
|
"dependencies": {
|
|
101
|
-
"@mux/mux-player": "3.
|
|
102
|
-
"@mux/playback-core": "0.
|
|
101
|
+
"@mux/mux-player": "3.1.0",
|
|
102
|
+
"@mux/playback-core": "0.27.0",
|
|
103
103
|
"prop-types": "^15.7.2"
|
|
104
104
|
},
|
|
105
105
|
"devDependencies": {
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"shx": "^0.3.4",
|
|
115
115
|
"typescript": "^5.5.4"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "e1d17f4ce383e95489fc778d3c5bda3b89a27b5b"
|
|
118
118
|
}
|
package/dist/-QEWOA6LP.mjs.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/index.tsx", "../src/common/utils.ts", "../src/useCombinedRefs.ts", "../src/useObjectPropEffect.ts", "../src/env.ts"],
|
|
4
|
-
"sourcesContent": ["'use client';\nimport 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 disableTracking: 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 castReceiver?: string | undefined;\n castCustomData?: Record<string, any> | undefined;\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 programStartTime?: number;\n programEndTime?: number;\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 defaultDuration?: number;\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 onChapterChange?: GenericEventListener<MuxPlayerElementEventMap['chapterchange']>;\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 onChapterChange,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n currentTime,\n themeProps,\n extraSourceParams,\n castCustomData,\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('castCustomData', castCustomData, 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('chapterchange', ref, onChapterChange);\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": "aACA,OAAOA,GAAS,aAAAC,OAAiB,QAUjC,OAAS,iBAAAC,GAAe,iBAAAC,GAAe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AS,EAChDzB,EAAuB,UAAWF,EAAK4B,CAAS,EAChD1B,EAAuB,QAASF,EAAK6B,CAAO,EAC5C3B,EAAuB,QAASF,EAAK8B,CAAO,EAC5C5B,EAAuB,iBAAkBF,EAAK+B,CAAgB,EAC9D7B,EAAuB,kBAAmBF,EAAKgC,CAAiB,EAChE9B,EAAuB,gBAAiBF,EAAKiC,CAAe,EACrD,CAACW,CAAc,CACxB,EAEMQ,GAAwBC,EAAiB,EACzCC,GAAqB,mBAErBC,GAAY1D,EAAM,WAGtB,CAACE,EAAOC,IAAQ,CAChB,IAAMwD,EAAiBC,GAAyB,IAAI,EAC9CC,EAAYC,EAAgBH,EAAgBxD,CAAG,EAC/C,CAAC4C,CAAc,EAAIrC,GAAUiD,EAAgBzD,CAAK,EAExD,OACEF,EAAA,cAACD,GAAA,CAEC,IAAK8D,EACL,mBAAoBJ,GACpB,sBAAuBF,GACtB,GAAGR,EACN,CAEJ,CAAC,EAEMgB,GAAQL",
|
|
6
|
-
"names": ["React", "useEffect", "MaxResolution", "MinResolution", "RenditionOrder", "MediaError", "ReactPropToAttrNameMap", "isNil", "x", "isKeyOf", "k", "o", "toKebabCase", "string", "match", "toNativeAttrName", "propName", "propValue", "toNativeAttrValue", "propValue", "propName", "toNativeProps", "props", "transformedProps", "attrName", "toNativeAttrName", "attrValue", "useRef", "useEffect", "useRef", "useCombinedRefs", "refs", "targetRef", "ref", "useEffect", "hasOwnProperty", "shallowEqual", "objA", "objB", "vVal", "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", "onChapterChange", "metadata", "tokens", "paused", "playbackId", "playbackRates", "currentTime", "themeProps", "extraSourceParams", "castCustomData", "_hlsConfig", "remainingProps", "useObjectPropEffect_default", "playerEl", "pausedVal", "value", "propName", "defaultHasChanged", "currentTimeVal", "playerSoftwareVersion", "getPlayerVersion", "playerSoftwareName", "MuxPlayer", "innerPlayerRef", "useRef", "playerRef", "useCombinedRefs", "src_default"]
|
|
7
|
-
}
|