@mux/mux-player-react 0.1.0-canary.91-fed1f32 → 0.1.0-canary.92-2f59d4e
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/CHANGELOG.md +174 -0
- package/README.md +25 -2
- package/dist/-MDMZGERP.mjs +2 -0
- package/dist/-MDMZGERP.mjs.map +7 -0
- package/dist/cjs.json +7 -7
- package/dist/esm.json +8 -8
- package/dist/esm.lazy.json +141 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +3 -3
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +3 -3
- package/dist/lazy.mjs +21 -0
- package/dist/lazy.mjs.map +7 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/ConditionalSuspense.d.ts +8 -0
- package/dist/types/common/utils.d.ts +3 -2
- package/dist/types/index.d.ts +22 -12
- package/dist/types/lazy.d.ts +24 -0
- package/dist/types/useCombinedRefs.d.ts +4 -4
- package/dist/types/useIsBrowser.d.ts +2 -0
- package/dist/types/useIsIntersecting.d.ts +2 -0
- package/dist/types-ts3.4/ConditionalSuspense.d.ts +8 -0
- package/dist/types-ts3.4/common/utils.d.ts +3 -2
- package/dist/types-ts3.4/index.d.ts +22 -12
- package/dist/types-ts3.4/lazy.d.ts +24 -0
- package/dist/types-ts3.4/useCombinedRefs.d.ts +4 -4
- package/dist/types-ts3.4/useIsBrowser.d.ts +2 -0
- package/dist/types-ts3.4/useIsIntersecting.d.ts +2 -0
- package/package.json +26 -17
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,180 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.10.0](https://github.com/muxinc/elements/compare/@mux/mux-player-react@1.9.0...@mux/mux-player-react@1.10.0) (2023-04-14)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **mux-player-react:** Don't "reset" currentTime to 0 unintentionally. ([#663](https://github.com/muxinc/elements/issues/663)) ([6ea8aed](https://github.com/muxinc/elements/commit/6ea8aedbe8e62a33bd8de630eddaadf823a738a6))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* inferred stream type ([#592](https://github.com/muxinc/elements/issues/592)) ([db4cc9f](https://github.com/muxinc/elements/commit/db4cc9f60660f2b860ecce0a5a5ef2a3a09cc40b))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [1.9.0](https://github.com/muxinc/elements/compare/@mux/mux-player-react@1.8.0...@mux/mux-player-react@1.9.0) (2023-03-31)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* update typedefs, disable skipLibChecks in tsconfig ([#601](https://github.com/muxinc/elements/issues/601)) ([1664aec](https://github.com/muxinc/elements/commit/1664aec20e4cf4a59779848b298d4504eef24080))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
|
|
32
|
+
* add way to set and render MC themes ([#561](https://github.com/muxinc/elements/issues/561)) ([0ac98e9](https://github.com/muxinc/elements/commit/0ac98e9a6fd60c5ea990be3c7d5d8ae7941e447c))
|
|
33
|
+
* **mux-player-react:** mux player react cuepoint handlers ([#605](https://github.com/muxinc/elements/issues/605)) ([df4e6e0](https://github.com/muxinc/elements/commit/df4e6e036f7cd9b5d9dfa52e1adc56bb0a850373))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
# [1.8.0](https://github.com/muxinc/elements/compare/@mux/mux-player-react@1.7.2...@mux/mux-player-react@1.8.0) (2023-02-15)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Features
|
|
43
|
+
|
|
44
|
+
* add attribute max-resolution on mux-player and mux-video ([#581](https://github.com/muxinc/elements/issues/581)) ([1936c8e](https://github.com/muxinc/elements/commit/1936c8ecb47805ee75fd04ffee514b846043efc1))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## [1.7.2](https://github.com/muxinc/elements/compare/@mux/mux-player-react@1.7.1...@mux/mux-player-react@1.7.2) (2023-02-14)
|
|
51
|
+
|
|
52
|
+
**Note:** Version bump only for package @mux/mux-player-react
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## [1.7.1](https://github.com/muxinc/elements/compare/@mux/mux-player-react@1.7.0...@mux/mux-player-react@1.7.1) (2023-02-02)
|
|
59
|
+
|
|
60
|
+
**Note:** Version bump only for package @mux/mux-player-react
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
# [1.7.0](https://github.com/muxinc/elements/compare/@mux/mux-player-react@1.6.1...@mux/mux-player-react@1.7.0) (2023-02-01)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### Features
|
|
70
|
+
|
|
71
|
+
* **mux-player-react:** Force version bump to 1.7.0 for parity with mux-player (minor code refactor for lerna). ([aba4ec0](https://github.com/muxinc/elements/commit/aba4ec0f6724928bd25f8def3685bfbccf68ec4c))
|
|
72
|
+
* **mux-player-react:** Force version bump to 1.7.0 for parity with mux-player. ([e7d6b3f](https://github.com/muxinc/elements/commit/e7d6b3f3eb36166c32d643de58baee9decf31fac))
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## [1.6.1](https://github.com/muxinc/elements/compare/@mux/mux-player-react@1.6.0...@mux/mux-player-react@1.6.1) (2023-02-01)
|
|
79
|
+
|
|
80
|
+
**Note:** Version bump only for package @mux/mux-player-react
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# [1.6.0](https://github.com/muxinc/elements/compare/@mux/mux-player-react@1.5.1...@mux/mux-player-react@1.6.0) (2023-01-20)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### Features
|
|
90
|
+
|
|
91
|
+
* **mux-player:** add storyboard-src attribute and corresponding prop ([#522](https://github.com/muxinc/elements/issues/522)) ([e9c3f0a](https://github.com/muxinc/elements/commit/e9c3f0afd3eb2521248996c37de1716b4ce724c4))
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
## [1.5.1](https://github.com/muxinc/elements/compare/@mux/mux-player-react@1.5.0...@mux/mux-player-react@1.5.1) (2022-12-15)
|
|
98
|
+
|
|
99
|
+
**Note:** Version bump only for package @mux/mux-player-react
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
# [1.5.0](https://github.com/muxinc/elements/compare/@mux/mux-player-react@1.4.0...@mux/mux-player-react@1.5.0) (2022-12-13)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
### Features
|
|
109
|
+
|
|
110
|
+
* Remove experimentalCmcd and add none to preferCmcd. Update secret docs. ([2656631](https://github.com/muxinc/elements/commit/2656631968f2b7e97a07d435818ee43c16627002))
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
# [1.4.0](https://github.com/muxinc/elements/compare/@mux/mux-player-react@1.3.0...@mux/mux-player-react@1.4.0) (2022-11-21)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
### Features
|
|
120
|
+
|
|
121
|
+
* **mux-player-react:** Add prefer cmcd prop. ([4733618](https://github.com/muxinc/elements/commit/473361832e9209314106980ce3e1ff1009a40d12))
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
# [1.3.0](https://github.com/muxinc/elements/compare/@mux/mux-player-react@1.2.0...@mux/mux-player-react@1.3.0) (2022-10-25)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
### Bug Fixes
|
|
131
|
+
|
|
132
|
+
* lazy placeholder properly scoped styles ([#478](https://github.com/muxinc/elements/issues/478)) ([d0f8aa1](https://github.com/muxinc/elements/commit/d0f8aa165a66df8e4e617120bd4d19949b0bee37))
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
### Features
|
|
136
|
+
|
|
137
|
+
* **mux-player-react:** Add disable cookies prop. ([ba9d46a](https://github.com/muxinc/elements/commit/ba9d46a2da652555565d5f82b6fc6550899ef4fb))
|
|
138
|
+
* **mux-player-react:** Add experimentalCmcd prop. ([40b44ff](https://github.com/muxinc/elements/commit/40b44ff042f57d2b265398c024117ccce9af3982))
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
# [1.2.0](https://github.com/muxinc/elements/compare/@mux/mux-player-react@1.1.3...@mux/mux-player-react@1.2.0) (2022-10-19)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
### Bug Fixes
|
|
148
|
+
|
|
149
|
+
* lazy placeholder lower specificity styles ([#465](https://github.com/muxinc/elements/issues/465)) ([6387081](https://github.com/muxinc/elements/commit/6387081f70aacac99820be40f13a8228b22109b8))
|
|
150
|
+
* observe media-object css variables on lazy placeholder ([#464](https://github.com/muxinc/elements/issues/464)) ([6aabbc0](https://github.com/muxinc/elements/commit/6aabbc06add2aad283f533a4186e9a397c7515b9))
|
|
151
|
+
* playbackRate not working on mux-player-react ([#470](https://github.com/muxinc/elements/issues/470)) ([e2c64b6](https://github.com/muxinc/elements/commit/e2c64b60bb53a66101004ed198f9bb1a08630eb2))
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
### Features
|
|
155
|
+
|
|
156
|
+
* implement react lazy with mux-player-react ([21ab5da](https://github.com/muxinc/elements/commit/21ab5dad724270082f73f2aa1cec5f4a0ed3e539))
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
## [1.1.3](https://github.com/muxinc/elements/compare/@mux/mux-player-react@1.1.2...@mux/mux-player-react@1.1.3) (2022-10-12)
|
|
163
|
+
|
|
164
|
+
**Note:** Version bump only for package @mux/mux-player-react
|
|
165
|
+
|
|
166
|
+
## [1.1.2](https://github.com/muxinc/elements/compare/@mux/mux-player-react@1.1.1...@mux/mux-player-react@1.1.2) (2022-10-10)
|
|
167
|
+
|
|
168
|
+
**Note:** Version bump only for package @mux/mux-player-react
|
|
169
|
+
|
|
170
|
+
## [1.1.1](https://github.com/muxinc/elements/compare/@mux/mux-player-react@1.1.0...@mux/mux-player-react@1.1.1) (2022-10-07)
|
|
171
|
+
|
|
172
|
+
**Note:** Version bump only for package @mux/mux-player-react
|
|
173
|
+
|
|
174
|
+
# [1.1.0](https://github.com/muxinc/elements/compare/@mux/mux-player-react@1.0.0...@mux/mux-player-react@1.1.0) (2022-10-07)
|
|
175
|
+
|
|
176
|
+
### Features
|
|
177
|
+
|
|
178
|
+
- add ability to unset poster ([#447](https://github.com/muxinc/elements/issues/447)) ([d61e295](https://github.com/muxinc/elements/commit/d61e295952d59ba42ad077c4a2b7fb3bb0d7079c))
|
|
179
|
+
|
|
6
180
|
# [1.0.0](https://github.com/muxinc/elements/compare/@mux/mux-player-react@1.0.0-beta.0...@mux/mux-player-react@1.0.0) (2022-10-05)
|
|
7
181
|
|
|
8
182
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
# Introduction
|
|
9
9
|
|
|
10
|
-
`<MuxPlayer />` is a Mux-flavored React video player component, built on top of our [mux-player web
|
|
10
|
+
`<MuxPlayer />` is a Mux-flavored React video player component, built on top of our [mux-player web component](../mux-player) and [Media Chrome](https://media-chrome.org).
|
|
11
11
|
|
|
12
12
|
# Installation
|
|
13
13
|
|
|
@@ -24,7 +24,28 @@ yarn add @mux/mux-player-react
|
|
|
24
24
|
# Usage
|
|
25
25
|
|
|
26
26
|
```jsx
|
|
27
|
+
import MuxPlayer from '@mux/mux-player-react';
|
|
28
|
+
|
|
29
|
+
<MuxPlayer
|
|
30
|
+
playbackId="DS00Spx1CV902MCtPj5WknGlR102V5HFkDe"
|
|
31
|
+
metadata={{
|
|
32
|
+
video_id: 'video-id-123456',
|
|
33
|
+
video_title: 'Bick Buck Bunny',
|
|
34
|
+
viewer_user_id: 'user-id-bc-789',
|
|
35
|
+
}}
|
|
36
|
+
streamType="on-demand"
|
|
37
|
+
/>;
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Lazy-loading
|
|
41
|
+
|
|
42
|
+
Defer loading of Mux Player by importing from `@mux/mux-player-react/lazy`.
|
|
43
|
+
|
|
44
|
+
```jsx
|
|
45
|
+
import MuxPlayer from '@mux/mux-player-react/lazy';
|
|
46
|
+
|
|
27
47
|
<MuxPlayer
|
|
48
|
+
loading="viewport"
|
|
28
49
|
playbackId="DS00Spx1CV902MCtPj5WknGlR102V5HFkDe"
|
|
29
50
|
metadata={{
|
|
30
51
|
video_id: 'video-id-123456',
|
|
@@ -32,9 +53,11 @@ yarn add @mux/mux-player-react
|
|
|
32
53
|
viewer_user_id: 'user-id-bc-789',
|
|
33
54
|
}}
|
|
34
55
|
streamType="on-demand"
|
|
35
|
-
|
|
56
|
+
/>;
|
|
36
57
|
```
|
|
37
58
|
|
|
59
|
+
If you are generating your pages with a Node.js server (for example, [Next.js](https://nextjs.org/docs/basic-features/data-fetching/)), consider using `@mux/mux-player-react/lazy` with [`@mux/blurhash`](https://github.com/muxinc/blurhash) to generate a placeholder to display during loading.
|
|
60
|
+
|
|
38
61
|
# Docs
|
|
39
62
|
|
|
40
63
|
Docs and guides live on [docs.mux.com](https://docs.mux.com/guides/video/mux-player?utm_source=github-mux-player).
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import y,{useEffect as ie}from"react";import{MediaError as be}from"@mux/mux-player";var d={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},_=e=>e==null,q=(e,t)=>_(t)?!1:e in t,J=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Y=(e,t)=>{if(!(typeof t=="boolean"&&!t)){if(q(e,d))return d[e];if(typeof t!=null)return/[A-Z]/.test(e)?J(e):e}};var $=(e,t)=>typeof e=="boolean"?"":e,c=(e={})=>Object.entries(e).reduce((t,[n,o])=>{let a=Y(n,o);if(!a)return t;let i=$(o,n);return t[a]=i,t},{});import{useRef as se}from"react";import{useEffect as Q,useRef as X}from"react";var m=(...e)=>{let t=X(null);return Q(()=>{e.forEach(n=>{!n||(typeof n=="function"?n(t.current):n.current=t.current)})},[e]),t};import{useEffect as B}from"react";var ee=Object.prototype.hasOwnProperty,te=(e,t)=>{if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.some((a,i)=>t[i]===a);let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let a=0;a<n.length;a++)if(!ee.call(t,n[a])||!Object.is(e[n[a]],t[n[a]]))return!1;return!0},p=(e,t,n)=>!te(t,e[n]),ne=(e,t,n)=>{e[n]=t},re=(e,t,n,o=ne,a=p)=>B(()=>{let i=n==null?void 0:n.current;!i||!a(i,t,e)||o(i,t,e)},[n==null?void 0:n.current,t]),l=re;var ae=()=>{try{return"1.10.0"}catch{}return"UNKNOWN"},oe=ae(),E=()=>oe;var le=y.forwardRef(({children:e,...t},n)=>y.createElement("mux-player",c({...t,ref:n}),e)),r=(e,t,n)=>ie(()=>{let o=t==null?void 0:t.current;if(!(!o||!n))return o.addEventListener(e,n),()=>{o.removeEventListener(e,n)}},[t==null?void 0:t.current,n]),ue=(e,t)=>{let{onAbort:n,onCanPlay:o,onCanPlayThrough:a,onEmptied:i,onLoadStart:g,onLoadedData:f,onLoadedMetadata:M,onProgress:P,onDurationChange:v,onVolumeChange:b,onRateChange:x,onResize:T,onWaiting:h,onPlay:R,onPlaying:k,onTimeUpdate:C,onPause:L,onSeeking:O,onSeeked:S,onStalled:G,onSuspend:w,onEnded:V,onError:A,onCuePointChange:N,onCuePointsChange:I,metadata:K,tokens:D,paused:U,playbackId:H,playbackRates:j,currentTime:z,themeProps:F,...W}=t;return l("playbackRates",j,e),l("metadata",K,e),l("themeProps",F,e),l("tokens",D,e),l("playbackId",H,e),l("paused",U,e,(s,u)=>{u!=null&&(u?s.pause():s.play())},(s,u,Z)=>s.hasAttribute("autoplay")&&!s.hasPlayed?!1:p(s,u,Z)),l("currentTime",z,e,(s,u)=>{u!=null&&(s.currentTime=u)}),r("abort",e,n),r("canplay",e,o),r("canplaythrough",e,a),r("emptied",e,i),r("loadstart",e,g),r("loadeddata",e,f),r("loadedmetadata",e,M),r("progress",e,P),r("durationchange",e,v),r("volumechange",e,b),r("ratechange",e,x),r("resize",e,T),r("waiting",e,h),r("play",e,R),r("playing",e,k),r("timeupdate",e,C),r("pause",e,L),r("seeking",e,O),r("seeked",e,S),r("stalled",e,G),r("suspend",e,w),r("ended",e,V),r("error",e,A),r("cuepointchange",e,N),r("cuepointschange",e,I),[W]},ye=E(),pe="mux-player-react",de=y.forwardRef((e,t)=>{let n=se(null),o=m(n,t),[a]=ue(n,e);return y.createElement(le,{ref:o,playerSoftwareName:pe,playerSoftwareVersion:ye,...a})}),Ce=de;export{be as MediaError,Ce as default};
|
|
2
|
+
//# sourceMappingURL=-MDMZGERP.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.tsx", "../src/common/utils.ts", "../src/useCombinedRefs.ts", "../src/useObjectPropEffect.ts", "../src/env.ts"],
|
|
4
|
+
"sourcesContent": ["import React, { useEffect } from 'react';\nimport type { CSSProperties } from 'react';\nimport type { StreamTypes, PlaybackTypes, CmcdTypes } from '@mux/playback-core';\nimport { MediaError } from '@mux/mux-player';\nimport type MuxPlayerElement from '@mux/mux-player';\nimport type { Tokens, MuxPlayerElementEventMap } from '@mux/mux-player';\nimport { toNativeProps } from './common/utils';\nimport { useRef } from 'react';\nimport { useCombinedRefs } from './useCombinedRefs';\nimport useObjectPropEffect, { defaultHasChanged } from './useObjectPropEffect';\nimport { getPlayerVersion } from './env';\n\nexport { MediaError };\n\ntype ValueOf<T> = T[keyof T];\ninterface GenericEventListener<T extends Event = CustomEvent> {\n (evt: T): void;\n}\n\nexport type MuxPlayerRefAttributes = MuxPlayerElement;\ntype VideoApiAttributes = {\n currentTime: number;\n volume: number;\n paused: boolean;\n src: string | null;\n poster: string;\n playbackRate: number;\n playsInline: boolean;\n preload: string;\n crossOrigin: string;\n autoPlay: boolean | string;\n loop: boolean;\n muted: boolean;\n style: CSSProperties;\n};\n\ntype MuxMediaPropTypes = {\n audio: boolean;\n // envKey: Options[\"data\"][\"env_key\"];\n envKey: string;\n // debug: Options[\"debug\"] & Hls[\"config\"][\"debug\"];\n debug: boolean;\n disableCookies: boolean;\n // metadata: Partial<Options[\"data\"]>;\n metadata: { [k: string]: any };\n beaconCollectionDomain: string;\n customDomain: string;\n playbackId: string;\n preferPlayback: ValueOf<PlaybackTypes> | undefined;\n // NOTE: Explicitly adding deprecated values here for now to avoid fully breaking changes in TS envs (CJP)\n streamType: ValueOf<StreamTypes> | 'll-live' | 'live:dvr' | 'll-live:dvr';\n defaultStreamType: ValueOf<StreamTypes>;\n targetLiveWindow: number;\n startTime: number;\n storyboardSrc: string;\n preferCmcd: ValueOf<CmcdTypes> | undefined;\n children: 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 themeProps?: { [k: string]: any };\n onAbort?: GenericEventListener<MuxPlayerElementEventMap['abort']>;\n onCanPlay?: GenericEventListener<MuxPlayerElementEventMap['canplay']>;\n onCanPlayThrough?: GenericEventListener<MuxPlayerElementEventMap['canplaythrough']>;\n onEmptied?: GenericEventListener<MuxPlayerElementEventMap['emptied']>;\n onLoadStart?: GenericEventListener<MuxPlayerElementEventMap['loadstart']>;\n onLoadedData?: GenericEventListener<MuxPlayerElementEventMap['loadeddata']>;\n onLoadedMetadata?: GenericEventListener<MuxPlayerElementEventMap['loadedmetadata']>;\n onProgress?: GenericEventListener<MuxPlayerElementEventMap['progress']>;\n onDurationChange?: GenericEventListener<MuxPlayerElementEventMap['durationchange']>;\n onVolumeChange?: GenericEventListener<MuxPlayerElementEventMap['volumechange']>;\n onRateChange?: GenericEventListener<MuxPlayerElementEventMap['ratechange']>;\n onResize?: GenericEventListener<MuxPlayerElementEventMap['resize']>;\n onWaiting?: GenericEventListener<MuxPlayerElementEventMap['waiting']>;\n onPlay?: GenericEventListener<MuxPlayerElementEventMap['play']>;\n onPlaying?: GenericEventListener<MuxPlayerElementEventMap['playing']>;\n onTimeUpdate?: GenericEventListener<MuxPlayerElementEventMap['timeupdate']>;\n onPause?: GenericEventListener<MuxPlayerElementEventMap['pause']>;\n onSeeking?: GenericEventListener<MuxPlayerElementEventMap['seeking']>;\n onSeeked?: GenericEventListener<MuxPlayerElementEventMap['seeked']>;\n onStalled?: GenericEventListener<MuxPlayerElementEventMap['stalled']>;\n onSuspend?: GenericEventListener<MuxPlayerElementEventMap['suspend']>;\n onEnded?: GenericEventListener<MuxPlayerElementEventMap['ended']>;\n onError?: GenericEventListener<MuxPlayerElementEventMap['error']>;\n onCuePointChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointchange']>;\n onCuePointsChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointschange']>;\n // onPlayerReady?: EventListener;\n} & Partial<MuxMediaPropTypes> &\n Partial<VideoApiAttributes>;\n\nconst MuxPlayerInternal = React.forwardRef<MuxPlayerRefAttributes, MuxPlayerProps>(({ children, ...props }, ref) => {\n return React.createElement('mux-player', toNativeProps({ ...props, ref }), children);\n});\n\nconst useEventCallbackEffect = <K extends keyof MuxPlayerElementEventMap>(\n type: K,\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n callback: GenericEventListener<MuxPlayerElementEventMap[K]> | undefined\n) => {\n return useEffect(() => {\n const eventTarget = ref?.current;\n if (!eventTarget || !callback) return;\n eventTarget.addEventListener(type, callback);\n return () => {\n eventTarget.removeEventListener(type, callback);\n };\n }, [ref?.current, callback]);\n};\n\nconst usePlayer = (\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n props: MuxPlayerProps\n) => {\n const {\n onAbort,\n onCanPlay,\n onCanPlayThrough,\n onEmptied,\n onLoadStart,\n onLoadedData,\n onLoadedMetadata,\n onProgress,\n onDurationChange,\n onVolumeChange,\n onRateChange,\n onResize,\n onWaiting,\n onPlay,\n onPlaying,\n onTimeUpdate,\n onPause,\n onSeeking,\n onSeeked,\n onStalled,\n onSuspend,\n onEnded,\n onError,\n onCuePointChange,\n onCuePointsChange,\n // onPlayerReady,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n currentTime,\n themeProps,\n ...remainingProps\n } = props;\n useObjectPropEffect('playbackRates', playbackRates, ref);\n useObjectPropEffect('metadata', metadata, ref);\n useObjectPropEffect('themeProps', themeProps, ref);\n useObjectPropEffect('tokens', tokens, ref);\n useObjectPropEffect('playbackId', playbackId, ref);\n useObjectPropEffect(\n 'paused',\n paused,\n ref,\n (playerEl: HTMLMediaElement, pausedVal?: boolean) => {\n if (pausedVal == null) return;\n if (pausedVal) {\n playerEl.pause();\n } else {\n playerEl.play();\n }\n },\n (playerEl, value, propName) => {\n if (playerEl.hasAttribute('autoplay') && !playerEl.hasPlayed) {\n return false;\n }\n return defaultHasChanged(playerEl, value, propName);\n }\n );\n useObjectPropEffect('currentTime', currentTime, ref, (playerEl: HTMLMediaElement, currentTimeVal?: number) => {\n if (currentTimeVal == null) return;\n playerEl.currentTime = currentTimeVal;\n });\n useEventCallbackEffect('abort', ref, onAbort);\n useEventCallbackEffect('canplay', ref, onCanPlay);\n useEventCallbackEffect('canplaythrough', ref, onCanPlayThrough);\n useEventCallbackEffect('emptied', ref, onEmptied);\n useEventCallbackEffect('loadstart', ref, onLoadStart);\n useEventCallbackEffect('loadeddata', ref, onLoadedData);\n useEventCallbackEffect('loadedmetadata', ref, onLoadedMetadata);\n useEventCallbackEffect('progress', ref, onProgress);\n useEventCallbackEffect('durationchange', ref, onDurationChange);\n useEventCallbackEffect('volumechange', ref, onVolumeChange);\n useEventCallbackEffect('ratechange', ref, onRateChange);\n useEventCallbackEffect('resize', ref, onResize);\n useEventCallbackEffect('waiting', ref, onWaiting);\n useEventCallbackEffect('play', ref, onPlay);\n useEventCallbackEffect('playing', ref, onPlaying);\n useEventCallbackEffect('timeupdate', ref, onTimeUpdate);\n useEventCallbackEffect('pause', ref, onPause);\n useEventCallbackEffect('seeking', ref, onSeeking);\n useEventCallbackEffect('seeked', ref, onSeeked);\n useEventCallbackEffect('stalled', ref, onStalled);\n useEventCallbackEffect('suspend', ref, onSuspend);\n useEventCallbackEffect('ended', ref, onEnded);\n useEventCallbackEffect('error', ref, onError);\n useEventCallbackEffect('cuepointchange', ref, onCuePointChange);\n useEventCallbackEffect('cuepointschange', ref, onCuePointsChange);\n // useEventCallbackEffect('playerready', ref, onPlayerReady);\n return [remainingProps];\n};\n\nconst playerSoftwareVersion = getPlayerVersion();\nconst playerSoftwareName = 'mux-player-react';\n\nconst MuxPlayer = React.forwardRef<\n MuxPlayerRefAttributes,\n Omit<MuxPlayerProps, 'playerSoftwareVersion' | 'playerSoftwareName'>\n>((props, ref) => {\n const innerPlayerRef = useRef<MuxPlayerElement>(null);\n const playerRef = useCombinedRefs(innerPlayerRef, ref);\n const [remainingProps] = usePlayer(innerPlayerRef, props);\n\n return (\n <MuxPlayerInternal\n /** @TODO Fix types relationships (CJP) */\n ref={playerRef as typeof innerPlayerRef}\n playerSoftwareName={playerSoftwareName}\n playerSoftwareVersion={playerSoftwareVersion}\n {...remainingProps}\n />\n );\n});\n\nexport default MuxPlayer;\n", "// NOTE: As a forward-looking implementation, we may want to assume\n// prop names -> attribute names is always a simple name.toLowerCase()\n// and provide a mechanism for passing in per-component overrides for\n// e.g. kebab cases, as that's the way React/Preact handles these. (CJP)\nconst ReactPropToAttrNameMap = {\n className: 'class',\n classname: 'class',\n htmlFor: 'for',\n crossOrigin: 'crossorigin',\n viewBox: 'viewBox',\n playsInline: 'playsinline',\n autoPlay: 'autoplay',\n playbackRate: 'playbackrate',\n};\n\ntype KeyTypes = string | number | symbol;\ntype Maybe<T> = T | null | undefined;\n\nexport const isNil = (x: unknown): x is null | undefined => x == undefined;\n\n// Type Guard to determine if a given key is actually a key of some object of type T\nexport const isKeyOf = <T extends {} = any>(k: KeyTypes, o: Maybe<T>): k is keyof T => {\n if (isNil(o)) return false;\n return k in o;\n};\n\nconst toKebabCase = (string: string) => string.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);\n\nexport const toNativeAttrName = (propName: string, propValue: any): string | undefined => {\n if (typeof propValue === 'boolean' && !propValue) return undefined;\n if (isKeyOf(propName, ReactPropToAttrNameMap)) return ReactPropToAttrNameMap[propName];\n if (typeof propValue == undefined) return undefined;\n if (/[A-Z]/.test(propName)) return toKebabCase(propName);\n return propName;\n};\nexport const toStyleAttr = <T>(x: T) => x;\n\nexport const toNativeAttrValue = (propValue: any, propName: string) => {\n if (typeof propValue === 'boolean') return '';\n return propValue;\n};\n\nexport const toNativeProps = (props = {}) => {\n return Object.entries(props).reduce<{ [k: string]: string }>((transformedProps, [propName, propValue]) => {\n const attrName = toNativeAttrName(propName, propValue);\n\n // prop was stripped. Don't add.\n if (!attrName) {\n return transformedProps;\n }\n\n const attrValue = toNativeAttrValue(propValue, propName);\n transformedProps[attrName] = attrValue;\n return transformedProps;\n }, {});\n};\n", "import { useEffect, useRef } from 'react';\nimport type { MutableRefObject, ForwardedRef } from 'react';\n\ntype Maybe<T> = T | null | undefined;\ntype RefCb<T> = (instance: Maybe<T>) => void;\ntype RefObj<T> = MutableRefObject<Maybe<T>>;\ntype RefTypes<T> = RefObj<T> | RefCb<T> | ForwardedRef<T>;\ninterface useCombinedRefs {\n <T>(...refs: Maybe<RefTypes<T>>[]): RefObj<T>;\n}\n\nexport const useCombinedRefs: useCombinedRefs = (...refs) => {\n const targetRef = useRef(null);\n\n useEffect(() => {\n refs.forEach((ref) => {\n if (!ref) return;\n\n if (typeof ref === 'function') {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n });\n }, [refs]);\n\n return targetRef;\n};\n\n// TS assumed default export was interface def instead of function value (CJP)\nconst defaultUseCombinedRefs = useCombinedRefs;\nexport default defaultUseCombinedRefs;\n", "import { useEffect } from 'react';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Slightly modified version of React's shallowEqual, with optimizations for Arrays\n * so we may treat them specifically as unequal if they are not a) both arrays\n * or b) don't contain the same (shallowly compared) elements.\n */\nconst shallowEqual = (objA: any, objB: any): boolean => {\n if (Object.is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n if (Array.isArray(objA)) {\n // Early \"cheap\" array compares\n if (!Array.isArray(objB) || objA.length !== objB.length) return false;\n // Shallow compare for arrays\n return objA.some((vVal, i) => objB[i] === vVal);\n }\n\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (let i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const defaultHasChanged = (obj: any, v: any, k: string) => {\n return !shallowEqual(v, obj[k]);\n};\n\nconst defaultUpdateValue = (obj: any, v: any, k: string) => {\n obj[k] = v;\n};\n\nexport const useObjectPropEffect = <T extends { [k: string]: any }, V>(\n propName: string,\n propValue: V | null | undefined,\n ref: React.MutableRefObject<T | null> | null | undefined,\n updateValue = defaultUpdateValue,\n hasChanged = defaultHasChanged\n) => {\n return useEffect(() => {\n const obj = ref?.current;\n if (!obj) return;\n if (!hasChanged(obj, propValue, propName)) return;\n updateValue(obj, propValue, propName);\n }, [ref?.current, propValue]);\n};\n\nexport default useObjectPropEffect;\n", "const getEnvPlayerVersion = () => {\n try {\n // @ts-ignore\n return PLAYER_VERSION as string;\n } catch {}\n return 'UNKNOWN';\n};\n\nconst player_version: string = getEnvPlayerVersion();\n\nexport const getPlayerVersion = () => player_version;\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,GAAS,aAAAC,OAAiB,QAGjC,OAAS,cAAAC,OAAkB,kBCC3B,IAAMC,EAAyB,CAC7B,UAAW,QACX,UAAW,QACX,QAAS,MACT,YAAa,cACb,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,EA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AAkBF,EAAKgB,CAAgB,EAC9Dd,EAAuB,eAAgBF,EAAKiB,CAAc,EAC1Df,EAAuB,aAAcF,EAAKkB,CAAY,EACtDhB,EAAuB,SAAUF,EAAKmB,CAAQ,EAC9CjB,EAAuB,UAAWF,EAAKoB,CAAS,EAChDlB,EAAuB,OAAQF,EAAKqB,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,CAACQ,CAAc,CACxB,EAEMQ,GAAwBC,EAAiB,EACzCC,GAAqB,mBAErBC,GAAYtD,EAAM,WAGtB,CAACE,EAAOC,IAAQ,CAChB,IAAMoD,EAAiBC,GAAyB,IAAI,EAC9CC,EAAYC,EAAgBH,EAAgBpD,CAAG,EAC/C,CAACwC,CAAc,EAAIjC,GAAU6C,EAAgBrD,CAAK,EAExD,OACEF,EAAA,cAACD,GAAA,CAEC,IAAK0D,EACL,mBAAoBJ,GACpB,sBAAuBF,GACtB,GAAGR,EACN,CAEJ,CAAC,EAEMgB,GAAQL",
|
|
6
|
+
"names": ["React", "useEffect", "MediaError", "ReactPropToAttrNameMap", "isNil", "x", "isKeyOf", "k", "o", "toKebabCase", "string", "match", "toNativeAttrName", "propName", "propValue", "toNativeAttrValue", "propValue", "propName", "toNativeProps", "props", "transformedProps", "attrName", "toNativeAttrName", "attrValue", "useRef", "useEffect", "useRef", "useCombinedRefs", "refs", "targetRef", "ref", "useEffect", "hasOwnProperty", "shallowEqual", "objA", "objB", "vVal", "keysA", "keysB", "i", "defaultHasChanged", "obj", "v", "k", "defaultUpdateValue", "useObjectPropEffect", "propName", "propValue", "ref", "updateValue", "hasChanged", "useObjectPropEffect_default", "getEnvPlayerVersion", "player_version", "getPlayerVersion", "MuxPlayerInternal", "React", "children", "props", "ref", "toNativeProps", "useEventCallbackEffect", "type", "callback", "useEffect", "eventTarget", "usePlayer", "onAbort", "onCanPlay", "onCanPlayThrough", "onEmptied", "onLoadStart", "onLoadedData", "onLoadedMetadata", "onProgress", "onDurationChange", "onVolumeChange", "onRateChange", "onResize", "onWaiting", "onPlay", "onPlaying", "onTimeUpdate", "onPause", "onSeeking", "onSeeked", "onStalled", "onSuspend", "onEnded", "onError", "onCuePointChange", "onCuePointsChange", "metadata", "tokens", "paused", "playbackId", "playbackRates", "currentTime", "themeProps", "remainingProps", "useObjectPropEffect_default", "playerEl", "pausedVal", "value", "propName", "defaultHasChanged", "currentTimeVal", "playerSoftwareVersion", "getPlayerVersion", "playerSoftwareName", "MuxPlayer", "innerPlayerRef", "useRef", "playerRef", "useCombinedRefs", "src_default"]
|
|
7
|
+
}
|
package/dist/cjs.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"inputs": {
|
|
3
3
|
"src/common/utils.ts": {
|
|
4
|
-
"bytes":
|
|
4
|
+
"bytes": 2048,
|
|
5
5
|
"imports": []
|
|
6
6
|
},
|
|
7
7
|
"src/useCombinedRefs.ts": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"imports": []
|
|
18
18
|
},
|
|
19
19
|
"src/index.tsx": {
|
|
20
|
-
"bytes":
|
|
20
|
+
"bytes": 9223,
|
|
21
21
|
"imports": [
|
|
22
22
|
{
|
|
23
23
|
"path": "src/common/utils.ts",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"imports": [],
|
|
44
44
|
"exports": [],
|
|
45
45
|
"inputs": {},
|
|
46
|
-
"bytes":
|
|
46
|
+
"bytes": 21131
|
|
47
47
|
},
|
|
48
48
|
"dist/index.cjs.js": {
|
|
49
49
|
"imports": [],
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"entryPoint": "src/index.tsx",
|
|
52
52
|
"inputs": {
|
|
53
53
|
"src/index.tsx": {
|
|
54
|
-
"bytesInOutput":
|
|
54
|
+
"bytesInOutput": 1850
|
|
55
55
|
},
|
|
56
56
|
"src/common/utils.ts": {
|
|
57
|
-
"bytesInOutput":
|
|
57
|
+
"bytesInOutput": 532
|
|
58
58
|
},
|
|
59
59
|
"src/useCombinedRefs.ts": {
|
|
60
60
|
"bytesInOutput": 171
|
|
@@ -63,10 +63,10 @@
|
|
|
63
63
|
"bytesInOutput": 601
|
|
64
64
|
},
|
|
65
65
|
"src/env.ts": {
|
|
66
|
-
"bytesInOutput":
|
|
66
|
+
"bytesInOutput": 72
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
|
-
"bytes":
|
|
69
|
+
"bytes": 3844
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
}
|
package/dist/esm.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"inputs": {
|
|
3
3
|
"src/common/utils.ts": {
|
|
4
|
-
"bytes":
|
|
4
|
+
"bytes": 2048,
|
|
5
5
|
"imports": []
|
|
6
6
|
},
|
|
7
7
|
"src/useCombinedRefs.ts": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"imports": []
|
|
18
18
|
},
|
|
19
19
|
"src/index.tsx": {
|
|
20
|
-
"bytes":
|
|
20
|
+
"bytes": 9223,
|
|
21
21
|
"imports": [
|
|
22
22
|
{
|
|
23
23
|
"path": "src/common/utils.ts",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"imports": [],
|
|
44
44
|
"exports": [],
|
|
45
45
|
"inputs": {},
|
|
46
|
-
"bytes":
|
|
46
|
+
"bytes": 21077
|
|
47
47
|
},
|
|
48
48
|
"dist/index.mjs": {
|
|
49
49
|
"imports": [],
|
|
@@ -54,22 +54,22 @@
|
|
|
54
54
|
"entryPoint": "src/index.tsx",
|
|
55
55
|
"inputs": {
|
|
56
56
|
"src/index.tsx": {
|
|
57
|
-
"bytesInOutput":
|
|
57
|
+
"bytesInOutput": 1748
|
|
58
58
|
},
|
|
59
59
|
"src/common/utils.ts": {
|
|
60
|
-
"bytesInOutput":
|
|
60
|
+
"bytesInOutput": 522
|
|
61
61
|
},
|
|
62
62
|
"src/useCombinedRefs.ts": {
|
|
63
63
|
"bytesInOutput": 174
|
|
64
64
|
},
|
|
65
65
|
"src/useObjectPropEffect.ts": {
|
|
66
|
-
"bytesInOutput":
|
|
66
|
+
"bytesInOutput": 602
|
|
67
67
|
},
|
|
68
68
|
"src/env.ts": {
|
|
69
|
-
"bytesInOutput":
|
|
69
|
+
"bytesInOutput": 72
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
|
-
"bytes":
|
|
72
|
+
"bytes": 3193
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
{
|
|
2
|
+
"inputs": {
|
|
3
|
+
"src/ConditionalSuspense.tsx": {
|
|
4
|
+
"bytes": 449,
|
|
5
|
+
"imports": []
|
|
6
|
+
},
|
|
7
|
+
"src/useIsBrowser.ts": {
|
|
8
|
+
"bytes": 285,
|
|
9
|
+
"imports": []
|
|
10
|
+
},
|
|
11
|
+
"src/useIsIntersecting.ts": {
|
|
12
|
+
"bytes": 645,
|
|
13
|
+
"imports": []
|
|
14
|
+
},
|
|
15
|
+
"src/common/utils.ts": {
|
|
16
|
+
"bytes": 2048,
|
|
17
|
+
"imports": []
|
|
18
|
+
},
|
|
19
|
+
"src/useCombinedRefs.ts": {
|
|
20
|
+
"bytes": 892,
|
|
21
|
+
"imports": []
|
|
22
|
+
},
|
|
23
|
+
"src/useObjectPropEffect.ts": {
|
|
24
|
+
"bytes": 1850,
|
|
25
|
+
"imports": []
|
|
26
|
+
},
|
|
27
|
+
"src/env.ts": {
|
|
28
|
+
"bytes": 245,
|
|
29
|
+
"imports": []
|
|
30
|
+
},
|
|
31
|
+
"src/index.tsx": {
|
|
32
|
+
"bytes": 9223,
|
|
33
|
+
"imports": [
|
|
34
|
+
{
|
|
35
|
+
"path": "src/common/utils.ts",
|
|
36
|
+
"kind": "import-statement"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"path": "src/useCombinedRefs.ts",
|
|
40
|
+
"kind": "import-statement"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"path": "src/useObjectPropEffect.ts",
|
|
44
|
+
"kind": "import-statement"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"path": "src/env.ts",
|
|
48
|
+
"kind": "import-statement"
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"src/lazy.tsx": {
|
|
53
|
+
"bytes": 4339,
|
|
54
|
+
"imports": [
|
|
55
|
+
{
|
|
56
|
+
"path": "src/ConditionalSuspense.tsx",
|
|
57
|
+
"kind": "import-statement"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"path": "src/useIsBrowser.ts",
|
|
61
|
+
"kind": "import-statement"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"path": "src/useIsIntersecting.ts",
|
|
65
|
+
"kind": "import-statement"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"path": "src/index.tsx",
|
|
69
|
+
"kind": "dynamic-import"
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"outputs": {
|
|
75
|
+
"dist/lazy.mjs.map": {
|
|
76
|
+
"imports": [],
|
|
77
|
+
"exports": [],
|
|
78
|
+
"inputs": {},
|
|
79
|
+
"bytes": 8778
|
|
80
|
+
},
|
|
81
|
+
"dist/lazy.mjs": {
|
|
82
|
+
"imports": [
|
|
83
|
+
{
|
|
84
|
+
"path": "dist/-MDMZGERP.mjs",
|
|
85
|
+
"kind": "dynamic-import"
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"exports": [
|
|
89
|
+
"default"
|
|
90
|
+
],
|
|
91
|
+
"entryPoint": "src/lazy.tsx",
|
|
92
|
+
"inputs": {
|
|
93
|
+
"src/lazy.tsx": {
|
|
94
|
+
"bytesInOutput": 1684
|
|
95
|
+
},
|
|
96
|
+
"src/ConditionalSuspense.tsx": {
|
|
97
|
+
"bytesInOutput": 166
|
|
98
|
+
},
|
|
99
|
+
"src/useIsBrowser.ts": {
|
|
100
|
+
"bytesInOutput": 134
|
|
101
|
+
},
|
|
102
|
+
"src/useIsIntersecting.ts": {
|
|
103
|
+
"bytesInOutput": 274
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"bytes": 2304
|
|
107
|
+
},
|
|
108
|
+
"dist/-MDMZGERP.mjs.map": {
|
|
109
|
+
"imports": [],
|
|
110
|
+
"exports": [],
|
|
111
|
+
"inputs": {},
|
|
112
|
+
"bytes": 21077
|
|
113
|
+
},
|
|
114
|
+
"dist/-MDMZGERP.mjs": {
|
|
115
|
+
"imports": [],
|
|
116
|
+
"exports": [
|
|
117
|
+
"MediaError",
|
|
118
|
+
"default"
|
|
119
|
+
],
|
|
120
|
+
"entryPoint": "src/index.tsx",
|
|
121
|
+
"inputs": {
|
|
122
|
+
"src/index.tsx": {
|
|
123
|
+
"bytesInOutput": 1748
|
|
124
|
+
},
|
|
125
|
+
"src/common/utils.ts": {
|
|
126
|
+
"bytesInOutput": 522
|
|
127
|
+
},
|
|
128
|
+
"src/useCombinedRefs.ts": {
|
|
129
|
+
"bytesInOutput": 174
|
|
130
|
+
},
|
|
131
|
+
"src/useObjectPropEffect.ts": {
|
|
132
|
+
"bytesInOutput": 602
|
|
133
|
+
},
|
|
134
|
+
"src/env.ts": {
|
|
135
|
+
"bytesInOutput": 72
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"bytes": 3197
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var X=Object.create;var p=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var re=(e,t)=>{for(var n in t)p(e,n,{get:t[n],enumerable:!0})},m=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of ee(t))!ne.call(e,a)&&a!==n&&p(e,a,{get:()=>t[a],enumerable:!(o=B(t,a))||o.enumerable});return e};var ae=(e,t,n)=>(n=e!=null?X(te(e)):{},m(t||!e||!e.__esModule?p(n,"default",{value:e,enumerable:!0}):n,e)),oe=e=>m(p({},"__esModule",{value:!0}),e);var Te={};re(Te,{MediaError:()=>v.MediaError,default:()=>xe});module.exports=oe(Te);var y=ae(require("react")),v=require("@mux/mux-player");var E={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},ie=e=>e==null,se=(e,t)=>ie(t)?!1:e in t,le=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),ue=(e,t)=>{if(!(typeof t=="boolean"&&!t)){if(se(e,E))return E[e];if(typeof t!=null)return/[A-Z]/.test(e)?le(e):e}};var ye=(e,t)=>typeof e=="boolean"?"":e,g=(e={})=>Object.entries(e).reduce((t,[n,o])=>{let a=ue(n,o);if(!a)return t;let i=ye(o,n);return t[a]=i,t},{});var b=require("react");var d=require("react"),f=(...e)=>{let t=(0,d.useRef)(null);return(0,d.useEffect)(()=>{e.forEach(n=>{!n||(typeof n=="function"?n(t.current):n.current=t.current)})},[e]),t};var M=require("react"),pe=Object.prototype.hasOwnProperty,de=(e,t)=>{if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.some((a,i)=>t[i]===a);let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let a=0;a<n.length;a++)if(!pe.call(t,n[a])||!Object.is(e[n[a]],t[n[a]]))return!1;return!0},c=(e,t,n)=>!de(t,e[n]),ce=(e,t,n)=>{e[n]=t},me=(e,t,n,o=ce,a=c)=>(0,M.useEffect)(()=>{let i=n==null?void 0:n.current;!i||!a(i,t,e)||o(i,t,e)},[n==null?void 0:n.current,t]),l=me;var Ee=()=>{try{return"1.10.0"}catch{}return"UNKNOWN"},ge=Ee(),P=()=>ge;var fe=y.default.forwardRef(({children:e,...t},n)=>y.default.createElement("mux-player",g({...t,ref:n}),e)),r=(e,t,n)=>(0,y.useEffect)(()=>{let o=t==null?void 0:t.current;if(!(!o||!n))return o.addEventListener(e,n),()=>{o.removeEventListener(e,n)}},[t==null?void 0:t.current,n]),Me=(e,t)=>{let{onAbort:n,onCanPlay:o,onCanPlayThrough:a,onEmptied:i,onLoadStart:x,onLoadedData:T,onLoadedMetadata:h,onProgress:R,onDurationChange:k,onVolumeChange:C,onRateChange:L,onResize:O,onWaiting:S,onPlay:G,onPlaying:w,onTimeUpdate:V,onPause:A,onSeeking:N,onSeeked:I,onStalled:K,onSuspend:D,onEnded:U,onError:H,onCuePointChange:j,onCuePointsChange:z,metadata:F,tokens:W,paused:Z,playbackId:_,playbackRates:q,currentTime:J,themeProps:Y,...$}=t;return l("playbackRates",q,e),l("metadata",F,e),l("themeProps",Y,e),l("tokens",W,e),l("playbackId",_,e),l("paused",Z,e,(s,u)=>{u!=null&&(u?s.pause():s.play())},(s,u,Q)=>s.hasAttribute("autoplay")&&!s.hasPlayed?!1:c(s,u,Q)),l("currentTime",J,e,(s,u)=>{u!=null&&(s.currentTime=u)}),r("abort",e,n),r("canplay",e,o),r("canplaythrough",e,a),r("emptied",e,i),r("loadstart",e,x),r("loadeddata",e,T),r("loadedmetadata",e,h),r("progress",e,R),r("durationchange",e,k),r("volumechange",e,C),r("ratechange",e,L),r("resize",e,O),r("waiting",e,S),r("play",e,G),r("playing",e,w),r("timeupdate",e,V),r("pause",e,A),r("seeking",e,N),r("seeked",e,I),r("stalled",e,K),r("suspend",e,D),r("ended",e,U),r("error",e,H),r("cuepointchange",e,j),r("cuepointschange",e,z),[$]},Pe=P(),ve="mux-player-react",be=y.default.forwardRef((e,t)=>{let n=(0,b.useRef)(null),o=f(n,t),[a]=Me(n,e);return y.default.createElement(fe,{ref:o,playerSoftwareName:ve,playerSoftwareVersion:Pe,...a})}),xe=be;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|