@mux/mux-player-react 1.8.0 → 1.9.0-canary.0-4e45cc0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var Y=Object.create;var d=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var X=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var ee=(e,t)=>{for(var n in t)d(e,n,{get:t[n],enumerable:!0})},E=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Q(t))!B.call(e,r)&&r!==n&&d(e,r,{get:()=>t[r],enumerable:!(o=$(t,r))||o.enumerable});return e};var te=(e,t,n)=>(n=e!=null?Y(X(e)):{},E(t||!e||!e.__esModule?d(n,"default",{value:e,enumerable:!0}):n,e)),ne=e=>E(d({},"__esModule",{value:!0}),e);var be={};ee(be,{MediaError:()=>v.MediaError,default:()=>Pe});module.exports=ne(be);var l=te(require("react")),v=require("@mux/mux-player");var f={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},ae=e=>e==null,re=(e,t)=>ae(t)?!1:e in t,oe=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),ie=(e,t)=>{if(!(typeof t=="boolean"&&!t)){if(re(e,f))return f[e];if(typeof t!=null)return/[A-Z]/.test(e)?oe(e):e}};var se=(e,t)=>typeof e=="boolean"?"":e,M=(e={})=>Object.entries(e).reduce((t,[n,o])=>{let r=ie(n,o);if(!r)return t;let i=se(o,n);return t[r]=i,t},{});var x=require("react");var p=require("react"),g=(...e)=>{let t=(0,p.useRef)(null);return(0,p.useEffect)(()=>{e.forEach(n=>{!n||(typeof n=="function"?n(t.current):n.current=t.current)})},[e]),t};var P=require("react"),le=Object.prototype.hasOwnProperty,ue=(e,t)=>{if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.some((r,i)=>t[i]===r);let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let r=0;r<n.length;r++)if(!le.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0},m=(e,t,n)=>!ue(t,e[n]),ye=(e,t,n)=>{e[n]=t},de=(e,t,n,o=ye,r=m)=>(0,P.useEffect)(()=>{let i=n==null?void 0:n.current;!i||!r(i,t,e)||o(i,t,e)},[n==null?void 0:n.current,t]),s=de;var pe=()=>{try{return"1.8.0"}catch{}return"UNKNOWN"},ce=pe(),b=()=>ce;var me=l.default.forwardRef(({children:e,...t},n)=>l.default.createElement("mux-player",M({...t,ref:n}),e)),a=(e,t,n)=>(0,l.useEffect)(()=>{let o=t==null?void 0:t.current;if(!(!o||!n))return o.addEventListener(e,n),()=>{o.removeEventListener(e,n)}},[t==null?void 0:t.current,n]),Ee=(e,t)=>{let{onAbort:n,onCanPlay:o,onCanPlayThrough:r,onEmptied:i,onLoadStart:T,onLoadedData:R,onLoadedMetadata:h,onProgress:k,onDurationChange:L,onVolumeChange:C,onRateChange:O,onResize:S,onWaiting:w,onPlay:G,onPlaying:V,onTimeUpdate:A,onPause:N,onSeeking:I,onSeeked:K,onStalled:D,onSuspend:U,onEnded:H,onError:j,metadata:z,tokens:F,paused:W,playbackId:Z,playbackRates:_,currentTime:c,...q}=t;return s("playbackRates",_,e),s("metadata",z,e),s("tokens",F,e),s("playbackId",Z,e),s("paused",W,e,(u,y)=>{y!=null&&(y?u.pause():u.play())},(u,y,J)=>u.hasAttribute("autoplay")&&!u.hasPlayed?!1:m(u,y,J)),s("currentTime",c!=null?c:0,e),a("abort",e,n),a("canplay",e,o),a("canplaythrough",e,r),a("emptied",e,i),a("loadstart",e,T),a("loadeddata",e,R),a("loadedmetadata",e,h),a("progress",e,k),a("durationchange",e,L),a("volumechange",e,C),a("ratechange",e,O),a("resize",e,S),a("waiting",e,w),a("play",e,G),a("playing",e,V),a("timeupdate",e,A),a("pause",e,N),a("seeking",e,I),a("seeked",e,K),a("stalled",e,D),a("suspend",e,U),a("ended",e,H),a("error",e,j),[q]},fe=b(),Me="mux-player-react",ge=l.default.forwardRef((e,t)=>{let n=(0,x.useRef)(null),o=g(n,t),[r]=Ee(n,e);return l.default.createElement(me,{ref:o,playerSoftwareName:Me,playerSoftwareVersion:fe,...r})}),Pe=ge;
1
+ "use strict";var Q=Object.create;var p=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var ee=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var te=(e,n)=>{for(var t in n)p(e,t,{get:n[t],enumerable:!0})},E=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of B(n))!ne.call(e,r)&&r!==t&&p(e,r,{get:()=>n[r],enumerable:!(o=X(n,r))||o.enumerable});return e};var ae=(e,n,t)=>(t=e!=null?Q(ee(e)):{},E(n||!e||!e.__esModule?p(t,"default",{value:e,enumerable:!0}):t,e)),re=e=>E(p({},"__esModule",{value:!0}),e);var xe={};te(xe,{MediaError:()=>b.MediaError,default:()=>be});module.exports=re(xe);var l=ae(require("react")),b=require("@mux/mux-player");var g={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},oe=e=>e==null,ie=(e,n)=>oe(n)?!1:e in n,se=e=>e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),le=(e,n)=>{if(!(typeof n=="boolean"&&!n)){if(ie(e,g))return g[e];if(typeof n!=null)return/[A-Z]/.test(e)?se(e):e}};var ue=(e,n)=>typeof e=="boolean"?"":e,f=(e={})=>Object.entries(e).reduce((n,[t,o])=>{let r=le(t,o);if(!r)return n;let i=ue(o,t);return n[r]=i,n},{});var x=require("react");var c=require("react"),M=(...e)=>{let n=(0,c.useRef)(null);return(0,c.useEffect)(()=>{e.forEach(t=>{!t||(typeof t=="function"?t(n.current):t.current=n.current)})},[e]),n};var P=require("react"),ye=Object.prototype.hasOwnProperty,pe=(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,i)=>n[i]===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(!ye.call(n,t[r])||!Object.is(e[t[r]],n[t[r]]))return!1;return!0},m=(e,n,t)=>!pe(n,e[t]),ce=(e,n,t)=>{e[t]=n},de=(e,n,t,o=ce,r=m)=>(0,P.useEffect)(()=>{let i=t==null?void 0:t.current;!i||!r(i,n,e)||o(i,n,e)},[t==null?void 0:t.current,n]),s=de;var me=()=>{try{return"1.9.0"}catch{}return"UNKNOWN"},Ee=me(),v=()=>Ee;var ge=l.default.forwardRef(({children:e,...n},t)=>l.default.createElement("mux-player",f({...n,ref:t}),e)),a=(e,n,t)=>(0,l.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]),fe=(e,n)=>{let{onAbort:t,onCanPlay:o,onCanPlayThrough:r,onEmptied:i,onLoadStart:T,onLoadedData:h,onLoadedMetadata:R,onProgress:k,onDurationChange:C,onVolumeChange:L,onRateChange:O,onResize:S,onWaiting:G,onPlay:w,onPlaying:V,onTimeUpdate:A,onPause:N,onSeeking:I,onSeeked:K,onStalled:D,onSuspend:U,onEnded:j,onError:z,onCuePointChange:F,onCuePointsChange:H,metadata:W,tokens:Z,paused:_,playbackId:q,playbackRates:J,currentTime:d,...Y}=n;return s("playbackRates",J,e),s("metadata",W,e),s("tokens",Z,e),s("playbackId",q,e),s("paused",_,e,(u,y)=>{y!=null&&(y?u.pause():u.play())},(u,y,$)=>u.hasAttribute("autoplay")&&!u.hasPlayed?!1:m(u,y,$)),s("currentTime",d!=null?d:0,e),a("abort",e,t),a("canplay",e,o),a("canplaythrough",e,r),a("emptied",e,i),a("loadstart",e,T),a("loadeddata",e,h),a("loadedmetadata",e,R),a("progress",e,k),a("durationchange",e,C),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,I),a("seeked",e,K),a("stalled",e,D),a("suspend",e,U),a("ended",e,j),a("error",e,z),a("cuepointchange",e,F),a("cuepointschange",e,H),[Y]},Me=v(),Pe="mux-player-react",ve=l.default.forwardRef((e,n)=>{let t=(0,x.useRef)(null),o=M(t,n),[r]=fe(t,e);return l.default.createElement(ge,{ref:o,playerSoftwareName:Pe,playerSoftwareVersion:Me,...r})}),be=ve;
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.tsx", "../src/common/utils.ts", "../src/useCombinedRefs.ts", "../src/useObjectPropEffect.ts", "../src/env.ts"],
4
- "sourcesContent": ["import React, { useEffect } from 'react';\nimport type { CSSProperties } from 'react';\nimport type { StreamTypes, PlaybackTypes, CmcdTypes } from '@mux/playback-core';\nimport { MediaError } from '@mux/mux-player';\nimport type MuxPlayerElement from '@mux/mux-player';\nimport type { Tokens } from '@mux/mux-player';\nimport { toNativeProps } from './common/utils';\nimport { useRef } from 'react';\nimport { useCombinedRefs } from './useCombinedRefs';\nimport useObjectPropEffect, { defaultHasChanged } from './useObjectPropEffect';\nimport { getPlayerVersion } from './env';\n\nexport { MediaError };\n\ntype ValueOf<T> = T[keyof T];\ninterface GenericEventListener<T extends Event = CustomEvent> {\n (evt: T): void;\n}\n\nexport type MuxPlayerRefAttributes = MuxPlayerElement;\ntype VideoApiAttributes = {\n currentTime: number;\n volume: number;\n paused: boolean;\n src: string | null;\n poster: string;\n playbackRate: number;\n playsInline: boolean;\n preload: string;\n crossOrigin: string;\n autoPlay: boolean | string;\n loop: boolean;\n muted: boolean;\n style: CSSProperties;\n};\n\ntype MuxMediaPropTypes = {\n audio: boolean;\n // envKey: Options[\"data\"][\"env_key\"];\n envKey: string;\n // debug: Options[\"debug\"] & Hls[\"config\"][\"debug\"];\n debug: boolean;\n disableCookies: boolean;\n // metadata: Partial<Options[\"data\"]>;\n metadata: { [k: string]: any };\n beaconCollectionDomain: string;\n customDomain: string;\n playbackId: string;\n preferPlayback: ValueOf<PlaybackTypes> | undefined;\n streamType: ValueOf<StreamTypes> | 'vod';\n startTime: number;\n storyboardSrc: string;\n preferCmcd: ValueOf<CmcdTypes> | undefined;\n children: never[];\n};\n\ninterface MuxPlayerElementEventMap extends HTMLVideoElementEventMap {}\n\nexport type MuxPlayerProps = {\n className?: string;\n hotkeys?: string;\n nohotkeys?: boolean;\n defaultHiddenCaptions?: boolean;\n playerSoftwareVersion?: string;\n playerSoftwareName?: string;\n forwardSeekOffset?: number;\n backwardSeekOffset?: number;\n maxResolution?: string;\n metadataVideoId?: string;\n metadataVideoTitle?: string;\n metadataViewerUserId?: string;\n primaryColor?: string;\n secondaryColor?: string;\n placeholder?: string;\n playbackRates?: number[];\n defaultShowRemainingTime?: boolean;\n thumbnailTime?: number;\n title?: string;\n tokens?: Tokens;\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 // onPlayerReady?: EventListener;\n} & Partial<MuxMediaPropTypes> &\n Partial<VideoApiAttributes>;\n\nconst MuxPlayerInternal = React.forwardRef<MuxPlayerRefAttributes, MuxPlayerProps>(({ children, ...props }, ref) => {\n return React.createElement('mux-player', toNativeProps({ ...props, ref }), children);\n});\n\nconst useEventCallbackEffect = <K extends keyof MuxPlayerElementEventMap>(\n type: K,\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n callback: GenericEventListener<MuxPlayerElementEventMap[K]> | undefined\n) => {\n return useEffect(() => {\n const eventTarget = ref?.current;\n if (!eventTarget || !callback) return;\n eventTarget.addEventListener(type, callback);\n return () => {\n eventTarget.removeEventListener(type, callback);\n };\n }, [ref?.current, callback]);\n};\n\nconst usePlayer = (\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n props: MuxPlayerProps\n) => {\n const {\n onAbort,\n onCanPlay,\n onCanPlayThrough,\n onEmptied,\n onLoadStart,\n onLoadedData,\n onLoadedMetadata,\n onProgress,\n onDurationChange,\n onVolumeChange,\n onRateChange,\n onResize,\n onWaiting,\n onPlay,\n onPlaying,\n onTimeUpdate,\n onPause,\n onSeeking,\n onSeeked,\n onStalled,\n onSuspend,\n onEnded,\n onError,\n // onPlayerReady,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n currentTime,\n ...remainingProps\n } = props;\n useObjectPropEffect('playbackRates', playbackRates, ref);\n useObjectPropEffect('metadata', metadata, ref);\n useObjectPropEffect('tokens', tokens, ref);\n useObjectPropEffect('playbackId', playbackId, ref);\n useObjectPropEffect(\n 'paused',\n paused,\n ref,\n (playerEl: HTMLMediaElement, pausedVal?: boolean) => {\n if (pausedVal == null) return;\n if (pausedVal) {\n playerEl.pause();\n } else {\n playerEl.play();\n }\n },\n (playerEl, value, propName) => {\n if (playerEl.hasAttribute('autoplay') && !playerEl.hasPlayed) {\n return false;\n }\n return defaultHasChanged(playerEl, value, propName);\n }\n );\n // NOTE: Somewhere in the codebase, `currentTime` is getting cast to a number, resulting in `NaN` + an error.\n // This is a bandaid solution for now. (CJP)\n useObjectPropEffect('currentTime', currentTime ?? 0, ref);\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('playerready', ref, onPlayerReady);\n return [remainingProps];\n};\n\nconst playerSoftwareVersion = getPlayerVersion();\nconst playerSoftwareName = 'mux-player-react';\n\nconst MuxPlayer = React.forwardRef<\n MuxPlayerRefAttributes,\n Omit<MuxPlayerProps, 'playerSoftwareVersion' | 'playerSoftwareName'>\n>((props, ref) => {\n const innerPlayerRef = useRef<MuxPlayerElement>(null);\n const playerRef = useCombinedRefs(innerPlayerRef, ref);\n const [remainingProps] = usePlayer(innerPlayerRef, props);\n\n return (\n <MuxPlayerInternal\n /** @TODO Fix types relationships (CJP) */\n ref={playerRef as typeof innerPlayerRef}\n playerSoftwareName={playerSoftwareName}\n playerSoftwareVersion={playerSoftwareVersion}\n {...remainingProps}\n />\n );\n});\n\nexport default MuxPlayer;\n", "// NOTE: As a forward-looking implementation, we may want to assume\n// prop names -> attribute names is always a simple name.toLowerCase()\n// and provide a mechanism for passing in per-component overrides for\n// e.g. kebab cases, as that's the way React/Preact handles these. (CJP)\nconst ReactPropToAttrNameMap = {\n className: 'class',\n classname: 'class',\n htmlFor: 'for',\n crossOrigin: 'crossorigin',\n viewBox: 'viewBox',\n playsInline: 'playsinline',\n autoPlay: 'autoplay',\n playbackRate: 'playbackrate',\n};\n\ntype KeyTypes = string | number | symbol;\ntype Maybe<T> = T | null | undefined;\n\nexport const isNil = (x: unknown): x is null | undefined => x == undefined;\n\n// Type Guard to determine if a given key is actually a key of some object of type T\nexport const isKeyOf = <T extends {} = any>(k: KeyTypes, o: Maybe<T>): k is keyof T => {\n if (isNil(o)) return false;\n return k in o;\n};\n\nconst toKebabCase = (string: string) => string.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);\n\nexport const toNativeAttrName = (propName: string, propValue: any): string | undefined => {\n if (typeof propValue === 'boolean' && !propValue) return undefined;\n if (isKeyOf(propName, ReactPropToAttrNameMap)) return ReactPropToAttrNameMap[propName];\n if (typeof propValue == undefined) return undefined;\n if (/[A-Z]/.test(propName)) return toKebabCase(propName);\n return propName;\n};\nexport const toStyleAttr = <T>(x: T) => x;\n\nexport const toNativeAttrValue = (propValue: any, propName: string) => {\n if (typeof propValue === 'boolean') return '';\n return propValue;\n};\n\nexport const toNativeProps = (props = {}) => {\n return Object.entries(props).reduce<{ [k: string]: string }>((transformedProps, [propName, propValue]) => {\n const attrName = toNativeAttrName(propName, propValue);\n\n // prop was stripped. Don't add.\n if (!attrName) {\n return transformedProps;\n }\n\n const attrValue = toNativeAttrValue(propValue, propName);\n transformedProps[attrName] = attrValue;\n return transformedProps;\n }, {});\n};\n", "import { useEffect, useRef } from 'react';\nimport type { MutableRefObject, ForwardedRef } from 'react';\n\ntype Maybe<T> = T | null | undefined;\ntype RefCb<T> = (instance: Maybe<T>) => void;\ntype RefObj<T> = MutableRefObject<Maybe<T>>;\ntype RefTypes<T> = RefObj<T> | RefCb<T> | ForwardedRef<T>;\ninterface useCombinedRefs {\n <T>(...refs: Maybe<RefTypes<T>>[]): RefObj<T>;\n}\n\nexport const useCombinedRefs: useCombinedRefs = (...refs) => {\n const targetRef = useRef(null);\n\n useEffect(() => {\n refs.forEach((ref) => {\n if (!ref) return;\n\n if (typeof ref === 'function') {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n });\n }, [refs]);\n\n return targetRef;\n};\n\n// TS assumed default export was interface def instead of function value (CJP)\nconst defaultUseCombinedRefs = useCombinedRefs;\nexport default defaultUseCombinedRefs;\n", "import { useEffect } from 'react';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Slightly modified version of React's shallowEqual, with optimizations for Arrays\n * so we may treat them specifically as unequal if they are not a) both arrays\n * or b) don't contain the same (shallowly compared) elements.\n */\nconst shallowEqual = (objA: any, objB: any): boolean => {\n if (Object.is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n if (Array.isArray(objA)) {\n // Early \"cheap\" array compares\n if (!Array.isArray(objB) || objA.length !== objB.length) return false;\n // Shallow compare for arrays\n return objA.some((vVal, i) => objB[i] === vVal);\n }\n\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (let i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const defaultHasChanged = (obj: any, v: any, k: string) => {\n return !shallowEqual(v, obj[k]);\n};\n\nconst defaultUpdateValue = (obj: any, v: any, k: string) => {\n obj[k] = v;\n};\n\nexport const useObjectPropEffect = <T extends { [k: string]: any }, V>(\n propName: string,\n propValue: V | null | undefined,\n ref: React.MutableRefObject<T | null> | null | undefined,\n updateValue = defaultUpdateValue,\n hasChanged = defaultHasChanged\n) => {\n return useEffect(() => {\n const obj = ref?.current;\n if (!obj) return;\n if (!hasChanged(obj, propValue, propName)) return;\n updateValue(obj, propValue, propName);\n }, [ref?.current, propValue]);\n};\n\nexport default useObjectPropEffect;\n", "const getEnvPlayerVersion = () => {\n try {\n // @ts-ignore\n return PLAYER_VERSION as string;\n } catch {}\n return 'UNKNOWN';\n};\n\nconst player_version: string = getEnvPlayerVersion();\n\nexport const getPlayerVersion = () => player_version;\n"],
5
- "mappings": "6jBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,yCAAAE,KAAA,eAAAC,GAAAH,IAAA,IAAAI,EAAiC,qBAGjCC,EAA2B,2BCC3B,IAAMC,EAAyB,CAC7B,UAAW,QACX,UAAW,QACX,QAAS,M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export", "src_default", "__toCommonJS", "import_react", "import_mux_player", "ReactPropToAttrNameMap", "isNil", "x", "isKeyOf", "k", "o", "toKebabCase", "string", "match", "toNativeAttrName", "propName", "propValue", "toNativeAttrValue", "propValue", "propName", "toNativeProps", "props", "transformedProps", "attrName", "toNativeAttrName", "attrValue", "import_react", "import_react", "useCombinedRefs", "refs", "targetRef", "ref", "import_react", "hasOwnProperty", "shallowEqual", "objA", "objB", "vVal", "keysA", "keysB", "i", "defaultHasChanged", "obj", "v", "k", "defaultUpdateValue", "useObjectPropEffect", "propName", "propValue", "ref", "updateValue", "hasChanged", "useObjectPropEffect_default", "getEnvPlayerVersion", "player_version", "getPlayerVersion", "MuxPlayerInternal", "React", "children", "props", "ref", "toNativeProps", "useEventCallbackEffect", "type", "callback", "eventTarget", "usePlayer", "onAbort", "onCanPlay", "onCanPlayThrough", "onEmptied", "onLoadStart", "onLoadedData", "onLoadedMetadata", "onProgress", "onDurationChange", "onVolumeChange", "onRateChange", "onResize", "onWaiting", "onPlay", "onPlaying", "onTimeUpdate", "onPause", "onSeeking", "onSeeked", "onStalled", "onSuspend", "onEnded", "onError", "metadata", "tokens", "paused", "playbackId", "playbackRates", "currentTime", "remainingProps", "useObjectPropEffect_default", "playerEl", "pausedVal", "value", "propName", "defaultHasChanged", "playerSoftwareVersion", "getPlayerVersion", "playerSoftwareName", "MuxPlayer", "innerPlayerRef", "playerRef", "useCombinedRefs", "src_default"]
4
+ "sourcesContent": ["import React, { useEffect } from 'react';\nimport type { CSSProperties } from 'react';\nimport type { StreamTypes, PlaybackTypes, CmcdTypes } from '@mux/playback-core';\nimport { MediaError } from '@mux/mux-player';\nimport type MuxPlayerElement from '@mux/mux-player';\nimport type { Tokens, MuxPlayerElementEventMap } from '@mux/mux-player';\nimport { toNativeProps } from './common/utils';\nimport { useRef } from 'react';\nimport { useCombinedRefs } from './useCombinedRefs';\nimport useObjectPropEffect, { defaultHasChanged } from './useObjectPropEffect';\nimport { getPlayerVersion } from './env';\n\nexport { MediaError };\n\ntype ValueOf<T> = T[keyof T];\ninterface GenericEventListener<T extends Event = CustomEvent> {\n (evt: T): void;\n}\n\nexport type MuxPlayerRefAttributes = MuxPlayerElement;\ntype VideoApiAttributes = {\n currentTime: number;\n volume: number;\n paused: boolean;\n src: string | null;\n poster: string;\n playbackRate: number;\n playsInline: boolean;\n preload: string;\n crossOrigin: string;\n autoPlay: boolean | string;\n loop: boolean;\n muted: boolean;\n style: CSSProperties;\n};\n\ntype MuxMediaPropTypes = {\n audio: boolean;\n // envKey: Options[\"data\"][\"env_key\"];\n envKey: string;\n // debug: Options[\"debug\"] & Hls[\"config\"][\"debug\"];\n debug: boolean;\n disableCookies: boolean;\n // metadata: Partial<Options[\"data\"]>;\n metadata: { [k: string]: any };\n beaconCollectionDomain: string;\n customDomain: string;\n playbackId: string;\n preferPlayback: ValueOf<PlaybackTypes> | undefined;\n streamType: ValueOf<StreamTypes> | 'vod';\n startTime: number;\n storyboardSrc: string;\n preferCmcd: ValueOf<CmcdTypes> | undefined;\n children: never[];\n};\n\nexport type MuxPlayerProps = {\n className?: string;\n hotkeys?: string;\n nohotkeys?: boolean;\n defaultHiddenCaptions?: boolean;\n playerSoftwareVersion?: string;\n playerSoftwareName?: string;\n forwardSeekOffset?: number;\n backwardSeekOffset?: number;\n maxResolution?: string;\n metadataVideoId?: string;\n metadataVideoTitle?: string;\n metadataViewerUserId?: string;\n primaryColor?: string;\n secondaryColor?: string;\n placeholder?: string;\n playbackRates?: number[];\n defaultShowRemainingTime?: boolean;\n thumbnailTime?: number;\n title?: string;\n tokens?: Tokens;\n theme?: string;\n onAbort?: GenericEventListener<MuxPlayerElementEventMap['abort']>;\n onCanPlay?: GenericEventListener<MuxPlayerElementEventMap['canplay']>;\n onCanPlayThrough?: GenericEventListener<MuxPlayerElementEventMap['canplaythrough']>;\n onEmptied?: GenericEventListener<MuxPlayerElementEventMap['emptied']>;\n onLoadStart?: GenericEventListener<MuxPlayerElementEventMap['loadstart']>;\n onLoadedData?: GenericEventListener<MuxPlayerElementEventMap['loadeddata']>;\n onLoadedMetadata?: GenericEventListener<MuxPlayerElementEventMap['loadedmetadata']>;\n onProgress?: GenericEventListener<MuxPlayerElementEventMap['progress']>;\n onDurationChange?: GenericEventListener<MuxPlayerElementEventMap['durationchange']>;\n onVolumeChange?: GenericEventListener<MuxPlayerElementEventMap['volumechange']>;\n onRateChange?: GenericEventListener<MuxPlayerElementEventMap['ratechange']>;\n onResize?: GenericEventListener<MuxPlayerElementEventMap['resize']>;\n onWaiting?: GenericEventListener<MuxPlayerElementEventMap['waiting']>;\n onPlay?: GenericEventListener<MuxPlayerElementEventMap['play']>;\n onPlaying?: GenericEventListener<MuxPlayerElementEventMap['playing']>;\n onTimeUpdate?: GenericEventListener<MuxPlayerElementEventMap['timeupdate']>;\n onPause?: GenericEventListener<MuxPlayerElementEventMap['pause']>;\n onSeeking?: GenericEventListener<MuxPlayerElementEventMap['seeking']>;\n onSeeked?: GenericEventListener<MuxPlayerElementEventMap['seeked']>;\n onStalled?: GenericEventListener<MuxPlayerElementEventMap['stalled']>;\n onSuspend?: GenericEventListener<MuxPlayerElementEventMap['suspend']>;\n onEnded?: GenericEventListener<MuxPlayerElementEventMap['ended']>;\n onError?: GenericEventListener<MuxPlayerElementEventMap['error']>;\n onCuePointChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointchange']>;\n onCuePointsChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointschange']>;\n // onPlayerReady?: EventListener;\n} & Partial<MuxMediaPropTypes> &\n Partial<VideoApiAttributes>;\n\nconst MuxPlayerInternal = React.forwardRef<MuxPlayerRefAttributes, MuxPlayerProps>(({ children, ...props }, ref) => {\n return React.createElement('mux-player', toNativeProps({ ...props, ref }), children);\n});\n\nconst useEventCallbackEffect = <K extends keyof MuxPlayerElementEventMap>(\n type: K,\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n callback: GenericEventListener<MuxPlayerElementEventMap[K]> | undefined\n) => {\n return useEffect(() => {\n const eventTarget = ref?.current;\n if (!eventTarget || !callback) return;\n eventTarget.addEventListener(type, callback);\n return () => {\n eventTarget.removeEventListener(type, callback);\n };\n }, [ref?.current, callback]);\n};\n\nconst usePlayer = (\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n props: MuxPlayerProps\n) => {\n const {\n onAbort,\n onCanPlay,\n onCanPlayThrough,\n onEmptied,\n onLoadStart,\n onLoadedData,\n onLoadedMetadata,\n onProgress,\n onDurationChange,\n onVolumeChange,\n onRateChange,\n onResize,\n onWaiting,\n onPlay,\n onPlaying,\n onTimeUpdate,\n onPause,\n onSeeking,\n onSeeked,\n onStalled,\n onSuspend,\n onEnded,\n onError,\n onCuePointChange,\n onCuePointsChange,\n // onPlayerReady,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n currentTime,\n ...remainingProps\n } = props;\n useObjectPropEffect('playbackRates', playbackRates, ref);\n useObjectPropEffect('metadata', metadata, ref);\n useObjectPropEffect('tokens', tokens, ref);\n useObjectPropEffect('playbackId', playbackId, ref);\n useObjectPropEffect(\n 'paused',\n paused,\n ref,\n (playerEl: HTMLMediaElement, pausedVal?: boolean) => {\n if (pausedVal == null) return;\n if (pausedVal) {\n playerEl.pause();\n } else {\n playerEl.play();\n }\n },\n (playerEl, value, propName) => {\n if (playerEl.hasAttribute('autoplay') && !playerEl.hasPlayed) {\n return false;\n }\n return defaultHasChanged(playerEl, value, propName);\n }\n );\n // NOTE: Somewhere in the codebase, `currentTime` is getting cast to a number, resulting in `NaN` + an error.\n // This is a bandaid solution for now. (CJP)\n useObjectPropEffect('currentTime', currentTime ?? 0, ref);\n useEventCallbackEffect('abort', ref, onAbort);\n useEventCallbackEffect('canplay', ref, onCanPlay);\n useEventCallbackEffect('canplaythrough', ref, onCanPlayThrough);\n useEventCallbackEffect('emptied', ref, onEmptied);\n useEventCallbackEffect('loadstart', ref, onLoadStart);\n useEventCallbackEffect('loadeddata', ref, onLoadedData);\n useEventCallbackEffect('loadedmetadata', ref, onLoadedMetadata);\n useEventCallbackEffect('progress', ref, onProgress);\n useEventCallbackEffect('durationchange', ref, onDurationChange);\n useEventCallbackEffect('volumechange', ref, onVolumeChange);\n useEventCallbackEffect('ratechange', ref, onRateChange);\n useEventCallbackEffect('resize', ref, onResize);\n useEventCallbackEffect('waiting', ref, onWaiting);\n useEventCallbackEffect('play', ref, onPlay);\n useEventCallbackEffect('playing', ref, onPlaying);\n useEventCallbackEffect('timeupdate', ref, onTimeUpdate);\n useEventCallbackEffect('pause', ref, onPause);\n useEventCallbackEffect('seeking', ref, onSeeking);\n useEventCallbackEffect('seeked', ref, onSeeked);\n useEventCallbackEffect('stalled', ref, onStalled);\n useEventCallbackEffect('suspend', ref, onSuspend);\n useEventCallbackEffect('ended', ref, onEnded);\n useEventCallbackEffect('error', ref, onError);\n useEventCallbackEffect('cuepointchange', ref, onCuePointChange);\n useEventCallbackEffect('cuepointschange', ref, onCuePointsChange);\n // useEventCallbackEffect('playerready', ref, onPlayerReady);\n return [remainingProps];\n};\n\nconst playerSoftwareVersion = getPlayerVersion();\nconst playerSoftwareName = 'mux-player-react';\n\nconst MuxPlayer = React.forwardRef<\n MuxPlayerRefAttributes,\n Omit<MuxPlayerProps, 'playerSoftwareVersion' | 'playerSoftwareName'>\n>((props, ref) => {\n const innerPlayerRef = useRef<MuxPlayerElement>(null);\n const playerRef = useCombinedRefs(innerPlayerRef, ref);\n const [remainingProps] = usePlayer(innerPlayerRef, props);\n\n return (\n <MuxPlayerInternal\n /** @TODO Fix types relationships (CJP) */\n ref={playerRef as typeof innerPlayerRef}\n playerSoftwareName={playerSoftwareName}\n playerSoftwareVersion={playerSoftwareVersion}\n {...remainingProps}\n />\n );\n});\n\nexport default MuxPlayer;\n", "// NOTE: As a forward-looking implementation, we may want to assume\n// prop names -> attribute names is always a simple name.toLowerCase()\n// and provide a mechanism for passing in per-component overrides for\n// e.g. kebab cases, as that's the way React/Preact handles these. (CJP)\nconst ReactPropToAttrNameMap = {\n className: 'class',\n classname: 'class',\n htmlFor: 'for',\n crossOrigin: 'crossorigin',\n viewBox: 'viewBox',\n playsInline: 'playsinline',\n autoPlay: 'autoplay',\n playbackRate: 'playbackrate',\n};\n\ntype KeyTypes = string | number | symbol;\ntype Maybe<T> = T | null | undefined;\n\nexport const isNil = (x: unknown): x is null | undefined => x == undefined;\n\n// Type Guard to determine if a given key is actually a key of some object of type T\nexport const isKeyOf = <T extends {} = any>(k: KeyTypes, o: Maybe<T>): k is keyof T => {\n if (isNil(o)) return false;\n return k in o;\n};\n\nconst toKebabCase = (string: string) => string.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);\n\nexport const toNativeAttrName = (propName: string, propValue: any): string | undefined => {\n if (typeof propValue === 'boolean' && !propValue) return undefined;\n if (isKeyOf(propName, ReactPropToAttrNameMap)) return ReactPropToAttrNameMap[propName];\n if (typeof propValue == undefined) return undefined;\n if (/[A-Z]/.test(propName)) return toKebabCase(propName);\n return propName;\n};\nexport const toStyleAttr = <T>(x: T) => x;\n\nexport const toNativeAttrValue = (propValue: any, propName: string) => {\n if (typeof propValue === 'boolean') return '';\n return propValue;\n};\n\nexport const toNativeProps = (props = {}) => {\n return Object.entries(props).reduce<{ [k: string]: string }>((transformedProps, [propName, propValue]) => {\n const attrName = toNativeAttrName(propName, propValue);\n\n // prop was stripped. Don't add.\n if (!attrName) {\n return transformedProps;\n }\n\n const attrValue = toNativeAttrValue(propValue, propName);\n transformedProps[attrName] = attrValue;\n return transformedProps;\n }, {});\n};\n", "import { useEffect, useRef } from 'react';\nimport type { MutableRefObject, ForwardedRef } from 'react';\n\ntype Maybe<T> = T | null | undefined;\ntype RefCb<T> = (instance: Maybe<T>) => void;\ntype RefObj<T> = MutableRefObject<Maybe<T>>;\ntype RefTypes<T> = RefObj<T> | RefCb<T> | ForwardedRef<T>;\ninterface useCombinedRefs {\n <T>(...refs: Maybe<RefTypes<T>>[]): RefObj<T>;\n}\n\nexport const useCombinedRefs: useCombinedRefs = (...refs) => {\n const targetRef = useRef(null);\n\n useEffect(() => {\n refs.forEach((ref) => {\n if (!ref) return;\n\n if (typeof ref === 'function') {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n });\n }, [refs]);\n\n return targetRef;\n};\n\n// TS assumed default export was interface def instead of function value (CJP)\nconst defaultUseCombinedRefs = useCombinedRefs;\nexport default defaultUseCombinedRefs;\n", "import { useEffect } from 'react';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Slightly modified version of React's shallowEqual, with optimizations for Arrays\n * so we may treat them specifically as unequal if they are not a) both arrays\n * or b) don't contain the same (shallowly compared) elements.\n */\nconst shallowEqual = (objA: any, objB: any): boolean => {\n if (Object.is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n if (Array.isArray(objA)) {\n // Early \"cheap\" array compares\n if (!Array.isArray(objB) || objA.length !== objB.length) return false;\n // Shallow compare for arrays\n return objA.some((vVal, i) => objB[i] === vVal);\n }\n\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (let i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const defaultHasChanged = (obj: any, v: any, k: string) => {\n return !shallowEqual(v, obj[k]);\n};\n\nconst defaultUpdateValue = (obj: any, v: any, k: string) => {\n obj[k] = v;\n};\n\nexport const useObjectPropEffect = <T extends { [k: string]: any }, V>(\n propName: string,\n propValue: V | null | undefined,\n ref: React.MutableRefObject<T | null> | null | undefined,\n updateValue = defaultUpdateValue,\n hasChanged = defaultHasChanged\n) => {\n return useEffect(() => {\n const obj = ref?.current;\n if (!obj) return;\n if (!hasChanged(obj, propValue, propName)) return;\n updateValue(obj, propValue, propName);\n }, [ref?.current, propValue]);\n};\n\nexport default useObjectPropEffect;\n", "const getEnvPlayerVersion = () => {\n try {\n // @ts-ignore\n return PLAYER_VERSION as string;\n } catch {}\n return 'UNKNOWN';\n};\n\nconst player_version: string = getEnvPlayerVersion();\n\nexport const getPlayerVersion = () => player_version;\n"],
5
+ "mappings": "ikBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,yCAAAE,KAAA,eAAAC,GAAAH,IAAA,IAAAI,EAAiC,qBAGjCC,EAA2B,2BCC3B,IAAMC,EAAyB,CAC7B,UAAW,QACX,UAAW,QACX,QAAS,MACT,YAAa,cACb,QAAS,UACT,YAAa,cACb,SAAU,WACV,aAAc,cAChB,EAKaC,GAASC,GAAsCA,GAAK,KAGpDC,GAAU,CAAqBC,EAAaC,IACnDJ,GAAMI,CAAC,EAAU,GACdD,KAAKC,EAGRC,GAAeC,GAAmBA,EAAO,QAAQ,SAAWC,GAAU,IAAIA,EAAM,YAAY,GAAG,EAExFC,GAAmB,CAACC,EAAkBC,IAAuC,CACxF,GAAI,SAAOA,GAAc,WAAa,CAACA,GACvC,IAAIR,GAAQO,EAAUV,CAAsB,EAAG,OAAOA,EAAuBU,GAC7E,GAAI,OAAOC,GAAa,KACxB,MAAI,QAAQ,KAAKD,CAAQ,EAAUJ,GAAYI,CAAQ,EAChDA,EACT,EAGO,IAAME,GAAoB,CAACC,EAAgBC,IAC5C,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,EAAYR,GAAkBC,EAAWC,CAAQ,EACvD,OAAAG,EAAiBC,GAAYE,EACtBH,CACT,EAAG,CAAC,CAAC,ED/CP,IAAAI,E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AC5C1B,EAAuB,QAASF,EAAK6B,CAAO,EAC5C3B,EAAuB,iBAAkBF,EAAK8B,CAAgB,EAC9D5B,EAAuB,kBAAmBF,EAAK+B,CAAiB,EAEzD,CAACO,CAAc,CACxB,EAEMO,GAAwBC,EAAiB,EACzCC,GAAqB,mBAErBC,GAAY,EAAAnD,QAAM,WAGtB,CAACE,EAAOC,IAAQ,CAChB,IAAMiD,KAAiB,UAAyB,IAAI,EAC9CC,EAAYC,EAAgBF,EAAgBjD,CAAG,EAC/C,CAACsC,CAAc,EAAIhC,GAAU2C,EAAgBlD,CAAK,EAExD,OACE,EAAAF,QAAA,cAACD,GAAA,CAEC,IAAKsD,EACL,mBAAoBH,GACpB,sBAAuBF,GACtB,GAAGP,EACN,CAEJ,CAAC,EAEMc,GAAQJ",
6
+ "names": ["src_exports", "__export", "src_default", "__toCommonJS", "import_react", "import_mux_player", "ReactPropToAttrNameMap", "isNil", "x", "isKeyOf", "k", "o", "toKebabCase", "string", "match", "toNativeAttrName", "propName", "propValue", "toNativeAttrValue", "propValue", "propName", "toNativeProps", "props", "transformedProps", "attrName", "toNativeAttrName", "attrValue", "import_react", "import_react", "useCombinedRefs", "refs", "targetRef", "ref", "import_react", "hasOwnProperty", "shallowEqual", "objA", "objB", "vVal", "keysA", "keysB", "i", "defaultHasChanged", "obj", "v", "k", "defaultUpdateValue", "useObjectPropEffect", "propName", "propValue", "ref", "updateValue", "hasChanged", "useObjectPropEffect_default", "getEnvPlayerVersion", "player_version", "getPlayerVersion", "MuxPlayerInternal", "React", "children", "props", "ref", "toNativeProps", "useEventCallbackEffect", "type", "callback", "eventTarget", "usePlayer", "onAbort", "onCanPlay", "onCanPlayThrough", "onEmptied", "onLoadStart", "onLoadedData", "onLoadedMetadata", "onProgress", "onDurationChange", "onVolumeChange", "onRateChange", "onResize", "onWaiting", "onPlay", "onPlaying", "onTimeUpdate", "onPause", "onSeeking", "onSeeked", "onStalled", "onSuspend", "onEnded", "onError", "onCuePointChange", "onCuePointsChange", "metadata", "tokens", "paused", "playbackId", "playbackRates", "currentTime", "remainingProps", "useObjectPropEffect_default", "playerEl", "pausedVal", "value", "propName", "defaultHasChanged", "playerSoftwareVersion", "getPlayerVersion", "playerSoftwareName", "MuxPlayer", "innerPlayerRef", "playerRef", "useCombinedRefs", "src_default"]
7
7
  }
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import y,{useEffect as ae}from"react";import{MediaError as ge}from"@mux/mux-player";var c={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},F=e=>e==null,W=(e,t)=>F(t)?!1:e in t,Z=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),_=(e,t)=>{if(!(typeof t=="boolean"&&!t)){if(W(e,c))return c[e];if(typeof t!=null)return/[A-Z]/.test(e)?Z(e):e}};var q=(e,t)=>typeof e=="boolean"?"":e,m=(e={})=>Object.entries(e).reduce((t,[n,o])=>{let r=_(n,o);if(!r)return t;let i=q(o,n);return t[r]=i,t},{});import{useRef as re}from"react";import{useEffect as J,useRef as Y}from"react";var E=(...e)=>{let t=Y(null);return J(()=>{e.forEach(n=>{!n||(typeof n=="function"?n(t.current):n.current=t.current)})},[e]),t};import{useEffect as $}from"react";var Q=Object.prototype.hasOwnProperty,X=(e,t)=>{if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.some((r,i)=>t[i]===r);let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let r=0;r<n.length;r++)if(!Q.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0},p=(e,t,n)=>!X(t,e[n]),B=(e,t,n)=>{e[n]=t},ee=(e,t,n,o=B,r=p)=>$(()=>{let i=n==null?void 0:n.current;!i||!r(i,t,e)||o(i,t,e)},[n==null?void 0:n.current,t]),s=ee;var te=()=>{try{return"1.8.0"}catch{}return"UNKNOWN"},ne=te(),f=()=>ne;var oe=y.forwardRef(({children:e,...t},n)=>y.createElement("mux-player",m({...t,ref:n}),e)),a=(e,t,n)=>ae(()=>{let o=t==null?void 0:t.current;if(!(!o||!n))return o.addEventListener(e,n),()=>{o.removeEventListener(e,n)}},[t==null?void 0:t.current,n]),ie=(e,t)=>{let{onAbort:n,onCanPlay:o,onCanPlayThrough:r,onEmptied:i,onLoadStart:M,onLoadedData:g,onLoadedMetadata:P,onProgress:b,onDurationChange:v,onVolumeChange:x,onRateChange:T,onResize:R,onWaiting:h,onPlay:k,onPlaying:L,onTimeUpdate:C,onPause:O,onSeeking:S,onSeeked:w,onStalled:G,onSuspend:V,onEnded:A,onError:N,metadata:I,tokens:K,paused:D,playbackId:U,playbackRates:H,currentTime:d,...j}=t;return s("playbackRates",H,e),s("metadata",I,e),s("tokens",K,e),s("playbackId",U,e),s("paused",D,e,(l,u)=>{u!=null&&(u?l.pause():l.play())},(l,u,z)=>l.hasAttribute("autoplay")&&!l.hasPlayed?!1:p(l,u,z)),s("currentTime",d!=null?d:0,e),a("abort",e,n),a("canplay",e,o),a("canplaythrough",e,r),a("emptied",e,i),a("loadstart",e,M),a("loadeddata",e,g),a("loadedmetadata",e,P),a("progress",e,b),a("durationchange",e,v),a("volumechange",e,x),a("ratechange",e,T),a("resize",e,R),a("waiting",e,h),a("play",e,k),a("playing",e,L),a("timeupdate",e,C),a("pause",e,O),a("seeking",e,S),a("seeked",e,w),a("stalled",e,G),a("suspend",e,V),a("ended",e,A),a("error",e,N),[j]},se=f(),le="mux-player-react",ue=y.forwardRef((e,t)=>{let n=re(null),o=E(n,t),[r]=ie(n,e);return y.createElement(oe,{ref:o,playerSoftwareName:le,playerSoftwareVersion:se,...r})}),Re=ue;export{ge as MediaError,Re as default};
1
+ import y,{useEffect as oe}from"react";import{MediaError as ve}from"@mux/mux-player";var d={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},Z=e=>e==null,_=(e,n)=>Z(n)?!1:e in n,q=e=>e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),J=(e,n)=>{if(!(typeof n=="boolean"&&!n)){if(_(e,d))return d[e];if(typeof n!=null)return/[A-Z]/.test(e)?q(e):e}};var Y=(e,n)=>typeof e=="boolean"?"":e,m=(e={})=>Object.entries(e).reduce((n,[t,o])=>{let r=J(t,o);if(!r)return n;let i=Y(o,t);return n[r]=i,n},{});import{useRef as ie}from"react";import{useEffect as $,useRef as Q}from"react";var E=(...e)=>{let n=Q(null);return $(()=>{e.forEach(t=>{!t||(typeof t=="function"?t(n.current):t.current=n.current)})},[e]),n};import{useEffect as X}from"react";var B=Object.prototype.hasOwnProperty,ee=(e,n)=>{if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.some((r,i)=>n[i]===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(!B.call(n,t[r])||!Object.is(e[t[r]],n[t[r]]))return!1;return!0},c=(e,n,t)=>!ee(n,e[t]),ne=(e,n,t)=>{e[t]=n},te=(e,n,t,o=ne,r=c)=>X(()=>{let i=t==null?void 0:t.current;!i||!r(i,n,e)||o(i,n,e)},[t==null?void 0:t.current,n]),s=te;var ae=()=>{try{return"1.9.0"}catch{}return"UNKNOWN"},re=ae(),g=()=>re;var se=y.forwardRef(({children:e,...n},t)=>y.createElement("mux-player",m({...n,ref:t}),e)),a=(e,n,t)=>oe(()=>{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]),le=(e,n)=>{let{onAbort:t,onCanPlay:o,onCanPlayThrough:r,onEmptied:i,onLoadStart:f,onLoadedData:M,onLoadedMetadata:P,onProgress:v,onDurationChange:b,onVolumeChange:x,onRateChange:T,onResize:h,onWaiting:R,onPlay:k,onPlaying:C,onTimeUpdate:L,onPause:O,onSeeking:S,onSeeked:G,onStalled:w,onSuspend:V,onEnded:A,onError:N,onCuePointChange:I,onCuePointsChange:K,metadata:D,tokens:U,paused:j,playbackId:z,playbackRates:F,currentTime:p,...H}=n;return s("playbackRates",F,e),s("metadata",D,e),s("tokens",U,e),s("playbackId",z,e),s("paused",j,e,(l,u)=>{u!=null&&(u?l.pause():l.play())},(l,u,W)=>l.hasAttribute("autoplay")&&!l.hasPlayed?!1:c(l,u,W)),s("currentTime",p!=null?p:0,e),a("abort",e,t),a("canplay",e,o),a("canplaythrough",e,r),a("emptied",e,i),a("loadstart",e,f),a("loadeddata",e,M),a("loadedmetadata",e,P),a("progress",e,v),a("durationchange",e,b),a("volumechange",e,x),a("ratechange",e,T),a("resize",e,h),a("waiting",e,R),a("play",e,k),a("playing",e,C),a("timeupdate",e,L),a("pause",e,O),a("seeking",e,S),a("seeked",e,G),a("stalled",e,w),a("suspend",e,V),a("ended",e,A),a("error",e,N),a("cuepointchange",e,I),a("cuepointschange",e,K),[H]},ue=g(),ye="mux-player-react",pe=y.forwardRef((e,n)=>{let t=ie(null),o=E(t,n),[r]=le(t,e);return y.createElement(se,{ref:o,playerSoftwareName:ye,playerSoftwareVersion:ue,...r})}),ke=pe;export{ve as MediaError,ke as default};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.tsx", "../src/common/utils.ts", "../src/useCombinedRefs.ts", "../src/useObjectPropEffect.ts", "../src/env.ts"],
4
- "sourcesContent": ["import React, { useEffect } from 'react';\nimport type { CSSProperties } from 'react';\nimport type { StreamTypes, PlaybackTypes, CmcdTypes } from '@mux/playback-core';\nimport { MediaError } from '@mux/mux-player';\nimport type MuxPlayerElement from '@mux/mux-player';\nimport type { Tokens } from '@mux/mux-player';\nimport { toNativeProps } from './common/utils';\nimport { useRef } from 'react';\nimport { useCombinedRefs } from './useCombinedRefs';\nimport useObjectPropEffect, { defaultHasChanged } from './useObjectPropEffect';\nimport { getPlayerVersion } from './env';\n\nexport { MediaError };\n\ntype ValueOf<T> = T[keyof T];\ninterface GenericEventListener<T extends Event = CustomEvent> {\n (evt: T): void;\n}\n\nexport type MuxPlayerRefAttributes = MuxPlayerElement;\ntype VideoApiAttributes = {\n currentTime: number;\n volume: number;\n paused: boolean;\n src: string | null;\n poster: string;\n playbackRate: number;\n playsInline: boolean;\n preload: string;\n crossOrigin: string;\n autoPlay: boolean | string;\n loop: boolean;\n muted: boolean;\n style: CSSProperties;\n};\n\ntype MuxMediaPropTypes = {\n audio: boolean;\n // envKey: Options[\"data\"][\"env_key\"];\n envKey: string;\n // debug: Options[\"debug\"] & Hls[\"config\"][\"debug\"];\n debug: boolean;\n disableCookies: boolean;\n // metadata: Partial<Options[\"data\"]>;\n metadata: { [k: string]: any };\n beaconCollectionDomain: string;\n customDomain: string;\n playbackId: string;\n preferPlayback: ValueOf<PlaybackTypes> | undefined;\n streamType: ValueOf<StreamTypes> | 'vod';\n startTime: number;\n storyboardSrc: string;\n preferCmcd: ValueOf<CmcdTypes> | undefined;\n children: never[];\n};\n\ninterface MuxPlayerElementEventMap extends HTMLVideoElementEventMap {}\n\nexport type MuxPlayerProps = {\n className?: string;\n hotkeys?: string;\n nohotkeys?: boolean;\n defaultHiddenCaptions?: boolean;\n playerSoftwareVersion?: string;\n playerSoftwareName?: string;\n forwardSeekOffset?: number;\n backwardSeekOffset?: number;\n maxResolution?: string;\n metadataVideoId?: string;\n metadataVideoTitle?: string;\n metadataViewerUserId?: string;\n primaryColor?: string;\n secondaryColor?: string;\n placeholder?: string;\n playbackRates?: number[];\n defaultShowRemainingTime?: boolean;\n thumbnailTime?: number;\n title?: string;\n tokens?: Tokens;\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 // onPlayerReady?: EventListener;\n} & Partial<MuxMediaPropTypes> &\n Partial<VideoApiAttributes>;\n\nconst MuxPlayerInternal = React.forwardRef<MuxPlayerRefAttributes, MuxPlayerProps>(({ children, ...props }, ref) => {\n return React.createElement('mux-player', toNativeProps({ ...props, ref }), children);\n});\n\nconst useEventCallbackEffect = <K extends keyof MuxPlayerElementEventMap>(\n type: K,\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n callback: GenericEventListener<MuxPlayerElementEventMap[K]> | undefined\n) => {\n return useEffect(() => {\n const eventTarget = ref?.current;\n if (!eventTarget || !callback) return;\n eventTarget.addEventListener(type, callback);\n return () => {\n eventTarget.removeEventListener(type, callback);\n };\n }, [ref?.current, callback]);\n};\n\nconst usePlayer = (\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n props: MuxPlayerProps\n) => {\n const {\n onAbort,\n onCanPlay,\n onCanPlayThrough,\n onEmptied,\n onLoadStart,\n onLoadedData,\n onLoadedMetadata,\n onProgress,\n onDurationChange,\n onVolumeChange,\n onRateChange,\n onResize,\n onWaiting,\n onPlay,\n onPlaying,\n onTimeUpdate,\n onPause,\n onSeeking,\n onSeeked,\n onStalled,\n onSuspend,\n onEnded,\n onError,\n // onPlayerReady,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n currentTime,\n ...remainingProps\n } = props;\n useObjectPropEffect('playbackRates', playbackRates, ref);\n useObjectPropEffect('metadata', metadata, ref);\n useObjectPropEffect('tokens', tokens, ref);\n useObjectPropEffect('playbackId', playbackId, ref);\n useObjectPropEffect(\n 'paused',\n paused,\n ref,\n (playerEl: HTMLMediaElement, pausedVal?: boolean) => {\n if (pausedVal == null) return;\n if (pausedVal) {\n playerEl.pause();\n } else {\n playerEl.play();\n }\n },\n (playerEl, value, propName) => {\n if (playerEl.hasAttribute('autoplay') && !playerEl.hasPlayed) {\n return false;\n }\n return defaultHasChanged(playerEl, value, propName);\n }\n );\n // NOTE: Somewhere in the codebase, `currentTime` is getting cast to a number, resulting in `NaN` + an error.\n // This is a bandaid solution for now. (CJP)\n useObjectPropEffect('currentTime', currentTime ?? 0, ref);\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('playerready', ref, onPlayerReady);\n return [remainingProps];\n};\n\nconst playerSoftwareVersion = getPlayerVersion();\nconst playerSoftwareName = 'mux-player-react';\n\nconst MuxPlayer = React.forwardRef<\n MuxPlayerRefAttributes,\n Omit<MuxPlayerProps, 'playerSoftwareVersion' | 'playerSoftwareName'>\n>((props, ref) => {\n const innerPlayerRef = useRef<MuxPlayerElement>(null);\n const playerRef = useCombinedRefs(innerPlayerRef, ref);\n const [remainingProps] = usePlayer(innerPlayerRef, props);\n\n return (\n <MuxPlayerInternal\n /** @TODO Fix types relationships (CJP) */\n ref={playerRef as typeof innerPlayerRef}\n playerSoftwareName={playerSoftwareName}\n playerSoftwareVersion={playerSoftwareVersion}\n {...remainingProps}\n />\n );\n});\n\nexport default MuxPlayer;\n", "// NOTE: As a forward-looking implementation, we may want to assume\n// prop names -> attribute names is always a simple name.toLowerCase()\n// and provide a mechanism for passing in per-component overrides for\n// e.g. kebab cases, as that's the way React/Preact handles these. (CJP)\nconst ReactPropToAttrNameMap = {\n className: 'class',\n classname: 'class',\n htmlFor: 'for',\n crossOrigin: 'crossorigin',\n viewBox: 'viewBox',\n playsInline: 'playsinline',\n autoPlay: 'autoplay',\n playbackRate: 'playbackrate',\n};\n\ntype KeyTypes = string | number | symbol;\ntype Maybe<T> = T | null | undefined;\n\nexport const isNil = (x: unknown): x is null | undefined => x == undefined;\n\n// Type Guard to determine if a given key is actually a key of some object of type T\nexport const isKeyOf = <T extends {} = any>(k: KeyTypes, o: Maybe<T>): k is keyof T => {\n if (isNil(o)) return false;\n return k in o;\n};\n\nconst toKebabCase = (string: string) => string.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);\n\nexport const toNativeAttrName = (propName: string, propValue: any): string | undefined => {\n if (typeof propValue === 'boolean' && !propValue) return undefined;\n if (isKeyOf(propName, ReactPropToAttrNameMap)) return ReactPropToAttrNameMap[propName];\n if (typeof propValue == undefined) return undefined;\n if (/[A-Z]/.test(propName)) return toKebabCase(propName);\n return propName;\n};\nexport const toStyleAttr = <T>(x: T) => x;\n\nexport const toNativeAttrValue = (propValue: any, propName: string) => {\n if (typeof propValue === 'boolean') return '';\n return propValue;\n};\n\nexport const toNativeProps = (props = {}) => {\n return Object.entries(props).reduce<{ [k: string]: string }>((transformedProps, [propName, propValue]) => {\n const attrName = toNativeAttrName(propName, propValue);\n\n // prop was stripped. Don't add.\n if (!attrName) {\n return transformedProps;\n }\n\n const attrValue = toNativeAttrValue(propValue, propName);\n transformedProps[attrName] = attrValue;\n return transformedProps;\n }, {});\n};\n", "import { useEffect, useRef } from 'react';\nimport type { MutableRefObject, ForwardedRef } from 'react';\n\ntype Maybe<T> = T | null | undefined;\ntype RefCb<T> = (instance: Maybe<T>) => void;\ntype RefObj<T> = MutableRefObject<Maybe<T>>;\ntype RefTypes<T> = RefObj<T> | RefCb<T> | ForwardedRef<T>;\ninterface useCombinedRefs {\n <T>(...refs: Maybe<RefTypes<T>>[]): RefObj<T>;\n}\n\nexport const useCombinedRefs: useCombinedRefs = (...refs) => {\n const targetRef = useRef(null);\n\n useEffect(() => {\n refs.forEach((ref) => {\n if (!ref) return;\n\n if (typeof ref === 'function') {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n });\n }, [refs]);\n\n return targetRef;\n};\n\n// TS assumed default export was interface def instead of function value (CJP)\nconst defaultUseCombinedRefs = useCombinedRefs;\nexport default defaultUseCombinedRefs;\n", "import { useEffect } from 'react';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Slightly modified version of React's shallowEqual, with optimizations for Arrays\n * so we may treat them specifically as unequal if they are not a) both arrays\n * or b) don't contain the same (shallowly compared) elements.\n */\nconst shallowEqual = (objA: any, objB: any): boolean => {\n if (Object.is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n if (Array.isArray(objA)) {\n // Early \"cheap\" array compares\n if (!Array.isArray(objB) || objA.length !== objB.length) return false;\n // Shallow compare for arrays\n return objA.some((vVal, i) => objB[i] === vVal);\n }\n\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (let i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const defaultHasChanged = (obj: any, v: any, k: string) => {\n return !shallowEqual(v, obj[k]);\n};\n\nconst defaultUpdateValue = (obj: any, v: any, k: string) => {\n obj[k] = v;\n};\n\nexport const useObjectPropEffect = <T extends { [k: string]: any }, V>(\n propName: string,\n propValue: V | null | undefined,\n ref: React.MutableRefObject<T | null> | null | undefined,\n updateValue = defaultUpdateValue,\n hasChanged = defaultHasChanged\n) => {\n return useEffect(() => {\n const obj = ref?.current;\n if (!obj) return;\n if (!hasChanged(obj, propValue, propName)) return;\n updateValue(obj, propValue, propName);\n }, [ref?.current, propValue]);\n};\n\nexport default useObjectPropEffect;\n", "const getEnvPlayerVersion = () => {\n try {\n // @ts-ignore\n return PLAYER_VERSION as string;\n } catch {}\n return 'UNKNOWN';\n};\n\nconst player_version: string = getEnvPlayerVersion();\n\nexport const getPlayerVersion = () => player_version;\n"],
5
- "mappings": "AAAA,OAAOA,GAAS,aAAAC,OAAiB,QAGjC,OAAS,cAAAC,OAAkB,kBCC3B,IAAMC,EAAyB,CAC7B,UAAW,QACX,UAAW,QACX,QAAS,MACT,YAAa,cACb,QAAS,UACT,YAAa,cACb,SAAU,WACV,aAAc,cAChB,EAKaC,EAASC,GAAsCA,GAAK,KAGpDC,EAAU,CAAqBC,EAAaC,IACnDJ,EAAMI,CAAC,EAAU,GACdD,KAAKC,EAGRC,EAAeC,GAAmBA,EAAO,QAAQ,SAAWC,GAAU,IAAIA,EAAM,YAAY,GAAG,EAExFC,EAAmB,CAACC,EAAkBC,IAAuC,CACxF,GAAI,SAAOA,GAAc,WAAa,CAACA,GACvC,IAAIR,EAAQO,EAAUV,CAAsB,EAAG,OAAOA,EAAuBU,GAC7E,GAAI,OAAOC,GAAa,KACxB,MAAI,QAAQ,KAAKD,CAAQ,EAAUJ,EAAYI,CAAQ,EAChDA,EACT,EAGO,IAAME,EAAoB,CAACC,EAAgBC,IAC5C,OAAOD,GAAc,UAAkB,GACpCA,EAGIE,EAAgB,CAACC,EAAQ,CAAC,IAC9B,OAAO,QAAQA,CAAK,EAAE,OAAgC,CAACC,EAAkB,CAACH,EAAUD,CAAS,IAAM,CACxG,IAAMK,EAAWC,EAAiBL,EAAUD,CAAS,EAGrD,GAAI,CAACK,EACH,OAAOD,EAGT,IAAMG,EAAYR,EAAkBC,EAAWC,CAAQ,EACvD,OAAAG,EAAiBC,GAAYE,EACtBH,CACT,EAAG,CAAC,CAAC,ED/CP,OAAS,UAAAI,OAAc,QEPvB,OAAS,aAAAC,EAAW,UAAAC,MAAc,QAW3B,IAAMC,EAAmC,IAAIC,IAAS,CAC3D,I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CC,GAAqB,mBAErBC,GAAYlD,EAAM,WAGtB,CAACE,EAAOC,IAAQ,CAChB,IAAMgD,EAAiBC,GAAyB,IAAI,EAC9CC,EAAYC,EAAgBH,EAAgBhD,CAAG,EAC/C,CAACqC,CAAc,EAAI9B,GAAUyC,EAAgBjD,CAAK,EAExD,OACEF,EAAA,cAACD,GAAA,CAEC,IAAKsD,EACL,mBAAoBJ,GACpB,sBAAuBF,GACtB,GAAGP,EACN,CAEJ,CAAC,EAEMe,GAAQL",
6
- "names": ["React", "useEffect", "MediaError", "ReactPropToAttrNameMap", "isNil", "x", "isKeyOf", "k", "o", "toKebabCase", "string", "match", "toNativeAttrName", "propName", "propValue", "toNativeAttrValue", "propValue", "propName", "toNativeProps", "props", "transformedProps", "attrName", "toNativeAttrName", "attrValue", "useRef", "useEffect", "useRef", "useCombinedRefs", "refs", "targetRef", "ref", "useEffect", "hasOwnProperty", "shallowEqual", "objA", "objB", "vVal", "keysA", "keysB", "i", "defaultHasChanged", "obj", "v", "k", "defaultUpdateValue", "useObjectPropEffect", "propName", "propValue", "ref", "updateValue", "hasChanged", "useObjectPropEffect_default", "getEnvPlayerVersion", "player_version", "getPlayerVersion", "MuxPlayerInternal", "React", "children", "props", "ref", "toNativeProps", "useEventCallbackEffect", "type", "callback", "useEffect", "eventTarget", "usePlayer", "onAbort", "onCanPlay", "onCanPlayThrough", "onEmptied", "onLoadStart", "onLoadedData", "onLoadedMetadata", "onProgress", "onDurationChange", "onVolumeChange", "onRateChange", "onResize", "onWaiting", "onPlay", "onPlaying", "onTimeUpdate", "onPause", "onSeeking", "onSeeked", "onStalled", "onSuspend", "onEnded", "onError", "metadata", "tokens", "paused", "playbackId", "playbackRates", "currentTime", "remainingProps", "useObjectPropEffect_default", "playerEl", "pausedVal", "value", "propName", "defaultHasChanged", "playerSoftwareVersion", "getPlayerVersion", "playerSoftwareName", "MuxPlayer", "innerPlayerRef", "useRef", "playerRef", "useCombinedRefs", "src_default"]
4
+ "sourcesContent": ["import React, { useEffect } from 'react';\nimport type { CSSProperties } from 'react';\nimport type { StreamTypes, PlaybackTypes, CmcdTypes } from '@mux/playback-core';\nimport { MediaError } from '@mux/mux-player';\nimport type MuxPlayerElement from '@mux/mux-player';\nimport type { Tokens, MuxPlayerElementEventMap } from '@mux/mux-player';\nimport { toNativeProps } from './common/utils';\nimport { useRef } from 'react';\nimport { useCombinedRefs } from './useCombinedRefs';\nimport useObjectPropEffect, { defaultHasChanged } from './useObjectPropEffect';\nimport { getPlayerVersion } from './env';\n\nexport { MediaError };\n\ntype ValueOf<T> = T[keyof T];\ninterface GenericEventListener<T extends Event = CustomEvent> {\n (evt: T): void;\n}\n\nexport type MuxPlayerRefAttributes = MuxPlayerElement;\ntype VideoApiAttributes = {\n currentTime: number;\n volume: number;\n paused: boolean;\n src: string | null;\n poster: string;\n playbackRate: number;\n playsInline: boolean;\n preload: string;\n crossOrigin: string;\n autoPlay: boolean | string;\n loop: boolean;\n muted: boolean;\n style: CSSProperties;\n};\n\ntype MuxMediaPropTypes = {\n audio: boolean;\n // envKey: Options[\"data\"][\"env_key\"];\n envKey: string;\n // debug: Options[\"debug\"] & Hls[\"config\"][\"debug\"];\n debug: boolean;\n disableCookies: boolean;\n // metadata: Partial<Options[\"data\"]>;\n metadata: { [k: string]: any };\n beaconCollectionDomain: string;\n customDomain: string;\n playbackId: string;\n preferPlayback: ValueOf<PlaybackTypes> | undefined;\n streamType: ValueOf<StreamTypes> | 'vod';\n startTime: number;\n storyboardSrc: string;\n preferCmcd: ValueOf<CmcdTypes> | undefined;\n children: never[];\n};\n\nexport type MuxPlayerProps = {\n className?: string;\n hotkeys?: string;\n nohotkeys?: boolean;\n defaultHiddenCaptions?: boolean;\n playerSoftwareVersion?: string;\n playerSoftwareName?: string;\n forwardSeekOffset?: number;\n backwardSeekOffset?: number;\n maxResolution?: string;\n metadataVideoId?: string;\n metadataVideoTitle?: string;\n metadataViewerUserId?: string;\n primaryColor?: string;\n secondaryColor?: string;\n placeholder?: string;\n playbackRates?: number[];\n defaultShowRemainingTime?: boolean;\n thumbnailTime?: number;\n title?: string;\n tokens?: Tokens;\n theme?: string;\n onAbort?: GenericEventListener<MuxPlayerElementEventMap['abort']>;\n onCanPlay?: GenericEventListener<MuxPlayerElementEventMap['canplay']>;\n onCanPlayThrough?: GenericEventListener<MuxPlayerElementEventMap['canplaythrough']>;\n onEmptied?: GenericEventListener<MuxPlayerElementEventMap['emptied']>;\n onLoadStart?: GenericEventListener<MuxPlayerElementEventMap['loadstart']>;\n onLoadedData?: GenericEventListener<MuxPlayerElementEventMap['loadeddata']>;\n onLoadedMetadata?: GenericEventListener<MuxPlayerElementEventMap['loadedmetadata']>;\n onProgress?: GenericEventListener<MuxPlayerElementEventMap['progress']>;\n onDurationChange?: GenericEventListener<MuxPlayerElementEventMap['durationchange']>;\n onVolumeChange?: GenericEventListener<MuxPlayerElementEventMap['volumechange']>;\n onRateChange?: GenericEventListener<MuxPlayerElementEventMap['ratechange']>;\n onResize?: GenericEventListener<MuxPlayerElementEventMap['resize']>;\n onWaiting?: GenericEventListener<MuxPlayerElementEventMap['waiting']>;\n onPlay?: GenericEventListener<MuxPlayerElementEventMap['play']>;\n onPlaying?: GenericEventListener<MuxPlayerElementEventMap['playing']>;\n onTimeUpdate?: GenericEventListener<MuxPlayerElementEventMap['timeupdate']>;\n onPause?: GenericEventListener<MuxPlayerElementEventMap['pause']>;\n onSeeking?: GenericEventListener<MuxPlayerElementEventMap['seeking']>;\n onSeeked?: GenericEventListener<MuxPlayerElementEventMap['seeked']>;\n onStalled?: GenericEventListener<MuxPlayerElementEventMap['stalled']>;\n onSuspend?: GenericEventListener<MuxPlayerElementEventMap['suspend']>;\n onEnded?: GenericEventListener<MuxPlayerElementEventMap['ended']>;\n onError?: GenericEventListener<MuxPlayerElementEventMap['error']>;\n onCuePointChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointchange']>;\n onCuePointsChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointschange']>;\n // onPlayerReady?: EventListener;\n} & Partial<MuxMediaPropTypes> &\n Partial<VideoApiAttributes>;\n\nconst MuxPlayerInternal = React.forwardRef<MuxPlayerRefAttributes, MuxPlayerProps>(({ children, ...props }, ref) => {\n return React.createElement('mux-player', toNativeProps({ ...props, ref }), children);\n});\n\nconst useEventCallbackEffect = <K extends keyof MuxPlayerElementEventMap>(\n type: K,\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n callback: GenericEventListener<MuxPlayerElementEventMap[K]> | undefined\n) => {\n return useEffect(() => {\n const eventTarget = ref?.current;\n if (!eventTarget || !callback) return;\n eventTarget.addEventListener(type, callback);\n return () => {\n eventTarget.removeEventListener(type, callback);\n };\n }, [ref?.current, callback]);\n};\n\nconst usePlayer = (\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n props: MuxPlayerProps\n) => {\n const {\n onAbort,\n onCanPlay,\n onCanPlayThrough,\n onEmptied,\n onLoadStart,\n onLoadedData,\n onLoadedMetadata,\n onProgress,\n onDurationChange,\n onVolumeChange,\n onRateChange,\n onResize,\n onWaiting,\n onPlay,\n onPlaying,\n onTimeUpdate,\n onPause,\n onSeeking,\n onSeeked,\n onStalled,\n onSuspend,\n onEnded,\n onError,\n onCuePointChange,\n onCuePointsChange,\n // onPlayerReady,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n currentTime,\n ...remainingProps\n } = props;\n useObjectPropEffect('playbackRates', playbackRates, ref);\n useObjectPropEffect('metadata', metadata, ref);\n useObjectPropEffect('tokens', tokens, ref);\n useObjectPropEffect('playbackId', playbackId, ref);\n useObjectPropEffect(\n 'paused',\n paused,\n ref,\n (playerEl: HTMLMediaElement, pausedVal?: boolean) => {\n if (pausedVal == null) return;\n if (pausedVal) {\n playerEl.pause();\n } else {\n playerEl.play();\n }\n },\n (playerEl, value, propName) => {\n if (playerEl.hasAttribute('autoplay') && !playerEl.hasPlayed) {\n return false;\n }\n return defaultHasChanged(playerEl, value, propName);\n }\n );\n // NOTE: Somewhere in the codebase, `currentTime` is getting cast to a number, resulting in `NaN` + an error.\n // This is a bandaid solution for now. (CJP)\n useObjectPropEffect('currentTime', currentTime ?? 0, ref);\n useEventCallbackEffect('abort', ref, onAbort);\n useEventCallbackEffect('canplay', ref, onCanPlay);\n useEventCallbackEffect('canplaythrough', ref, onCanPlayThrough);\n useEventCallbackEffect('emptied', ref, onEmptied);\n useEventCallbackEffect('loadstart', ref, onLoadStart);\n useEventCallbackEffect('loadeddata', ref, onLoadedData);\n useEventCallbackEffect('loadedmetadata', ref, onLoadedMetadata);\n useEventCallbackEffect('progress', ref, onProgress);\n useEventCallbackEffect('durationchange', ref, onDurationChange);\n useEventCallbackEffect('volumechange', ref, onVolumeChange);\n useEventCallbackEffect('ratechange', ref, onRateChange);\n useEventCallbackEffect('resize', ref, onResize);\n useEventCallbackEffect('waiting', ref, onWaiting);\n useEventCallbackEffect('play', ref, onPlay);\n useEventCallbackEffect('playing', ref, onPlaying);\n useEventCallbackEffect('timeupdate', ref, onTimeUpdate);\n useEventCallbackEffect('pause', ref, onPause);\n useEventCallbackEffect('seeking', ref, onSeeking);\n useEventCallbackEffect('seeked', ref, onSeeked);\n useEventCallbackEffect('stalled', ref, onStalled);\n useEventCallbackEffect('suspend', ref, onSuspend);\n useEventCallbackEffect('ended', ref, onEnded);\n useEventCallbackEffect('error', ref, onError);\n useEventCallbackEffect('cuepointchange', ref, onCuePointChange);\n useEventCallbackEffect('cuepointschange', ref, onCuePointsChange);\n // useEventCallbackEffect('playerready', ref, onPlayerReady);\n return [remainingProps];\n};\n\nconst playerSoftwareVersion = getPlayerVersion();\nconst playerSoftwareName = 'mux-player-react';\n\nconst MuxPlayer = React.forwardRef<\n MuxPlayerRefAttributes,\n Omit<MuxPlayerProps, 'playerSoftwareVersion' | 'playerSoftwareName'>\n>((props, ref) => {\n const innerPlayerRef = useRef<MuxPlayerElement>(null);\n const playerRef = useCombinedRefs(innerPlayerRef, ref);\n const [remainingProps] = usePlayer(innerPlayerRef, props);\n\n return (\n <MuxPlayerInternal\n /** @TODO Fix types relationships (CJP) */\n ref={playerRef as typeof innerPlayerRef}\n playerSoftwareName={playerSoftwareName}\n playerSoftwareVersion={playerSoftwareVersion}\n {...remainingProps}\n />\n );\n});\n\nexport default MuxPlayer;\n", "// NOTE: As a forward-looking implementation, we may want to assume\n// prop names -> attribute names is always a simple name.toLowerCase()\n// and provide a mechanism for passing in per-component overrides for\n// e.g. kebab cases, as that's the way React/Preact handles these. (CJP)\nconst ReactPropToAttrNameMap = {\n className: 'class',\n classname: 'class',\n htmlFor: 'for',\n crossOrigin: 'crossorigin',\n viewBox: 'viewBox',\n playsInline: 'playsinline',\n autoPlay: 'autoplay',\n playbackRate: 'playbackrate',\n};\n\ntype KeyTypes = string | number | symbol;\ntype Maybe<T> = T | null | undefined;\n\nexport const isNil = (x: unknown): x is null | undefined => x == undefined;\n\n// Type Guard to determine if a given key is actually a key of some object of type T\nexport const isKeyOf = <T extends {} = any>(k: KeyTypes, o: Maybe<T>): k is keyof T => {\n if (isNil(o)) return false;\n return k in o;\n};\n\nconst toKebabCase = (string: string) => string.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);\n\nexport const toNativeAttrName = (propName: string, propValue: any): string | undefined => {\n if (typeof propValue === 'boolean' && !propValue) return undefined;\n if (isKeyOf(propName, ReactPropToAttrNameMap)) return ReactPropToAttrNameMap[propName];\n if (typeof propValue == undefined) return undefined;\n if (/[A-Z]/.test(propName)) return toKebabCase(propName);\n return propName;\n};\nexport const toStyleAttr = <T>(x: T) => x;\n\nexport const toNativeAttrValue = (propValue: any, propName: string) => {\n if (typeof propValue === 'boolean') return '';\n return propValue;\n};\n\nexport const toNativeProps = (props = {}) => {\n return Object.entries(props).reduce<{ [k: string]: string }>((transformedProps, [propName, propValue]) => {\n const attrName = toNativeAttrName(propName, propValue);\n\n // prop was stripped. Don't add.\n if (!attrName) {\n return transformedProps;\n }\n\n const attrValue = toNativeAttrValue(propValue, propName);\n transformedProps[attrName] = attrValue;\n return transformedProps;\n }, {});\n};\n", "import { useEffect, useRef } from 'react';\nimport type { MutableRefObject, ForwardedRef } from 'react';\n\ntype Maybe<T> = T | null | undefined;\ntype RefCb<T> = (instance: Maybe<T>) => void;\ntype RefObj<T> = MutableRefObject<Maybe<T>>;\ntype RefTypes<T> = RefObj<T> | RefCb<T> | ForwardedRef<T>;\ninterface useCombinedRefs {\n <T>(...refs: Maybe<RefTypes<T>>[]): RefObj<T>;\n}\n\nexport const useCombinedRefs: useCombinedRefs = (...refs) => {\n const targetRef = useRef(null);\n\n useEffect(() => {\n refs.forEach((ref) => {\n if (!ref) return;\n\n if (typeof ref === 'function') {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n });\n }, [refs]);\n\n return targetRef;\n};\n\n// TS assumed default export was interface def instead of function value (CJP)\nconst defaultUseCombinedRefs = useCombinedRefs;\nexport default defaultUseCombinedRefs;\n", "import { useEffect } from 'react';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Slightly modified version of React's shallowEqual, with optimizations for Arrays\n * so we may treat them specifically as unequal if they are not a) both arrays\n * or b) don't contain the same (shallowly compared) elements.\n */\nconst shallowEqual = (objA: any, objB: any): boolean => {\n if (Object.is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n if (Array.isArray(objA)) {\n // Early \"cheap\" array compares\n if (!Array.isArray(objB) || objA.length !== objB.length) return false;\n // Shallow compare for arrays\n return objA.some((vVal, i) => objB[i] === vVal);\n }\n\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (let i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const defaultHasChanged = (obj: any, v: any, k: string) => {\n return !shallowEqual(v, obj[k]);\n};\n\nconst defaultUpdateValue = (obj: any, v: any, k: string) => {\n obj[k] = v;\n};\n\nexport const useObjectPropEffect = <T extends { [k: string]: any }, V>(\n propName: string,\n propValue: V | null | undefined,\n ref: React.MutableRefObject<T | null> | null | undefined,\n updateValue = defaultUpdateValue,\n hasChanged = defaultHasChanged\n) => {\n return useEffect(() => {\n const obj = ref?.current;\n if (!obj) return;\n if (!hasChanged(obj, propValue, propName)) return;\n updateValue(obj, propValue, propName);\n }, [ref?.current, propValue]);\n};\n\nexport default useObjectPropEffect;\n", "const getEnvPlayerVersion = () => {\n try {\n // @ts-ignore\n return PLAYER_VERSION as string;\n } catch {}\n return 'UNKNOWN';\n};\n\nconst player_version: string = getEnvPlayerVersion();\n\nexport const getPlayerVersion = () => player_version;\n"],
5
+ "mappings": "AAAA,OAAOA,GAAS,aAAAC,OAAiB,QAGjC,OAAS,cAAAC,OAAkB,kBCC3B,IAAMC,EAAyB,CAC7B,UAAW,QACX,UAAW,QACX,QAAS,MACT,YAAa,cACb,QAAS,UACT,YAAa,cACb,SAAU,WACV,aAAc,cAChB,EAKaC,EAASC,GAAsCA,GAAK,KAGpDC,EAAU,CAAqBC,EAAaC,IACnDJ,EAAMI,CAAC,EAAU,GACdD,KAAKC,EAGRC,EAAeC,GAAmBA,EAAO,QAAQ,SAAWC,GAAU,IAAIA,EAAM,YAAY,GAAG,EAExFC,EAAmB,CAACC,EAAkBC,IAAuC,CACxF,GAAI,SAAOA,GAAc,WAAa,CAACA,GACvC,IAAIR,EAAQO,EAAUV,CAAsB,EAAG,OAAOA,EAAuBU,GAC7E,GAAI,OAAOC,GAAa,KACxB,MAAI,QAAQ,KAAKD,CAAQ,EAAUJ,EAAYI,CAAQ,EAChDA,EACT,EAGO,IAAME,EAAoB,CAACC,EAAgBC,IAC5C,OAAOD,GAAc,UAAkB,GACpCA,EAGIE,EAAgB,CAACC,EAA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AKqB,CAAM,EAC1CnB,EAAuB,UAAWF,EAAKsB,CAAS,EAChDpB,EAAuB,aAAcF,EAAKuB,CAAY,EACtDrB,EAAuB,QAASF,EAAKwB,CAAO,EAC5CtB,EAAuB,UAAWF,EAAKyB,CAAS,EAChDvB,EAAuB,SAAUF,EAAK0B,CAAQ,EAC9CxB,EAAuB,UAAWF,EAAK2B,CAAS,EAChDzB,EAAuB,UAAWF,EAAK4B,CAAS,EAChD1B,EAAuB,QAASF,EAAK6B,CAAO,EAC5C3B,EAAuB,QAASF,EAAK8B,CAAO,EAC5C5B,EAAuB,iBAAkBF,EAAK+B,CAAgB,EAC9D7B,EAAuB,kBAAmBF,EAAKgC,CAAiB,EAEzD,CAACO,CAAc,CACxB,EAEMO,GAAwBC,EAAiB,EACzCC,GAAqB,mBAErBC,GAAYpD,EAAM,WAGtB,CAACE,EAAOC,IAAQ,CAChB,IAAMkD,EAAiBC,GAAyB,IAAI,EAC9CC,EAAYC,EAAgBH,EAAgBlD,CAAG,EAC/C,CAACuC,CAAc,EAAIhC,GAAU2C,EAAgBnD,CAAK,EAExD,OACEF,EAAA,cAACD,GAAA,CAEC,IAAKwD,EACL,mBAAoBJ,GACpB,sBAAuBF,GACtB,GAAGP,EACN,CAEJ,CAAC,EAEMe,GAAQL",
6
+ "names": ["React", "useEffect", "MediaError", "ReactPropToAttrNameMap", "isNil", "x", "isKeyOf", "k", "o", "toKebabCase", "string", "match", "toNativeAttrName", "propName", "propValue", "toNativeAttrValue", "propValue", "propName", "toNativeProps", "props", "transformedProps", "attrName", "toNativeAttrName", "attrValue", "useRef", "useEffect", "useRef", "useCombinedRefs", "refs", "targetRef", "ref", "useEffect", "hasOwnProperty", "shallowEqual", "objA", "objB", "vVal", "keysA", "keysB", "i", "defaultHasChanged", "obj", "v", "k", "defaultUpdateValue", "useObjectPropEffect", "propName", "propValue", "ref", "updateValue", "hasChanged", "useObjectPropEffect_default", "getEnvPlayerVersion", "player_version", "getPlayerVersion", "MuxPlayerInternal", "React", "children", "props", "ref", "toNativeProps", "useEventCallbackEffect", "type", "callback", "useEffect", "eventTarget", "usePlayer", "onAbort", "onCanPlay", "onCanPlayThrough", "onEmptied", "onLoadStart", "onLoadedData", "onLoadedMetadata", "onProgress", "onDurationChange", "onVolumeChange", "onRateChange", "onResize", "onWaiting", "onPlay", "onPlaying", "onTimeUpdate", "onPause", "onSeeking", "onSeeked", "onStalled", "onSuspend", "onEnded", "onError", "onCuePointChange", "onCuePointsChange", "metadata", "tokens", "paused", "playbackId", "playbackRates", "currentTime", "remainingProps", "useObjectPropEffect_default", "playerEl", "pausedVal", "value", "propName", "defaultHasChanged", "playerSoftwareVersion", "getPlayerVersion", "playerSoftwareName", "MuxPlayer", "innerPlayerRef", "useRef", "playerRef", "useCombinedRefs", "src_default"]
7
7
  }
package/dist/lazy.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import o,{useEffect as h,useState as k}from"react";import i,{Suspense as y}from"react";var m=({condition:t,fallback:r,children:n,...e})=>t?i.createElement(y,{fallback:r,...e},n):i.createElement(i.Fragment,null,r),c=m;import{useState as f,useEffect as b}from"react";var x=()=>{let[t,r]=f(!1);return b(()=>{typeof window!="undefined"&&r(!0)},[]),t},p=x;import{useState as P,useEffect as I}from"react";var g=(t,r)=>{let[n,e]=P(!1);return I(()=>{if(typeof IntersectionObserver=="function"){let a=new IntersectionObserver(([s])=>{e(s.isIntersecting)},r);return t.current&&a.observe(t.current),()=>{a.disconnect()}}},[t,r]),n},u=g;var M=o.lazy(()=>import("./-SFWWK7I2.mjs")),v=t=>{let{style:r,className:n,onIntersection:e,placeholder:a}=t,s=o.useRef(null),l=u(s);return h(()=>{l&&e&&e()},[l,e]),o.createElement(o.Fragment,null,o.createElement("mux-player",{ref:s,"data-mux-player-react-lazy-placeholder":!0,placeholder:a,style:{"--mux-player-react-lazy-placeholder":a?`url(${a});`:"",...r},className:n||"",nohotkeys:!0,"aria-hidden":!0,tabIndex:-1},o.createElement("div",{"data-mux-player-react-lazy-placeholder-overlay":!0})),o.createElement("style",null,`
1
+ import o,{useEffect as h,useState as k}from"react";import i,{Suspense as y}from"react";var m=({condition:t,fallback:r,children:n,...e})=>t?i.createElement(y,{fallback:r,...e},n):i.createElement(i.Fragment,null,r),c=m;import{useState as f,useEffect as b}from"react";var x=()=>{let[t,r]=f(!1);return b(()=>{typeof window!="undefined"&&r(!0)},[]),t},p=x;import{useState as P,useEffect as I}from"react";var g=(t,r)=>{let[n,e]=P(!1);return I(()=>{if(typeof IntersectionObserver=="function"){let a=new IntersectionObserver(([s])=>{e(s.isIntersecting)},r);return t.current&&a.observe(t.current),()=>{a.disconnect()}}},[t,r]),n},u=g;var M=o.lazy(()=>import("./-26QNXQSL.mjs")),v=t=>{let{style:r,className:n,onIntersection:e,placeholder:a}=t,s=o.useRef(null),l=u(s);return h(()=>{l&&e&&e()},[l,e]),o.createElement(o.Fragment,null,o.createElement("mux-player",{ref:s,"data-mux-player-react-lazy-placeholder":!0,placeholder:a,style:{"--mux-player-react-lazy-placeholder":a?`url(${a});`:"",...r},className:n||"",nohotkeys:!0,"aria-hidden":!0,tabIndex:-1},o.createElement("div",{"data-mux-player-react-lazy-placeholder-overlay":!0})),o.createElement("style",null,`
2
2
  mux-player[data-mux-player-react-lazy-placeholder] {
3
3
  aspect-ratio: 16/9;
4
4
  display: block;
@@ -1 +1 @@
1
- {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/typescript/lib/lib.scripthost.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2019.full.d.ts","../../../node_modules/@types/react/global.d.ts","../../../node_modules/csstype/index.d.ts","../../../node_modules/@types/prop-types/index.d.ts","../../../node_modules/@types/scheduler/tracing.d.ts","../../../node_modules/@types/react/index.d.ts","../src/ConditionalSuspense.tsx","../src/env.ts","../../../node_modules/hls.js/dist/hls.js.d.ts","../../playback-core/dist/types/hls.d.ts","../../playback-core/dist/types/errors.d.ts","../../playback-core/dist/types/types.d.ts","../../playback-core/dist/types/tracks.d.ts","../../playback-core/dist/types/index.d.ts","../../../node_modules/media-chrome/dist/constants.d.ts","../../../node_modules/media-chrome/dist/labels/labels.d.ts","../../../node_modules/media-chrome/dist/utils/time.d.ts","../../../node_modules/media-chrome/dist/media-chrome-button.d.ts","../../../node_modules/media-chrome/dist/media-airplay-button.d.ts","../../../node_modules/media-chrome/dist/media-cast-button.d.ts","../../../node_modules/media-chrome/dist/media-gesture-receiver.d.ts","../../../node_modules/media-chrome/dist/media-container.d.ts","../../../node_modules/media-chrome/dist/utils/attribute-token-list.d.ts","../../../node_modules/media-chrome/dist/media-controller.d.ts","../../../node_modules/media-chrome/dist/media-chrome-range.d.ts","../../../node_modules/media-chrome/dist/media-control-bar.d.ts","../../../node_modules/media-chrome/dist/media-text-display.d.ts","../../../node_modules/media-chrome/dist/media-current-time-display.d.ts","../../../node_modules/media-chrome/dist/media-duration-display.d.ts","../../../node_modules/media-chrome/dist/media-time-display.d.ts","../../../node_modules/media-chrome/dist/media-captions-button.d.ts","../../../node_modules/media-chrome/dist/media-seek-forward-button.d.ts","../../../node_modules/media-chrome/dist/media-fullscreen-button.d.ts","../../../node_modules/media-chrome/dist/media-live-button.d.ts","../../../node_modules/media-chrome/dist/media-mute-button.d.ts","../../../node_modules/media-chrome/dist/media-pip-button.d.ts","../../../node_modules/media-chrome/dist/media-play-button.d.ts","../../../node_modules/media-chrome/dist/media-playback-rate-button.d.ts","../../../node_modules/media-chrome/dist/media-poster-image.d.ts","../../../node_modules/media-chrome/dist/media-time-range.d.ts","../../../node_modules/media-chrome/dist/media-progress-range.d.ts","../../../node_modules/media-chrome/dist/media-seek-backward-button.d.ts","../../../node_modules/media-chrome/dist/media-preview-time-display.d.ts","../../../node_modules/media-chrome/dist/media-preview-thumbnail.d.ts","../../../node_modules/media-chrome/dist/media-title-element.d.ts","../../../node_modules/media-chrome/dist/media-loading-indicator.d.ts","../../../node_modules/media-chrome/dist/media-volume-range.d.ts","../../../node_modules/media-chrome/dist/index.d.ts","../../../node_modules/media-chrome/dist/experimental/media-captions-menu-button.d.ts","../../mux-video/dist/types/CustomVideoElement.d.ts","../../mux-video/dist/types/index.d.ts","../../../shared/polyfills/index.d.ts","../../mux-player/dist/types/video-api.d.ts","../../mux-player/dist/types/helpers.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","../../../types/media-chrome.d.ts","../../../types/mux-embed.d.ts","../../../types/mux.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18",{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true},{"version":"f3d4da15233e593eacb3965cde7960f3fddf5878528d882bcedd5cbaba0193c7","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},"1f03b495671c3a1bd24510f38b8947f0991dfd6bf0278c68eca14af15b306e1f",{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"1c29793071152b207c01ea1954e343be9a44d85234447b2b236acae9e709a383","6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"facb3daa9cb4215070b5662409638ac826681c208d701e96efe9b731d0ec39ee","affectsGlobalScope":true},{"version":"6d3aae02e573b4424749a17ecde853c18195fd6f08297da64aa7fff2057bb7c9","signature":"1cf7f7233499f56ea5b399b0b53edfe0367fcb6caf5b235b873d9f3f9e5d6a16"},{"version":"a6b7e3c103b4424b9c9d6dce7f059c16bbf037844b9f418775b86506d3d141d4","signature":"91c076ae465392962257aca34e4bf13640363d6cca8e0636d5cda95c890951e9"},"889063bdda67270a139b95c1323d214cbf028b19bac7da09982be33e2927e8af","773d1148d4729e5b25d0bdb65552c2854378506fbb408424a5947dbfdfd8b789","8b1a6692156440f6585937b6b8de1c2692e7cac5c43aeb8893bfbd293f719552","8aaeacb98f7654b400ad7f807195b2f4147697d24a0298d5afa64f0d883feaab","bc87a0cdc972f4b11e138495209c7a076653f38ee00c51f82738859510c46539","9363a7d0740e53f6da3c903c7c171dcfc890d85c9b475ee9acddb9519c5e7db2","50ab1a9a5d106d3d0d3fe2d29607089fdb686cf42a5127a3fe9dee362fcee1c3","1bca2772bfe6da518ab061f96c01d7d71485b9afe80ea04048d468b6f081889c","f42c69e41a1c031b1bb2339d2bd05de3164ab8562cfbd9162d5b7a7cccb98ea8","d11911d6ffb045581d9a42a3dc362310506a2211fd6731992e1efa94bfd55106","68e358046b225cf675744ecbfdefcc6dee118a773b408105d46dcf61142b1e50","79e04a665d69d0edbf243a4356efc1801c039bdac192adf7626c385f0289e7a1","bd2b2593c4903b3cd56c6b275e4d0b9d77373e027f92692a8a12ad60bd57ef66","ba09a10e145c8858d8b1ad040445e7a6e1145b77a4214b908e52c3db0ca15b84","ca5baab21182653233a6cb221476f7eacc3c4565d5e72ddc3e6b0310756a0bce","b785c94ae98cc12ab1aa7491ad7b3b607f142c15c5cc703e742a531c7a8832c9","b2c3bd6183d4d4dd331e2d1931df945edfafc74070107246dfad63e0936bbbf5","4eaf0a9c07db8027b3152ec4630bde92d9c4f79fd9368fc275ccc18a0f95c45a","e57981f45d914f2408da70a1466c714427059d2332bee02e3e42b93ffba1b45a","c336aa56ac18350ce9734a69610d02822eeeb2194c790c5fc09f85277383badd","7cc95cca975581a368480357dfc672ce8022a55d8be7cb93b7a43a112d8ee325","0f4b05ff0ab1fd751987cd35be61421da42578a84f9b3fe4a2252489c35efecd","416710f3b46d2a66fbaa6e76275cfd282c5794c073f892f925f062725c6f2a3a","175c1dcc31e458ed13d1655e2773e8c1a5345fda1d2993f8c09201490dd95054","49e54658266510cc6f5daf9ba6d0bec1f53e3031556fcd06973352eb319f9800","5a8252ff93354daf68494b767b131d9285cc7ff301a92085d34a4b539db6b96a","f01ae56812a493de0399df3c895a4214cfb79fce77b065729036beae1528f172","24e7c377150337f5db7c632f4bd41a483170d19c6476c9be6c77a7b53457cee1","778d1a9159f08ad0921b481f7d08d180f98c6f5733a6b7407ad22a24763a686b","f8717ae243f0805094acb6c03e658d335246e9d24e75f9f008f3ba164ed42dd9","b9ab77378dd701c92c9fa2a2496bb11ffa6fef070880b96a53058289ec8a310e","3387c30139c0be6d192983013c9fcabaf376e35ae1db6b0f2791234ef070f120","1796aacfb419bfc66657829643ee172d9f9de5dd1096584fb004c66b878f9947","0414571c06823f212a1aa34156e6889294d80c2dc788544648e3f4949f171a93","61c0a0dccdbcfeefa5c9d6a0d9e6732b58c45f7c165e9dd89966b21e33bd1be1","fad65da820bc5accd5a7f4b3c392f7e7d230f5fa379fe2139cbe531bca84b2ae","067aa0bdd09718bff596d4c1b0d47bd18433044939e043d781d0b700ed15513f","c3cd574d0de12f6ffa04aa6c2190ad264497ad538ab6d1241fc4481939d62795","661a04ad362b9833789c5b36613372e4c67475bb8c4af82abfb65d09d9a3d7ab","8b9619f578efca4ea26225b57671d2998e49c830f0f99500730f91201c496310","bf73a11f18d80e23e1407b535544cdb7e70f29046afdcb6e406326fc3851225a","76f80c5148923283518d43aaf7d7a899936c99b725f40f44762b1faab876996d",{"version":"906ed2a8174c83d062f381bb59c73fdd378b2631b2299673c83b24f0cb2421ec","affectsGlobalScope":true},"9c0eebd3a0506c79c428ca5c9c7abd895645879bca18ca793d9d367518dbff31","a703a5b199e9acea8d6aef6017698ea8c8065484c2d045b598eec00290c1d142","82c4c00ae056027242067a331982141ff2ba0f9a7d9faaf6abac0774fc5c9c68","d7d414233ca5240f7d5a20b9d168b23d988eba386f9c417d54ebabfe3d0cf145",{"version":"498d6a91f4bbfbd412e928a5fd6306d98a8b8b49c334b3ef1b1dccd8ec327e2f","signature":"d84a480259a7bda3cd794ab264e29fda120eb72c8c9270396a584479bf5b827f"},{"version":"f21932f853b3dbd3949e14c7d31d2dcfba3418c5de50878884a54cf0ba14e904","signature":"014089c3590328e311f0651db51765945a630df49cccfaf71c884d53bafd70d2"},{"version":"721526438283d40d50c6356064d346f1c57693f7e9930a3854c20c73bf4380a5","signature":"066053c842a2d9edb616d9c88dab6b19eaf8f4630bf862c774d0d6cc98c62a91"},{"version":"690bb9d6d0e6be0c884c207abbe76e8e34224c0579968532c83f9fcac91c58ff","signature":"15aca2f4ca94301dba6f14aa9636fedeb82e10c09b8a9e15fb411e7e2e352e81"},{"version":"c7e2e472d0ba77ba41adc2422d0fb7e3eeada664eda67fbf2d1820cf6f9d49d5","signature":"d8697925fd69925c68732d55ed14c69c38bd4435b91355e974797c6f11685ee5"},{"version":"3afe879128eb0bc263123450b8211b56d7afba72c95e820cb51224fe661546b1","signature":"536ccb1a38a39569293fde322adb7b936d9a8bf81984d675bbba6e57c6569ca9"},{"version":"1989109e17e2c0b521786c4a779fda6f9c1822264dd2801dc8174e05fc4f44b8","signature":"cf2bfc61f95f88b985c4b88124a3b50d90c92e7cb4fa90d839c29821213ee90e","affectsGlobalScope":true},"3cf4c7825a6c0ef1965e8906b85844aafdcdda9d95c8b4bcfcb3a20811cfd0b1","c5a4764697efe3b6b4eaf19b3dc1880cf3df665d30ec93e212233c29a2fa7207",{"version":"a092979673af6906d766c907c9bf0ae97c7bed1f0d9e69d870ce4d4505a51edd","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"emitDeclarationOnly":true,"esModuleInterop":true,"jsx":2,"module":6,"noImplicitAny":true,"outDir":"./types","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":6},"fileIdsList":[[37,38,39,40],[50,51,52,53,54,55,56,59,60,61,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82],[53],[57,58],[62],[75],[60],[41],[41,43,49,90,91,92,93],[41,42,49,94,95,96],[49,84,86,88,89,98],[86,87],[49,85],[44],[44,45,46,47,48,99],[45,47],[45,99],[41,49,90],[41,49,90,94]],"referencedMap":[[41,1],[83,2],[54,3],[66,3],[55,3],[59,4],[63,5],[64,5],[68,3],[69,3],[70,3],[71,3],[72,3],[73,3],[78,5],[76,6],[77,3],[67,3],[65,5],[75,7],[82,7],[42,8],[94,9],[97,10],[92,8],[95,8],[96,8],[93,8],[90,11],[88,12],[86,13],[45,14],[49,15],[48,16],[47,17],[100,14]],"exportedModulesMap":[[41,1],[83,2],[54,3],[66,3],[55,3],[59,4],[63,5],[64,5],[68,3],[69,3],[70,3],[71,3],[72,3],[73,3],[78,5],[76,6],[77,3],[67,3],[65,5],[75,7],[82,7],[42,8],[94,18],[97,19],[92,8],[93,8],[90,11],[88,12],[86,13],[45,14],[49,15],[48,16],[47,17],[100,14]],"semanticDiagnosticsPerFile":[39,37,41,40,38,44,50,84,83,51,54,66,55,53,60,57,61,59,63,64,68,56,69,81,70,71,72,73,74,79,78,76,77,67,62,65,75,80,82,58,52,7,8,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,36,35,32,33,34,1,10,9,42,91,43,94,97,92,95,96,93,89,90,88,85,86,46,45,49,48,47,87,98,99,100],"latestChangedDtsFile":"./types/lazy.d.ts"},"version":"4.9.4"}
1
+ {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/typescript/lib/lib.scripthost.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2019.full.d.ts","../../../node_modules/@types/react/global.d.ts","../../../node_modules/csstype/index.d.ts","../../../node_modules/@types/prop-types/index.d.ts","../../../node_modules/@types/scheduler/tracing.d.ts","../../../node_modules/@types/react/index.d.ts","../src/ConditionalSuspense.tsx","../src/env.ts","../../../node_modules/hls.js/dist/hls.js.d.ts","../../playback-core/dist/types/mux-embed.d.ts","../../playback-core/dist/types/hls.d.ts","../../playback-core/dist/types/errors.d.ts","../../playback-core/dist/types/types.d.ts","../../playback-core/dist/types/tracks.d.ts","../../playback-core/dist/types/index.d.ts","../../../node_modules/media-chrome/dist/constants.d.ts","../../../node_modules/media-chrome/dist/labels/labels.d.ts","../../../node_modules/media-chrome/dist/utils/time.d.ts","../../../node_modules/media-chrome/dist/media-chrome-button.d.ts","../../../node_modules/media-chrome/dist/media-airplay-button.d.ts","../../../node_modules/media-chrome/dist/media-cast-button.d.ts","../../../node_modules/media-chrome/dist/media-gesture-receiver.d.ts","../../../node_modules/media-chrome/dist/media-container.d.ts","../../../node_modules/media-chrome/dist/utils/attribute-token-list.d.ts","../../../node_modules/media-chrome/dist/media-controller.d.ts","../../../node_modules/media-chrome/dist/media-chrome-range.d.ts","../../../node_modules/media-chrome/dist/media-control-bar.d.ts","../../../node_modules/media-chrome/dist/media-text-display.d.ts","../../../node_modules/media-chrome/dist/media-current-time-display.d.ts","../../../node_modules/media-chrome/dist/media-duration-display.d.ts","../../../node_modules/media-chrome/dist/media-time-display.d.ts","../../../node_modules/media-chrome/dist/media-captions-button.d.ts","../../../node_modules/media-chrome/dist/media-seek-forward-button.d.ts","../../../node_modules/media-chrome/dist/media-fullscreen-button.d.ts","../../../node_modules/media-chrome/dist/media-live-button.d.ts","../../../node_modules/media-chrome/dist/media-mute-button.d.ts","../../../node_modules/media-chrome/dist/media-pip-button.d.ts","../../../node_modules/media-chrome/dist/media-play-button.d.ts","../../../node_modules/media-chrome/dist/media-playback-rate-button.d.ts","../../../node_modules/media-chrome/dist/media-poster-image.d.ts","../../../node_modules/media-chrome/dist/media-time-range.d.ts","../../../node_modules/media-chrome/dist/media-progress-range.d.ts","../../../node_modules/media-chrome/dist/media-seek-backward-button.d.ts","../../../node_modules/media-chrome/dist/media-preview-time-display.d.ts","../../../node_modules/media-chrome/dist/media-preview-thumbnail.d.ts","../../../node_modules/media-chrome/dist/media-title-element.d.ts","../../../node_modules/media-chrome/dist/media-loading-indicator.d.ts","../../../node_modules/media-chrome/dist/media-volume-range.d.ts","../../../node_modules/media-chrome/dist/index.d.ts","../../../node_modules/media-chrome/dist/experimental/media-chrome-selectmenu.d.ts","../../../node_modules/media-chrome/dist/experimental/media-captions-selectmenu.d.ts","../../mux-video/dist/types/CustomVideoElement.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","../../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"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18",{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true},{"version":"f3d4da15233e593eacb3965cde7960f3fddf5878528d882bcedd5cbaba0193c7","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},"1f03b495671c3a1bd24510f38b8947f0991dfd6bf0278c68eca14af15b306e1f",{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"1c29793071152b207c01ea1954e343be9a44d85234447b2b236acae9e709a383","6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"facb3daa9cb4215070b5662409638ac826681c208d701e96efe9b731d0ec39ee","affectsGlobalScope":true},{"version":"6d3aae02e573b4424749a17ecde853c18195fd6f08297da64aa7fff2057bb7c9","signature":"1cf7f7233499f56ea5b399b0b53edfe0367fcb6caf5b235b873d9f3f9e5d6a16"},{"version":"a6b7e3c103b4424b9c9d6dce7f059c16bbf037844b9f418775b86506d3d141d4","signature":"91c076ae465392962257aca34e4bf13640363d6cca8e0636d5cda95c890951e9"},"a621252aa9fa2527cd9b9d544d728ee31043d556339a99e269ed32368523ef7e",{"version":"6ff45ab1a5c3f32638dd1131cc94ecd68f11566363ea16dca3c8a7d556a81bbb","affectsGlobalScope":true},"773d1148d4729e5b25d0bdb65552c2854378506fbb408424a5947dbfdfd8b789","de64daa4e510abaaf4b4970c6dd37e39c3b8a263cccbeb80a41c69ae5a2a34ba","9c7d1dad5c9c395839ca54ca11db0717c30a9907bdd1209af409080eae22bf7b","bc87a0cdc972f4b11e138495209c7a076653f38ee00c51f82738859510c46539","d7c5d82ba0573dc9b39a819c350a15f7269c0b393b2161770f38f0e77c240288","497c87d8c813be59945a9e7b2a15bad7949e53ec20d1a7baa63cfb2406e235fa","1bca2772bfe6da518ab061f96c01d7d71485b9afe80ea04048d468b6f081889c","f42c69e41a1c031b1bb2339d2bd05de3164ab8562cfbd9162d5b7a7cccb98ea8","fafb38b956eca800afa3ea73eb300b1aaebfd43a75c2fd04d63fb2b82b276320","68e358046b225cf675744ecbfdefcc6dee118a773b408105d46dcf61142b1e50","79e04a665d69d0edbf243a4356efc1801c039bdac192adf7626c385f0289e7a1","20cac294891937096696114350b93757abc058c9d4ceea190ea2c1ba6feb77b7","45d4b72312fabc1ebb56aa01579f22cd6187de6d15c08ae8a3bd6b8f7329381d","ca5baab21182653233a6cb221476f7eacc3c4565d5e72ddc3e6b0310756a0bce","eeb4d3386b64d1587ead5e911dca6779bc596063a9a2d28de7d4be6c0c6e6e28","b2c3bd6183d4d4dd331e2d1931df945edfafc74070107246dfad63e0936bbbf5","aaf536e0839ecd949bbd4f7094226e02b568b9dbc26afe5c69cc23ef511da0d2","3481924cd34243ff7ebfe4c8f6f6c0ec89447617b1606ee21496784d78a28ed6","5641d20d7a4e161e42aba4c0463512e0a2eee026123f4b270b28de71d1961cad","e5be73f1092140ae199020bfb7b33d5093269a71535c941ce9014080911c426a","5f46492772bb5d45ff17e2010ec6e3dc0dae0974cd159763180cd11c9ab510b5","416710f3b46d2a66fbaa6e76275cfd282c5794c073f892f925f062725c6f2a3a","175c1dcc31e458ed13d1655e2773e8c1a5345fda1d2993f8c09201490dd95054","49e54658266510cc6f5daf9ba6d0bec1f53e3031556fcd06973352eb319f9800","5a8252ff93354daf68494b767b131d9285cc7ff301a92085d34a4b539db6b96a","f01ae56812a493de0399df3c895a4214cfb79fce77b065729036beae1528f172","24e7c377150337f5db7c632f4bd41a483170d19c6476c9be6c77a7b53457cee1","778d1a9159f08ad0921b481f7d08d180f98c6f5733a6b7407ad22a24763a686b","f8717ae243f0805094acb6c03e658d335246e9d24e75f9f008f3ba164ed42dd9","b9ab77378dd701c92c9fa2a2496bb11ffa6fef070880b96a53058289ec8a310e","3387c30139c0be6d192983013c9fcabaf376e35ae1db6b0f2791234ef070f120","1796aacfb419bfc66657829643ee172d9f9de5dd1096584fb004c66b878f9947","0414571c06823f212a1aa34156e6889294d80c2dc788544648e3f4949f171a93","8f0bcdac0c51ecbb05e0e9c97d3c63a7eb415ef9ae36937ebba4a8d4f08cfd2b","c71429de89a9009c8ab818a5e75f1ac354aa0bf0b194d89ae0ac24977c75bfb1","067aa0bdd09718bff596d4c1b0d47bd18433044939e043d781d0b700ed15513f","2f706043337de8263f44f20f75b04144db12faed25966ff02e4ab48b58d32c99","661a04ad362b9833789c5b36613372e4c67475bb8c4af82abfb65d09d9a3d7ab","8b9619f578efca4ea26225b57671d2998e49c830f0f99500730f91201c496310","4ebf326143effdcc0e07460f3497bde23ca5adefef47f8502ac8d84d411c3b60","2e0c6a0fab4c554961b58dc9a93d20a0167f3340ff111da77f1928e1f29f0cc8","76f80c5148923283518d43aaf7d7a899936c99b725f40f44762b1faab876996d",{"version":"53fe971bf92ab10e82523d53c37111aa1f19a77df393e693f751b13d7aa45d8f","affectsGlobalScope":true},"2f39ccc3f2cad7f2a1e0ad14a744877ed08dae4ae75510109ac981ceb783b566","ff0b943978c6a9952a4c64928b0383814cc21b363dc5e37f169af36423f919f7","82c4c00ae056027242067a331982141ff2ba0f9a7d9faaf6abac0774fc5c9c68","ca6e6e8571354dc29372540c6bd83d1461275b02f104427172cdbe17a7ba6416",{"version":"498d6a91f4bbfbd412e928a5fd6306d98a8b8b49c334b3ef1b1dccd8ec327e2f","signature":"d84a480259a7bda3cd794ab264e29fda120eb72c8c9270396a584479bf5b827f"},{"version":"f21932f853b3dbd3949e14c7d31d2dcfba3418c5de50878884a54cf0ba14e904","signature":"014089c3590328e311f0651db51765945a630df49cccfaf71c884d53bafd70d2"},{"version":"721526438283d40d50c6356064d346f1c57693f7e9930a3854c20c73bf4380a5","signature":"066053c842a2d9edb616d9c88dab6b19eaf8f4630bf862c774d0d6cc98c62a91"},{"version":"7f5c42c5fbfb62f8182b64e43d263364cfac8b0be83c5cd164e963ced9cd6567","signature":"ca45a70e66ff4cf9ddc7e77b3778cb100285976070664c1b3db13fd724e15ef8"},{"version":"c7e2e472d0ba77ba41adc2422d0fb7e3eeada664eda67fbf2d1820cf6f9d49d5","signature":"d8697925fd69925c68732d55ed14c69c38bd4435b91355e974797c6f11685ee5"},{"version":"3afe879128eb0bc263123450b8211b56d7afba72c95e820cb51224fe661546b1","signature":"536ccb1a38a39569293fde322adb7b936d9a8bf81984d675bbba6e57c6569ca9"},{"version":"1989109e17e2c0b521786c4a779fda6f9c1822264dd2801dc8174e05fc4f44b8","signature":"cf2bfc61f95f88b985c4b88124a3b50d90c92e7cb4fa90d839c29821213ee90e","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"emitDeclarationOnly":true,"esModuleInterop":true,"jsx":2,"module":6,"noImplicitAny":true,"outDir":"./types","rootDir":"../src","skipLibCheck":false,"sourceMap":true,"strict":true,"target":6},"fileIdsList":[[37,38,39,40],[85],[51,52,53,54,55,56,57,60,61,62,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83],[54],[58,59],[63],[76],[61],[41],[41,43,50,92,93,94,95],[41,42,50,96,97,98],[50,84,86,88,90,91],[88,89],[50,87],[44],[44,45,46,47,48,49],[46,48],[45,46,47],[41,50,92],[41,50,92,96]],"referencedMap":[[41,1],[86,2],[84,3],[55,4],[67,4],[56,4],[60,5],[64,6],[65,6],[69,4],[70,4],[71,4],[72,4],[73,4],[74,4],[79,6],[77,7],[78,4],[68,4],[66,6],[76,8],[83,8],[42,9],[96,10],[99,11],[94,9],[97,9],[98,9],[95,9],[92,12],[90,13],[88,14],[46,15],[50,16],[45,15],[49,17],[48,18]],"exportedModulesMap":[[41,1],[86,2],[84,3],[55,4],[67,4],[56,4],[60,5],[64,6],[65,6],[69,4],[70,4],[71,4],[72,4],[73,4],[74,4],[79,6],[77,7],[78,4],[68,4],[66,6],[76,8],[83,8],[42,9],[96,19],[99,20],[94,9],[95,9],[92,12],[90,13],[88,14],[46,15],[50,16],[45,15],[49,17],[48,18]],"semanticDiagnosticsPerFile":[39,37,41,40,38,44,51,86,85,84,52,55,67,56,54,61,58,62,60,64,65,69,57,70,82,71,72,73,74,75,80,79,77,78,68,63,66,76,81,83,59,53,7,8,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,36,35,32,33,34,1,10,9,42,93,43,96,99,94,97,98,95,91,92,89,90,87,88,47,46,50,45,49,48],"latestChangedDtsFile":"./types/lazy.d.ts"},"version":"4.9.4"}
@@ -3,7 +3,7 @@ import type { CSSProperties } from 'react';
3
3
  import type { StreamTypes, PlaybackTypes, CmcdTypes } from '@mux/playback-core';
4
4
  import { MediaError } from '@mux/mux-player';
5
5
  import type MuxPlayerElement from '@mux/mux-player';
6
- import type { Tokens } from '@mux/mux-player';
6
+ import type { Tokens, MuxPlayerElementEventMap } from '@mux/mux-player';
7
7
  export { MediaError };
8
8
  type ValueOf<T> = T[keyof T];
9
9
  interface GenericEventListener<T extends Event = CustomEvent> {
@@ -43,8 +43,6 @@ type MuxMediaPropTypes = {
43
43
  preferCmcd: ValueOf<CmcdTypes> | undefined;
44
44
  children: never[];
45
45
  };
46
- interface MuxPlayerElementEventMap extends HTMLVideoElementEventMap {
47
- }
48
46
  export type MuxPlayerProps = {
49
47
  className?: string;
50
48
  hotkeys?: string;
@@ -66,6 +64,7 @@ export type MuxPlayerProps = {
66
64
  thumbnailTime?: number;
67
65
  title?: string;
68
66
  tokens?: Tokens;
67
+ theme?: string;
69
68
  onAbort?: GenericEventListener<MuxPlayerElementEventMap['abort']>;
70
69
  onCanPlay?: GenericEventListener<MuxPlayerElementEventMap['canplay']>;
71
70
  onCanPlayThrough?: GenericEventListener<MuxPlayerElementEventMap['canplaythrough']>;
@@ -89,6 +88,8 @@ export type MuxPlayerProps = {
89
88
  onSuspend?: GenericEventListener<MuxPlayerElementEventMap['suspend']>;
90
89
  onEnded?: GenericEventListener<MuxPlayerElementEventMap['ended']>;
91
90
  onError?: GenericEventListener<MuxPlayerElementEventMap['error']>;
91
+ onCuePointChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointchange']>;
92
+ onCuePointsChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointschange']>;
92
93
  } & Partial<MuxMediaPropTypes> & Partial<VideoApiAttributes>;
93
- declare const MuxPlayer: React.ForwardRefExoticComponent<Omit<MuxPlayerProps, "playerSoftwareVersion" | "playerSoftwareName"> & React.RefAttributes<MuxPlayerElement>>;
94
+ declare const MuxPlayer: React.ForwardRefExoticComponent<Omit<MuxPlayerProps, "playerSoftwareName" | "playerSoftwareVersion"> & React.RefAttributes<MuxPlayerElement>>;
94
95
  export default MuxPlayer;
@@ -3,7 +3,7 @@ import { CSSProperties } from 'react';
3
3
  import { StreamTypes, PlaybackTypes, CmcdTypes } from '@mux/playback-core';
4
4
  import { MediaError } from '@mux/mux-player';
5
5
  import MuxPlayerElement from '@mux/mux-player';
6
- import { Tokens } from '@mux/mux-player';
6
+ import { Tokens, MuxPlayerElementEventMap } from '@mux/mux-player';
7
7
  export { MediaError };
8
8
  type ValueOf<T> = T[keyof T];
9
9
  interface GenericEventListener<T extends Event = CustomEvent> {
@@ -43,8 +43,6 @@ type MuxMediaPropTypes = {
43
43
  preferCmcd: ValueOf<CmcdTypes> | undefined;
44
44
  children: never[];
45
45
  };
46
- interface MuxPlayerElementEventMap extends HTMLVideoElementEventMap {
47
- }
48
46
  export type MuxPlayerProps = {
49
47
  className?: string;
50
48
  hotkeys?: string;
@@ -66,6 +64,7 @@ export type MuxPlayerProps = {
66
64
  thumbnailTime?: number;
67
65
  title?: string;
68
66
  tokens?: Tokens;
67
+ theme?: string;
69
68
  onAbort?: GenericEventListener<MuxPlayerElementEventMap['abort']>;
70
69
  onCanPlay?: GenericEventListener<MuxPlayerElementEventMap['canplay']>;
71
70
  onCanPlayThrough?: GenericEventListener<MuxPlayerElementEventMap['canplaythrough']>;
@@ -89,6 +88,8 @@ export type MuxPlayerProps = {
89
88
  onSuspend?: GenericEventListener<MuxPlayerElementEventMap['suspend']>;
90
89
  onEnded?: GenericEventListener<MuxPlayerElementEventMap['ended']>;
91
90
  onError?: GenericEventListener<MuxPlayerElementEventMap['error']>;
91
+ onCuePointChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointchange']>;
92
+ onCuePointsChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointschange']>;
92
93
  } & Partial<MuxMediaPropTypes> & Partial<VideoApiAttributes>;
93
- declare const MuxPlayer: React.ForwardRefExoticComponent<Pick<MuxPlayerProps, Exclude<keyof MuxPlayerProps, "playerSoftwareVersion" | "playerSoftwareName">> & React.RefAttributes<MuxPlayerElement>>;
94
+ declare const MuxPlayer: React.ForwardRefExoticComponent<Pick<MuxPlayerProps, Exclude<keyof MuxPlayerProps, "playerSoftwareName" | "playerSoftwareVersion">> & React.RefAttributes<MuxPlayerElement>>;
94
95
  export default MuxPlayer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mux/mux-player-react",
3
- "version": "1.8.0",
3
+ "version": "1.9.0-canary.0-4e45cc0",
4
4
  "description": "An open source Mux player for React that Just Works™",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.mjs",
@@ -45,7 +45,7 @@
45
45
  "build:esm": "esbuild src/index.tsx --target=es2019 --bundle --sourcemap --metafile=./dist/esm.json --format=esm --loader:.css=text --outdir=dist --out-extension:.js=.mjs --external:react --external:@mux/* --external:prop-types --define:PLAYER_VERSION=\"'$npm_package_version'\"",
46
46
  "build:cjs:lazy": "echo 'esbuild cjs does not support code-splitting. See https://esbuild.github.io/api/#splitting for details'",
47
47
  "build:esm:lazy": "esbuild src/lazy.tsx --splitting --target=es2019 --bundle --sourcemap --metafile=./dist/esm.lazy.json --format=esm --loader:.css=text --outdir=dist --out-extension:.js=.mjs --external:react --external:@mux/* --external:prop-types --define:PLAYER_VERSION=\"'$npm_package_version'\"",
48
- "build:types": "tsc --declaration --emitDeclarationOnly --outDir './dist/types'",
48
+ "build:types": "tsc",
49
49
  "postbuild:types": "downlevel-dts ./dist/types ./dist/types-ts3.4",
50
50
  "build": "npm-run-all --parallel 'build:cjs --minify' 'build:esm --minify' 'build:esm:lazy --minify'",
51
51
  "create-release-notes": "create-release-notes ./CHANGELOG.md",
@@ -65,8 +65,8 @@
65
65
  }
66
66
  },
67
67
  "dependencies": {
68
- "@mux/mux-player": "1.8.0",
69
- "@mux/playback-core": "0.17.0",
68
+ "@mux/mux-player": "1.9.0-canary.0-4e45cc0",
69
+ "@mux/playback-core": "0.9.1-canary.215-4e45cc0",
70
70
  "prop-types": "^15.7.2"
71
71
  },
72
72
  "devDependencies": {
@@ -79,6 +79,5 @@
79
79
  "react-dom": "^17.0.2",
80
80
  "shx": "^0.3.4",
81
81
  "typescript": "^4.9.4"
82
- },
83
- "gitHead": "160a96c1148556b313badef849539f873260a358"
82
+ }
84
83
  }
package/LICENSE DELETED
@@ -1,9 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 Mux, Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,2 +0,0 @@
1
- import y,{useEffect as ae}from"react";import{MediaError as ge}from"@mux/mux-player";var c={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},F=e=>e==null,W=(e,t)=>F(t)?!1:e in t,Z=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),_=(e,t)=>{if(!(typeof t=="boolean"&&!t)){if(W(e,c))return c[e];if(typeof t!=null)return/[A-Z]/.test(e)?Z(e):e}};var q=(e,t)=>typeof e=="boolean"?"":e,m=(e={})=>Object.entries(e).reduce((t,[n,o])=>{let r=_(n,o);if(!r)return t;let i=q(o,n);return t[r]=i,t},{});import{useRef as re}from"react";import{useEffect as J,useRef as Y}from"react";var E=(...e)=>{let t=Y(null);return J(()=>{e.forEach(n=>{!n||(typeof n=="function"?n(t.current):n.current=t.current)})},[e]),t};import{useEffect as $}from"react";var Q=Object.prototype.hasOwnProperty,X=(e,t)=>{if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.some((r,i)=>t[i]===r);let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let r=0;r<n.length;r++)if(!Q.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0},p=(e,t,n)=>!X(t,e[n]),B=(e,t,n)=>{e[n]=t},ee=(e,t,n,o=B,r=p)=>$(()=>{let i=n==null?void 0:n.current;!i||!r(i,t,e)||o(i,t,e)},[n==null?void 0:n.current,t]),s=ee;var te=()=>{try{return"1.8.0"}catch{}return"UNKNOWN"},ne=te(),f=()=>ne;var oe=y.forwardRef(({children:e,...t},n)=>y.createElement("mux-player",m({...t,ref:n}),e)),a=(e,t,n)=>ae(()=>{let o=t==null?void 0:t.current;if(!(!o||!n))return o.addEventListener(e,n),()=>{o.removeEventListener(e,n)}},[t==null?void 0:t.current,n]),ie=(e,t)=>{let{onAbort:n,onCanPlay:o,onCanPlayThrough:r,onEmptied:i,onLoadStart:M,onLoadedData:g,onLoadedMetadata:P,onProgress:b,onDurationChange:v,onVolumeChange:x,onRateChange:T,onResize:R,onWaiting:h,onPlay:k,onPlaying:L,onTimeUpdate:C,onPause:O,onSeeking:S,onSeeked:w,onStalled:G,onSuspend:V,onEnded:A,onError:N,metadata:I,tokens:K,paused:D,playbackId:U,playbackRates:H,currentTime:d,...j}=t;return s("playbackRates",H,e),s("metadata",I,e),s("tokens",K,e),s("playbackId",U,e),s("paused",D,e,(l,u)=>{u!=null&&(u?l.pause():l.play())},(l,u,z)=>l.hasAttribute("autoplay")&&!l.hasPlayed?!1:p(l,u,z)),s("currentTime",d!=null?d:0,e),a("abort",e,n),a("canplay",e,o),a("canplaythrough",e,r),a("emptied",e,i),a("loadstart",e,M),a("loadeddata",e,g),a("loadedmetadata",e,P),a("progress",e,b),a("durationchange",e,v),a("volumechange",e,x),a("ratechange",e,T),a("resize",e,R),a("waiting",e,h),a("play",e,k),a("playing",e,L),a("timeupdate",e,C),a("pause",e,O),a("seeking",e,S),a("seeked",e,w),a("stalled",e,G),a("suspend",e,V),a("ended",e,A),a("error",e,N),[j]},se=f(),le="mux-player-react",ue=y.forwardRef((e,t)=>{let n=re(null),o=E(n,t),[r]=ie(n,e);return y.createElement(oe,{ref:o,playerSoftwareName:le,playerSoftwareVersion:se,...r})}),Re=ue;export{ge as MediaError,Re as default};
2
- //# sourceMappingURL=-SFWWK7I2.mjs.map