@mux/mux-player-react 1.10.1 → 1.11.0-canary.0-1c29f8f
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 +387 -0
- package/dist/-2IT5KXF6.mjs +2 -0
- package/dist/-2IT5KXF6.mjs.map +7 -0
- package/dist/cjs.json +72 -0
- package/dist/esm.json +75 -0
- package/dist/esm.lazy.json +5 -5
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +2 -2
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +2 -2
- package/dist/lazy.mjs +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types-ts3.4/index.d.ts +1 -0
- package/package.json +4 -5
- package/LICENSE +0 -9
- package/dist/-OHQE4KKI.mjs +0 -2
- package/dist/-OHQE4KKI.mjs.map +0 -7
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
# [1.11.0](https://github.com/muxinc/elements/compare/@mux/mux-player-react@1.10.1...@mux/mux-player-react@1.11.0) (2023-05-08)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* add a no-volume-pref attribute to turn of storing volume in localStorage ([#686](https://github.com/muxinc/elements/issues/686)) ([e9c2150](https://github.com/muxinc/elements/commit/e9c2150ba36615107f05d99baaa8a4432d71138d))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [1.10.1](https://github.com/muxinc/elements/compare/@mux/mux-player-react@1.10.0...@mux/mux-player-react@1.10.1) (2023-04-24)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @mux/mux-player-react
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [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)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* **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))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Features
|
|
34
|
+
|
|
35
|
+
* inferred stream type ([#592](https://github.com/muxinc/elements/issues/592)) ([db4cc9f](https://github.com/muxinc/elements/commit/db4cc9f60660f2b860ecce0a5a5ef2a3a09cc40b))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
# [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)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Bug Fixes
|
|
45
|
+
|
|
46
|
+
* update typedefs, disable skipLibChecks in tsconfig ([#601](https://github.com/muxinc/elements/issues/601)) ([1664aec](https://github.com/muxinc/elements/commit/1664aec20e4cf4a59779848b298d4504eef24080))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### Features
|
|
50
|
+
|
|
51
|
+
* add way to set and render MC themes ([#561](https://github.com/muxinc/elements/issues/561)) ([0ac98e9](https://github.com/muxinc/elements/commit/0ac98e9a6fd60c5ea990be3c7d5d8ae7941e447c))
|
|
52
|
+
* **mux-player-react:** mux player react cuepoint handlers ([#605](https://github.com/muxinc/elements/issues/605)) ([df4e6e0](https://github.com/muxinc/elements/commit/df4e6e036f7cd9b5d9dfa52e1adc56bb0a850373))
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
# [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)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
### Features
|
|
62
|
+
|
|
63
|
+
* 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))
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
## [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)
|
|
70
|
+
|
|
71
|
+
**Note:** Version bump only for package @mux/mux-player-react
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
## [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)
|
|
78
|
+
|
|
79
|
+
**Note:** Version bump only for package @mux/mux-player-react
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
# [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)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
### Features
|
|
89
|
+
|
|
90
|
+
* **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))
|
|
91
|
+
* **mux-player-react:** Force version bump to 1.7.0 for parity with mux-player. ([e7d6b3f](https://github.com/muxinc/elements/commit/e7d6b3f3eb36166c32d643de58baee9decf31fac))
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
## [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)
|
|
98
|
+
|
|
99
|
+
**Note:** Version bump only for package @mux/mux-player-react
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
# [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)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
### Features
|
|
109
|
+
|
|
110
|
+
* **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))
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
## [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)
|
|
117
|
+
|
|
118
|
+
**Note:** Version bump only for package @mux/mux-player-react
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
# [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)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
### Features
|
|
128
|
+
|
|
129
|
+
* Remove experimentalCmcd and add none to preferCmcd. Update secret docs. ([2656631](https://github.com/muxinc/elements/commit/2656631968f2b7e97a07d435818ee43c16627002))
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
# [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)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
### Features
|
|
139
|
+
|
|
140
|
+
* **mux-player-react:** Add prefer cmcd prop. ([4733618](https://github.com/muxinc/elements/commit/473361832e9209314106980ce3e1ff1009a40d12))
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
# [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)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
### Bug Fixes
|
|
150
|
+
|
|
151
|
+
* lazy placeholder properly scoped styles ([#478](https://github.com/muxinc/elements/issues/478)) ([d0f8aa1](https://github.com/muxinc/elements/commit/d0f8aa165a66df8e4e617120bd4d19949b0bee37))
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
### Features
|
|
155
|
+
|
|
156
|
+
* **mux-player-react:** Add disable cookies prop. ([ba9d46a](https://github.com/muxinc/elements/commit/ba9d46a2da652555565d5f82b6fc6550899ef4fb))
|
|
157
|
+
* **mux-player-react:** Add experimentalCmcd prop. ([40b44ff](https://github.com/muxinc/elements/commit/40b44ff042f57d2b265398c024117ccce9af3982))
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
# [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)
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
### Bug Fixes
|
|
167
|
+
|
|
168
|
+
* lazy placeholder lower specificity styles ([#465](https://github.com/muxinc/elements/issues/465)) ([6387081](https://github.com/muxinc/elements/commit/6387081f70aacac99820be40f13a8228b22109b8))
|
|
169
|
+
* observe media-object css variables on lazy placeholder ([#464](https://github.com/muxinc/elements/issues/464)) ([6aabbc0](https://github.com/muxinc/elements/commit/6aabbc06add2aad283f533a4186e9a397c7515b9))
|
|
170
|
+
* playbackRate not working on mux-player-react ([#470](https://github.com/muxinc/elements/issues/470)) ([e2c64b6](https://github.com/muxinc/elements/commit/e2c64b60bb53a66101004ed198f9bb1a08630eb2))
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
### Features
|
|
174
|
+
|
|
175
|
+
* implement react lazy with mux-player-react ([21ab5da](https://github.com/muxinc/elements/commit/21ab5dad724270082f73f2aa1cec5f4a0ed3e539))
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
## [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)
|
|
182
|
+
|
|
183
|
+
**Note:** Version bump only for package @mux/mux-player-react
|
|
184
|
+
|
|
185
|
+
## [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)
|
|
186
|
+
|
|
187
|
+
**Note:** Version bump only for package @mux/mux-player-react
|
|
188
|
+
|
|
189
|
+
## [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)
|
|
190
|
+
|
|
191
|
+
**Note:** Version bump only for package @mux/mux-player-react
|
|
192
|
+
|
|
193
|
+
# [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)
|
|
194
|
+
|
|
195
|
+
### Features
|
|
196
|
+
|
|
197
|
+
- add ability to unset poster ([#447](https://github.com/muxinc/elements/issues/447)) ([d61e295](https://github.com/muxinc/elements/commit/d61e295952d59ba42ad077c4a2b7fb3bb0d7079c))
|
|
198
|
+
|
|
199
|
+
# [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)
|
|
200
|
+
|
|
201
|
+
### Bug Fixes
|
|
202
|
+
|
|
203
|
+
- **mux-player-react:** Make currentTime prop work. ([65b098d](https://github.com/muxinc/elements/commit/65b098da731d53e93d42c3cb3882d287847ac043))
|
|
204
|
+
- **mux-player-react:** remove vestigial tertiaryColor from types. ([73a5155](https://github.com/muxinc/elements/commit/73a5155549a1c0fa44f8c95c9bf329ffd4543788))
|
|
205
|
+
|
|
206
|
+
### Features
|
|
207
|
+
|
|
208
|
+
- add `prefer-playback` attribute ([#402](https://github.com/muxinc/elements/issues/402)) ([8da36d6](https://github.com/muxinc/elements/commit/8da36d6b597ddbc4ae006873fee13a971b7ec2f3))
|
|
209
|
+
|
|
210
|
+
# [1.0.0-beta.0](https://github.com/muxinc/elements/compare/@mux/mux-player-react@0.1.0-beta.28...@mux/mux-player-react@1.0.0-beta.0) (2022-09-16)
|
|
211
|
+
|
|
212
|
+
### Bug Fixes
|
|
213
|
+
|
|
214
|
+
- **mux-player-react:** explicitly add className to typescript types for mux-player-react (different impl from MuxVideo and MuxAudio). ([84ca6cb](https://github.com/muxinc/elements/commit/84ca6cb69a2634dade58cece3b17ae72060c79b1))
|
|
215
|
+
|
|
216
|
+
### Features
|
|
217
|
+
|
|
218
|
+
- export gesture-layer as a part ([89e90ee](https://github.com/muxinc/elements/commit/89e90ee3268da23c8071fc9cd2f21efc534f1849)), closes [#379](https://github.com/muxinc/elements/issues/379)
|
|
219
|
+
|
|
220
|
+
# [0.1.0-beta.28](https://github.com/muxinc/elements/compare/@mux/mux-player-react@0.1.0-beta.27...@mux/mux-player-react@0.1.0-beta.28) (2022-09-01)
|
|
221
|
+
|
|
222
|
+
### Bug Fixes
|
|
223
|
+
|
|
224
|
+
- cjs main entrypoint for React pkgs ([#360](https://github.com/muxinc/elements/issues/360)) ([473875f](https://github.com/muxinc/elements/commit/473875f4869a6ab9b04b44a90cc52b620a15ac83))
|
|
225
|
+
|
|
226
|
+
# [0.1.0-beta.27](https://github.com/muxinc/elements/compare/@mux/mux-player-react@0.1.0-beta.26...@mux/mux-player-react@0.1.0-beta.27) (2022-08-31)
|
|
227
|
+
|
|
228
|
+
### Features
|
|
229
|
+
|
|
230
|
+
- Add hotkeys blocklist and turn off hotkey seeking when any live ([#341](https://github.com/muxinc/elements/issues/341)) ([ce76b1b](https://github.com/muxinc/elements/commit/ce76b1b5955179c929c91de97c06a2839990c509)), closes [#336](https://github.com/muxinc/elements/issues/336)
|
|
231
|
+
- **mux-player-react:** Add defaultShowRemainingTime to mux-player-react. ([7a58731](https://github.com/muxinc/elements/commit/7a58731ba6d6965942f0e3d487821dd464ce422c))
|
|
232
|
+
- **mux-player-react:** add missing event listeners ([03cac1a](https://github.com/muxinc/elements/commit/03cac1abeb4215ea89f03f899b9132ab18486699))
|
|
233
|
+
- **mux-player-react:** Add support for hideDuration and playbackRates. ([58ababc](https://github.com/muxinc/elements/commit/58ababc79c1391fda311b82c42180404d01850bb))
|
|
234
|
+
- **mux-player-react:** Add title type for MuxPlayer (react). ([22c80fe](https://github.com/muxinc/elements/commit/22c80fecd7c856b234a1fa2a65e7efd2b4e98f0b))
|
|
235
|
+
- **mux-player, mux-player-react:** make hide-duration a controlsList value. ([cb3b2f2](https://github.com/muxinc/elements/commit/cb3b2f27b804878e5a223893cc6fc75dac0a4572))
|
|
236
|
+
- use CSS vars to toggle off elements ([#349](https://github.com/muxinc/elements/issues/349)) ([69128d6](https://github.com/muxinc/elements/commit/69128d62ee1a9e5139d8fab3b5faf56e494dfa8b))
|
|
237
|
+
|
|
238
|
+
# [0.1.0-beta.26](https://github.com/muxinc/elements/compare/@mux/mux-player-react@0.1.0-beta.25...@mux/mux-player-react@0.1.0-beta.26) (2022-08-03)
|
|
239
|
+
|
|
240
|
+
**Note:** Version bump only for package @mux/mux-player-react
|
|
241
|
+
|
|
242
|
+
# [0.1.0-beta.25](https://github.com/muxinc/elements/compare/@mux/mux-player-react@0.1.0-beta.24...@mux/mux-player-react@0.1.0-beta.25) (2022-08-02)
|
|
243
|
+
|
|
244
|
+
### Features
|
|
245
|
+
|
|
246
|
+
- types and docs for nohotkeys in mux-player-react ([a9f78d4](https://github.com/muxinc/elements/commit/a9f78d422d64bf661de59cad834aa1c819e88ff8))
|
|
247
|
+
|
|
248
|
+
# [0.1.0-beta.24](https://github.com/muxinc/elements/compare/@mux/mux-player-react@0.1.0-beta.23...@mux/mux-player-react@0.1.0-beta.24) (2022-07-21)
|
|
249
|
+
|
|
250
|
+
### Features
|
|
251
|
+
|
|
252
|
+
- add defaultMuted, defaultPlaybackRate props ([#252](https://github.com/muxinc/elements/issues/252)) ([1a72165](https://github.com/muxinc/elements/commit/1a7216545cba27b34bc743cf5dd6225d4dcae738))
|
|
253
|
+
|
|
254
|
+
# [0.1.0-beta.23](https://github.com/muxinc/elements/compare/@mux/mux-player-react@0.1.0-beta.22...@mux/mux-player-react@0.1.0-beta.23) (2022-07-11)
|
|
255
|
+
|
|
256
|
+
**Note:** Version bump only for package @mux/mux-player-react
|
|
257
|
+
|
|
258
|
+
# [0.1.0-beta.22](https://github.com/muxinc/elements/compare/@mux/mux-player-react@0.1.0-beta.21...@mux/mux-player-react@0.1.0-beta.22) (2022-07-05)
|
|
259
|
+
|
|
260
|
+
**Note:** Version bump only for package @mux/mux-player-react
|
|
261
|
+
|
|
262
|
+
# 0.1.0-beta.21 (2022-07-05)
|
|
263
|
+
|
|
264
|
+
### Bug Fixes
|
|
265
|
+
|
|
266
|
+
- enable cast docs + cast fix ([#253](https://github.com/muxinc/elements/issues/253)) ([421d515](https://github.com/muxinc/elements/commit/421d515cc4700cf9d7ca4f0d09aa600ec4adac7b))
|
|
267
|
+
- **mux-player-react:** Missing preload prop type def. ([19b2e15](https://github.com/muxinc/elements/commit/19b2e15dc844e6fb0f90e9ad62a436587260094a))
|
|
268
|
+
- prettier format all elements files ([741d607](https://github.com/muxinc/elements/commit/741d607521ca9578cfad9f0a9216a6565b4c56a1))
|
|
269
|
+
- switch cjs extension to .cjs.js ([30e83c3](https://github.com/muxinc/elements/commit/30e83c3ce0bd9bfda4817c30ffe0921e425619e4))
|
|
270
|
+
- update react peerDependencies to allow ^18 ([1cfb019](https://github.com/muxinc/elements/commit/1cfb019b71cf9aa280abccaf4a7818d585b56d86))
|
|
271
|
+
|
|
272
|
+
### Features
|
|
273
|
+
|
|
274
|
+
- add beaconCollectionDomain option to replace beaconDomain ([a44b699](https://github.com/muxinc/elements/commit/a44b699ae3138590b9d953f693f95971694658df))
|
|
275
|
+
- default-hidden-captions to turn off showing captions by default ([#98](https://github.com/muxinc/elements/issues/98)) ([9edc3cd](https://github.com/muxinc/elements/commit/9edc3cd008e47234472b14784ea89493736599cb))
|
|
276
|
+
- Extended autoplay options ([#116](https://github.com/muxinc/elements/issues/116)) ([475e838](https://github.com/muxinc/elements/commit/475e83884f641c578fa601c9501147d485fc1831))
|
|
277
|
+
- **mux-player-react:** Add audio only. Cleanup StreamTypes source of truth. ([4f37d7f](https://github.com/muxinc/elements/commit/4f37d7f10ef66eef48af0dd9cf1efc79322b660d))
|
|
278
|
+
- **mux-player-react:** Add basic support for custom video domains. ([ac61aff](https://github.com/muxinc/elements/commit/ac61affffdd38ef0df3151d2f75023f7d2772688))
|
|
279
|
+
- **mux-player-react:** Add thumbnail-time support to mux-player-react. Document prop. ([d1c1a4c](https://github.com/muxinc/elements/commit/d1c1a4c65b200c59bab7cc68453c0e307eb75ae4))
|
|
280
|
+
|
|
281
|
+
### Reverts
|
|
282
|
+
|
|
283
|
+
- Revert "Publish" ([42fc528](https://github.com/muxinc/elements/commit/42fc528216346ff52d967cec5392a1191f74a1c0))
|
|
284
|
+
|
|
285
|
+
# [0.1.0-beta.20](https://github.com/muxinc/elements/compare/@mux-elements/mux-player-react@0.1.0-beta.19...@mux-elements/mux-player-react@0.1.0-beta.20) (2022-06-23)
|
|
286
|
+
|
|
287
|
+
### Bug Fixes
|
|
288
|
+
|
|
289
|
+
- enable cast docs + cast fix ([#253](https://github.com/muxinc/elements/issues/253)) ([421d515](https://github.com/muxinc/elements/commit/421d515cc4700cf9d7ca4f0d09aa600ec4adac7b))
|
|
290
|
+
|
|
291
|
+
### Features
|
|
292
|
+
|
|
293
|
+
- **mux-player-react:** Add basic support for custom video domains. ([ac61aff](https://github.com/muxinc/elements/commit/ac61affffdd38ef0df3151d2f75023f7d2772688))
|
|
294
|
+
|
|
295
|
+
# [0.1.0-beta.19](https://github.com/muxinc/elements/compare/@mux-elements/mux-player-react@0.1.0-beta.18...@mux-elements/mux-player-react@0.1.0-beta.19) (2022-06-07)
|
|
296
|
+
|
|
297
|
+
**Note:** Version bump only for package @mux-elements/mux-player-react
|
|
298
|
+
|
|
299
|
+
# [0.1.0-beta.18](https://github.com/muxinc/elements/compare/@mux-elements/mux-player-react@0.1.0-beta.17...@mux-elements/mux-player-react@0.1.0-beta.18) (2022-06-06)
|
|
300
|
+
|
|
301
|
+
### Features
|
|
302
|
+
|
|
303
|
+
- **mux-player-react:** Add audio only. Cleanup StreamTypes source of truth. ([4f37d7f](https://github.com/muxinc/elements/commit/4f37d7f10ef66eef48af0dd9cf1efc79322b660d))
|
|
304
|
+
|
|
305
|
+
# [0.1.0-beta.17](https://github.com/muxinc/elements/compare/@mux-elements/mux-player-react@0.1.0-beta.16...@mux-elements/mux-player-react@0.1.0-beta.17) (2022-05-26)
|
|
306
|
+
|
|
307
|
+
**Note:** Version bump only for package @mux-elements/mux-player-react
|
|
308
|
+
|
|
309
|
+
# [0.1.0-beta.16](https://github.com/muxinc/elements/compare/@mux-elements/mux-player-react@0.1.0-beta.15...@mux-elements/mux-player-react@0.1.0-beta.16) (2022-05-23)
|
|
310
|
+
|
|
311
|
+
**Note:** Version bump only for package @mux-elements/mux-player-react
|
|
312
|
+
|
|
313
|
+
# [0.1.0-beta.15](https://github.com/muxinc/elements/compare/@mux-elements/mux-player-react@0.1.0-beta.14...@mux-elements/mux-player-react@0.1.0-beta.15) (2022-05-23)
|
|
314
|
+
|
|
315
|
+
**Note:** Version bump only for package @mux-elements/mux-player-react
|
|
316
|
+
|
|
317
|
+
# [0.1.0-beta.14](https://github.com/muxinc/elements/compare/@mux-elements/mux-player-react@0.1.0-beta.13...@mux-elements/mux-player-react@0.1.0-beta.14) (2022-05-20)
|
|
318
|
+
|
|
319
|
+
### Bug Fixes
|
|
320
|
+
|
|
321
|
+
- switch cjs extension to .cjs.js ([30e83c3](https://github.com/muxinc/elements/commit/30e83c3ce0bd9bfda4817c30ffe0921e425619e4))
|
|
322
|
+
|
|
323
|
+
# [0.1.0-beta.13](https://github.com/muxinc/elements/compare/@mux-elements/mux-player-react@0.1.0-beta.12...@mux-elements/mux-player-react@0.1.0-beta.13) (2022-05-19)
|
|
324
|
+
|
|
325
|
+
**Note:** Version bump only for package @mux-elements/mux-player-react
|
|
326
|
+
|
|
327
|
+
# [0.1.0-beta.12](https://github.com/muxinc/elements/compare/@mux-elements/mux-player-react@0.1.0-beta.11...@mux-elements/mux-player-react@0.1.0-beta.12) (2022-05-12)
|
|
328
|
+
|
|
329
|
+
**Note:** Version bump only for package @mux-elements/mux-player-react
|
|
330
|
+
|
|
331
|
+
# [0.1.0-beta.11](https://github.com/muxinc/elements/compare/@mux-elements/mux-player-react@0.1.0-beta.10...@mux-elements/mux-player-react@0.1.0-beta.11) (2022-05-11)
|
|
332
|
+
|
|
333
|
+
### Bug Fixes
|
|
334
|
+
|
|
335
|
+
- **mux-player-react:** Missing preload prop type def. ([19b2e15](https://github.com/muxinc/elements/commit/19b2e15dc844e6fb0f90e9ad62a436587260094a))
|
|
336
|
+
|
|
337
|
+
### Features
|
|
338
|
+
|
|
339
|
+
- **mux-player-react:** Add thumbnail-time support to mux-player-react. Document prop. ([d1c1a4c](https://github.com/muxinc/elements/commit/d1c1a4c65b200c59bab7cc68453c0e307eb75ae4))
|
|
340
|
+
|
|
341
|
+
# [0.1.0-beta.10](https://github.com/muxinc/elements/compare/@mux-elements/mux-player-react@0.1.0-beta.9...@mux-elements/mux-player-react@0.1.0-beta.10) (2022-05-10)
|
|
342
|
+
|
|
343
|
+
**Note:** Version bump only for package @mux-elements/mux-player-react
|
|
344
|
+
|
|
345
|
+
# [0.1.0-beta.9](https://github.com/muxinc/elements/compare/@mux-elements/mux-player-react@0.1.0-beta.8...@mux-elements/mux-player-react@0.1.0-beta.9) (2022-05-03)
|
|
346
|
+
|
|
347
|
+
**Note:** Version bump only for package @mux-elements/mux-player-react
|
|
348
|
+
|
|
349
|
+
# [0.1.0-beta.8](https://github.com/muxinc/elements/compare/@mux-elements/mux-player-react@0.1.0-beta.7...@mux-elements/mux-player-react@0.1.0-beta.8) (2022-04-22)
|
|
350
|
+
|
|
351
|
+
**Note:** Version bump only for package @mux-elements/mux-player-react
|
|
352
|
+
|
|
353
|
+
# [0.1.0-beta.7](https://github.com/muxinc/elements/compare/@mux-elements/mux-player-react@0.1.0-beta.6...@mux-elements/mux-player-react@0.1.0-beta.7) (2022-04-18)
|
|
354
|
+
|
|
355
|
+
**Note:** Version bump only for package @mux-elements/mux-player-react
|
|
356
|
+
|
|
357
|
+
# [0.1.0-beta.6](https://github.com/muxinc/elements/compare/@mux-elements/mux-player-react@0.1.0-beta.5...@mux-elements/mux-player-react@0.1.0-beta.6) (2022-04-13)
|
|
358
|
+
|
|
359
|
+
**Note:** Version bump only for package @mux-elements/mux-player-react
|
|
360
|
+
|
|
361
|
+
# [0.1.0-beta.5](https://github.com/muxinc/elements/compare/@mux-elements/mux-player-react@0.1.0-beta.4...@mux-elements/mux-player-react@0.1.0-beta.5) (2022-04-12)
|
|
362
|
+
|
|
363
|
+
**Note:** Version bump only for package @mux-elements/mux-player-react
|
|
364
|
+
|
|
365
|
+
# [0.1.0-beta.4](https://github.com/muxinc/elements/compare/@mux-elements/mux-player-react@0.1.0-beta.3...@mux-elements/mux-player-react@0.1.0-beta.4) (2022-04-08)
|
|
366
|
+
|
|
367
|
+
**Note:** Version bump only for package @mux-elements/mux-player-react
|
|
368
|
+
|
|
369
|
+
# [0.1.0-beta.3](https://github.com/muxinc/elements/compare/@mux-elements/mux-player-react@0.1.0-beta.2...@mux-elements/mux-player-react@0.1.0-beta.3) (2022-04-01)
|
|
370
|
+
|
|
371
|
+
**Note:** Version bump only for package @mux-elements/mux-player-react
|
|
372
|
+
|
|
373
|
+
# [0.1.0-beta.2](https://github.com/muxinc/elements/compare/@mux-elements/mux-player-react@0.1.0-beta.1...@mux-elements/mux-player-react@0.1.0-beta.2) (2022-04-01)
|
|
374
|
+
|
|
375
|
+
### Reverts
|
|
376
|
+
|
|
377
|
+
- Revert "Publish" ([42fc528](https://github.com/muxinc/elements/commit/42fc528216346ff52d967cec5392a1191f74a1c0))
|
|
378
|
+
|
|
379
|
+
# [0.1.0-beta.1](https://github.com/muxinc/elements/compare/@mux-elements/mux-player-react@0.1.0-beta.0...@mux-elements/mux-player-react@0.1.0-beta.1) (2022-03-28)
|
|
380
|
+
|
|
381
|
+
### Bug Fixes
|
|
382
|
+
|
|
383
|
+
- prettier format all elements files ([741d607](https://github.com/muxinc/elements/commit/741d607521ca9578cfad9f0a9216a6565b4c56a1))
|
|
384
|
+
|
|
385
|
+
### Features
|
|
386
|
+
|
|
387
|
+
- add beaconCollectionDomain option to replace beaconDomain ([a44b699](https://github.com/muxinc/elements/commit/a44b699ae3138590b9d953f693f95971694658df))
|
|
@@ -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,n)=>_(n)?!1:e in n,J=e=>e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Y=(e,n)=>{if(!(typeof n=="boolean"&&!n)){if(q(e,d))return d[e];if(typeof n!=null)return/[A-Z]/.test(e)?J(e):e}};var $=(e,n)=>typeof e=="boolean"?"":e,c=(e={})=>Object.entries(e).reduce((n,[t,o])=>{let a=Y(t,o);if(!a)return n;let i=$(o,t);return n[a]=i,n},{});import{useRef as se}from"react";import{useEffect as Q,useRef as X}from"react";var m=(...e)=>{let n=X(null);return Q(()=>{e.forEach(t=>{!t||(typeof t=="function"?t(n.current):t.current=n.current)})},[e]),n};import{useEffect as B}from"react";var ee=Object.prototype.hasOwnProperty,ne=(e,n)=>{if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.some((a,i)=>n[i]===a);let t=Object.keys(e),o=Object.keys(n);if(t.length!==o.length)return!1;for(let a=0;a<t.length;a++)if(!ee.call(n,t[a])||!Object.is(e[t[a]],n[t[a]]))return!1;return!0},p=(e,n,t)=>!ne(n,e[t]),te=(e,n,t)=>{e[t]=n},re=(e,n,t,o=te,a=p)=>B(()=>{let i=t==null?void 0:t.current;!i||!a(i,n,e)||o(i,n,e)},[t==null?void 0:t.current,n]),l=re;var ae=()=>{try{return"1.11.0"}catch{}return"UNKNOWN"},oe=ae(),E=()=>oe;var le=y.forwardRef(({children:e,...n},t)=>y.createElement("mux-player",c({...n,ref:t}),e)),r=(e,n,t)=>ie(()=>{let o=n==null?void 0:n.current;if(!(!o||!t))return o.addEventListener(e,t),()=>{o.removeEventListener(e,t)}},[n==null?void 0:n.current,t]),ue=(e,n)=>{let{onAbort:t,onCanPlay:o,onCanPlayThrough:a,onEmptied:i,onLoadStart:g,onLoadedData: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}=n;return l("playbackRates",j,e),l("metadata",K,e),l("themeProps",F,e),l("tokens",D,e),l("playbackId",H,e),l("paused",U,e,(s,u)=>{u!=null&&(u?s.pause():s.play())},(s,u,Z)=>s.hasAttribute("autoplay")&&!s.hasPlayed?!1:p(s,u,Z)),l("currentTime",z,e,(s,u)=>{u!=null&&(s.currentTime=u)}),r("abort",e,t),r("canplay",e,o),r("canplaythrough",e,a),r("emptied",e,i),r("loadstart",e,g),r("loadeddata",e,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,n)=>{let t=se(null),o=m(t,n),[a]=ue(t,e);return y.createElement(le,{ref:o,playerSoftwareName:pe,playerSoftwareVersion:ye,...a})}),Ce=de;export{be as MediaError,Ce as default};
|
|
2
|
+
//# sourceMappingURL=-2IT5KXF6.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 noVolumePref?: boolean;\n thumbnailTime?: number;\n title?: string;\n tokens?: Tokens;\n theme?: string;\n themeProps?: { [k: string]: any };\n onAbort?: GenericEventListener<MuxPlayerElementEventMap['abort']>;\n onCanPlay?: GenericEventListener<MuxPlayerElementEventMap['canplay']>;\n onCanPlayThrough?: GenericEventListener<MuxPlayerElementEventMap['canplaythrough']>;\n onEmptied?: GenericEventListener<MuxPlayerElementEventMap['emptied']>;\n onLoadStart?: GenericEventListener<MuxPlayerElementEventMap['loadstart']>;\n onLoadedData?: GenericEventListener<MuxPlayerElementEventMap['loadeddata']>;\n onLoadedMetadata?: GenericEventListener<MuxPlayerElementEventMap['loadedmetadata']>;\n onProgress?: GenericEventListener<MuxPlayerElementEventMap['progress']>;\n onDurationChange?: GenericEventListener<MuxPlayerElementEventMap['durationchange']>;\n onVolumeChange?: GenericEventListener<MuxPlayerElementEventMap['volumechange']>;\n onRateChange?: GenericEventListener<MuxPlayerElementEventMap['ratechange']>;\n onResize?: GenericEventListener<MuxPlayerElementEventMap['resize']>;\n onWaiting?: GenericEventListener<MuxPlayerElementEventMap['waiting']>;\n onPlay?: GenericEventListener<MuxPlayerElementEventMap['play']>;\n onPlaying?: GenericEventListener<MuxPlayerElementEventMap['playing']>;\n onTimeUpdate?: GenericEventListener<MuxPlayerElementEventMap['timeupdate']>;\n onPause?: GenericEventListener<MuxPlayerElementEventMap['pause']>;\n onSeeking?: GenericEventListener<MuxPlayerElementEventMap['seeking']>;\n onSeeked?: GenericEventListener<MuxPlayerElementEventMap['seeked']>;\n onStalled?: GenericEventListener<MuxPlayerElementEventMap['stalled']>;\n onSuspend?: GenericEventListener<MuxPlayerElementEventMap['suspend']>;\n onEnded?: GenericEventListener<MuxPlayerElementEventMap['ended']>;\n onError?: GenericEventListener<MuxPlayerElementEventMap['error']>;\n onCuePointChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointchange']>;\n onCuePointsChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointschange']>;\n // onPlayerReady?: EventListener;\n} & Partial<MuxMediaPropTypes> &\n Partial<VideoApiAttributes>;\n\nconst MuxPlayerInternal = React.forwardRef<MuxPlayerRefAttributes, MuxPlayerProps>(({ children, ...props }, ref) => {\n return React.createElement('mux-player', toNativeProps({ ...props, ref }), children);\n});\n\nconst useEventCallbackEffect = <K extends keyof MuxPlayerElementEventMap>(\n type: K,\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n callback: GenericEventListener<MuxPlayerElementEventMap[K]> | undefined\n) => {\n return useEffect(() => {\n const eventTarget = ref?.current;\n if (!eventTarget || !callback) return;\n eventTarget.addEventListener(type, callback);\n return () => {\n eventTarget.removeEventListener(type, callback);\n };\n }, [ref?.current, callback]);\n};\n\nconst usePlayer = (\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n props: MuxPlayerProps\n) => {\n const {\n onAbort,\n onCanPlay,\n onCanPlayThrough,\n onEmptied,\n onLoadStart,\n onLoadedData,\n onLoadedMetadata,\n onProgress,\n onDurationChange,\n onVolumeChange,\n onRateChange,\n onResize,\n onWaiting,\n onPlay,\n onPlaying,\n onTimeUpdate,\n onPause,\n onSeeking,\n onSeeked,\n onStalled,\n onSuspend,\n onEnded,\n onError,\n onCuePointChange,\n onCuePointsChange,\n // onPlayerReady,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n currentTime,\n themeProps,\n ...remainingProps\n } = props;\n useObjectPropEffect('playbackRates', playbackRates, ref);\n useObjectPropEffect('metadata', metadata, ref);\n useObjectPropEffect('themeProps', themeProps, ref);\n useObjectPropEffect('tokens', tokens, ref);\n useObjectPropEffect('playbackId', playbackId, ref);\n useObjectPropEffect(\n 'paused',\n paused,\n ref,\n (playerEl: HTMLMediaElement, pausedVal?: boolean) => {\n if (pausedVal == null) return;\n if (pausedVal) {\n playerEl.pause();\n } else {\n playerEl.play();\n }\n },\n (playerEl, value, propName) => {\n if (playerEl.hasAttribute('autoplay') && !playerEl.hasPlayed) {\n return false;\n }\n return defaultHasChanged(playerEl, value, propName);\n }\n );\n useObjectPropEffect('currentTime', currentTime, ref, (playerEl: HTMLMediaElement, currentTimeVal?: number) => {\n if (currentTimeVal == null) return;\n playerEl.currentTime = currentTimeVal;\n });\n useEventCallbackEffect('abort', ref, onAbort);\n useEventCallbackEffect('canplay', ref, onCanPlay);\n useEventCallbackEffect('canplaythrough', ref, onCanPlayThrough);\n useEventCallbackEffect('emptied', ref, onEmptied);\n useEventCallbackEffect('loadstart', ref, onLoadStart);\n useEventCallbackEffect('loadeddata', ref, onLoadedData);\n useEventCallbackEffect('loadedmetadata', ref, onLoadedMetadata);\n useEventCallbackEffect('progress', ref, onProgress);\n useEventCallbackEffect('durationchange', ref, onDurationChange);\n useEventCallbackEffect('volumechange', ref, onVolumeChange);\n useEventCallbackEffect('ratechange', ref, onRateChange);\n useEventCallbackEffect('resize', ref, onResize);\n useEventCallbackEffect('waiting', ref, onWaiting);\n useEventCallbackEffect('play', ref, onPlay);\n useEventCallbackEffect('playing', ref, onPlaying);\n useEventCallbackEffect('timeupdate', ref, onTimeUpdate);\n useEventCallbackEffect('pause', ref, onPause);\n useEventCallbackEffect('seeking', ref, onSeeking);\n useEventCallbackEffect('seeked', ref, onSeeked);\n useEventCallbackEffect('stalled', ref, onStalled);\n useEventCallbackEffect('suspend', ref, onSuspend);\n useEventCallbackEffect('ended', ref, onEnded);\n useEventCallbackEffect('error', ref, onError);\n useEventCallbackEffect('cuepointchange', ref, onCuePointChange);\n useEventCallbackEffect('cuepointschange', ref, onCuePointsChange);\n // useEventCallbackEffect('playerready', ref, onPlayerReady);\n return [remainingProps];\n};\n\nconst playerSoftwareVersion = getPlayerVersion();\nconst playerSoftwareName = 'mux-player-react';\n\nconst MuxPlayer = React.forwardRef<\n MuxPlayerRefAttributes,\n Omit<MuxPlayerProps, 'playerSoftwareVersion' | 'playerSoftwareName'>\n>((props, ref) => {\n const innerPlayerRef = useRef<MuxPlayerElement>(null);\n const playerRef = useCombinedRefs(innerPlayerRef, ref);\n const [remainingProps] = usePlayer(innerPlayerRef, props);\n\n return (\n <MuxPlayerInternal\n /** @TODO Fix types relationships (CJP) */\n ref={playerRef as typeof innerPlayerRef}\n playerSoftwareName={playerSoftwareName}\n playerSoftwareVersion={playerSoftwareVersion}\n {...remainingProps}\n />\n );\n});\n\nexport default MuxPlayer;\n", "// NOTE: As a forward-looking implementation, we may want to assume\n// prop names -> attribute names is always a simple name.toLowerCase()\n// and provide a mechanism for passing in per-component overrides for\n// e.g. kebab cases, as that's the way React/Preact handles these. (CJP)\nconst ReactPropToAttrNameMap = {\n className: 'class',\n classname: 'class',\n htmlFor: 'for',\n crossOrigin: 'crossorigin',\n viewBox: 'viewBox',\n playsInline: 'playsinline',\n autoPlay: 'autoplay',\n playbackRate: 'playbackrate',\n};\n\ntype KeyTypes = string | number | symbol;\ntype Maybe<T> = T | null | undefined;\n\nexport const isNil = (x: unknown): x is null | undefined => x == undefined;\n\n// Type Guard to determine if a given key is actually a key of some object of type T\nexport const isKeyOf = <T extends {} = any>(k: KeyTypes, o: Maybe<T>): k is keyof T => {\n if (isNil(o)) return false;\n return k in o;\n};\n\nconst toKebabCase = (string: string) => string.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);\n\nexport const toNativeAttrName = (propName: string, propValue: any): string | undefined => {\n if (typeof propValue === 'boolean' && !propValue) return undefined;\n if (isKeyOf(propName, ReactPropToAttrNameMap)) return ReactPropToAttrNameMap[propName];\n if (typeof propValue == undefined) return undefined;\n if (/[A-Z]/.test(propName)) return toKebabCase(propName);\n return propName;\n};\nexport const toStyleAttr = <T>(x: T) => x;\n\nexport const toNativeAttrValue = (propValue: any, propName: string) => {\n if (typeof propValue === 'boolean') return '';\n return propValue;\n};\n\nexport const toNativeProps = (props = {}) => {\n return Object.entries(props).reduce<{ [k: string]: string }>((transformedProps, [propName, propValue]) => {\n const attrName = toNativeAttrName(propName, propValue);\n\n // prop was stripped. Don't add.\n if (!attrName) {\n return transformedProps;\n }\n\n const attrValue = toNativeAttrValue(propValue, propName);\n transformedProps[attrName] = attrValue;\n return transformedProps;\n }, {});\n};\n", "import { useEffect, useRef } from 'react';\nimport type { MutableRefObject, ForwardedRef } from 'react';\n\ntype Maybe<T> = T | null | undefined;\ntype RefCb<T> = (instance: Maybe<T>) => void;\ntype RefObj<T> = MutableRefObject<Maybe<T>>;\ntype RefTypes<T> = RefObj<T> | RefCb<T> | ForwardedRef<T>;\ninterface useCombinedRefs {\n <T>(...refs: Maybe<RefTypes<T>>[]): RefObj<T>;\n}\n\nexport const useCombinedRefs: useCombinedRefs = (...refs) => {\n const targetRef = useRef(null);\n\n useEffect(() => {\n refs.forEach((ref) => {\n if (!ref) return;\n\n if (typeof ref === 'function') {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n });\n }, [refs]);\n\n return targetRef;\n};\n\n// TS assumed default export was interface def instead of function value (CJP)\nconst defaultUseCombinedRefs = useCombinedRefs;\nexport default defaultUseCombinedRefs;\n", "import { useEffect } from 'react';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Slightly modified version of React's shallowEqual, with optimizations for Arrays\n * so we may treat them specifically as unequal if they are not a) both arrays\n * or b) don't contain the same (shallowly compared) elements.\n */\nconst shallowEqual = (objA: any, objB: any): boolean => {\n if (Object.is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n if (Array.isArray(objA)) {\n // Early \"cheap\" array compares\n if (!Array.isArray(objB) || objA.length !== objB.length) return false;\n // Shallow compare for arrays\n return objA.some((vVal, i) => objB[i] === vVal);\n }\n\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (let i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const defaultHasChanged = (obj: any, v: any, k: string) => {\n return !shallowEqual(v, obj[k]);\n};\n\nconst defaultUpdateValue = (obj: any, v: any, k: string) => {\n obj[k] = v;\n};\n\nexport const useObjectPropEffect = <T extends { [k: string]: any }, V>(\n propName: string,\n propValue: V | null | undefined,\n ref: React.MutableRefObject<T | null> | null | undefined,\n updateValue = defaultUpdateValue,\n hasChanged = defaultHasChanged\n) => {\n return useEffect(() => {\n const obj = ref?.current;\n if (!obj) return;\n if (!hasChanged(obj, propValue, propName)) return;\n updateValue(obj, propValue, propName);\n }, [ref?.current, propValue]);\n};\n\nexport default useObjectPropEffect;\n", "const getEnvPlayerVersion = () => {\n try {\n // @ts-ignore\n return PLAYER_VERSION as string;\n } catch {}\n return 'UNKNOWN';\n};\n\nconst player_version: string = getEnvPlayerVersion();\n\nexport const getPlayerVersion = () => player_version;\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,GAAS,aAAAC,OAAiB,QAGjC,OAAS,cAAAC,OAAkB,kBCC3B,IAAMC,EAAyB,CAC7B,UAAW,QACX,UAAW,QACX,QAAS,MACT,YAAa,cACb,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,IAAMC,EAAYH,EAAO,IAAI,EAE7B,O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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
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"inputs": {
|
|
3
|
+
"src/common/utils.ts": {
|
|
4
|
+
"bytes": 2048,
|
|
5
|
+
"imports": []
|
|
6
|
+
},
|
|
7
|
+
"src/useCombinedRefs.ts": {
|
|
8
|
+
"bytes": 892,
|
|
9
|
+
"imports": []
|
|
10
|
+
},
|
|
11
|
+
"src/useObjectPropEffect.ts": {
|
|
12
|
+
"bytes": 1850,
|
|
13
|
+
"imports": []
|
|
14
|
+
},
|
|
15
|
+
"src/env.ts": {
|
|
16
|
+
"bytes": 245,
|
|
17
|
+
"imports": []
|
|
18
|
+
},
|
|
19
|
+
"src/index.tsx": {
|
|
20
|
+
"bytes": 9249,
|
|
21
|
+
"imports": [
|
|
22
|
+
{
|
|
23
|
+
"path": "src/common/utils.ts",
|
|
24
|
+
"kind": "import-statement"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"path": "src/useCombinedRefs.ts",
|
|
28
|
+
"kind": "import-statement"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"path": "src/useObjectPropEffect.ts",
|
|
32
|
+
"kind": "import-statement"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"path": "src/env.ts",
|
|
36
|
+
"kind": "import-statement"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"outputs": {
|
|
42
|
+
"dist/index.cjs.js.map": {
|
|
43
|
+
"imports": [],
|
|
44
|
+
"exports": [],
|
|
45
|
+
"inputs": {},
|
|
46
|
+
"bytes": 21158
|
|
47
|
+
},
|
|
48
|
+
"dist/index.cjs.js": {
|
|
49
|
+
"imports": [],
|
|
50
|
+
"exports": [],
|
|
51
|
+
"entryPoint": "src/index.tsx",
|
|
52
|
+
"inputs": {
|
|
53
|
+
"src/index.tsx": {
|
|
54
|
+
"bytesInOutput": 1850
|
|
55
|
+
},
|
|
56
|
+
"src/common/utils.ts": {
|
|
57
|
+
"bytesInOutput": 532
|
|
58
|
+
},
|
|
59
|
+
"src/useCombinedRefs.ts": {
|
|
60
|
+
"bytesInOutput": 171
|
|
61
|
+
},
|
|
62
|
+
"src/useObjectPropEffect.ts": {
|
|
63
|
+
"bytesInOutput": 601
|
|
64
|
+
},
|
|
65
|
+
"src/env.ts": {
|
|
66
|
+
"bytesInOutput": 72
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"bytes": 3844
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
package/dist/esm.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"inputs": {
|
|
3
|
+
"src/common/utils.ts": {
|
|
4
|
+
"bytes": 2048,
|
|
5
|
+
"imports": []
|
|
6
|
+
},
|
|
7
|
+
"src/useCombinedRefs.ts": {
|
|
8
|
+
"bytes": 892,
|
|
9
|
+
"imports": []
|
|
10
|
+
},
|
|
11
|
+
"src/useObjectPropEffect.ts": {
|
|
12
|
+
"bytes": 1850,
|
|
13
|
+
"imports": []
|
|
14
|
+
},
|
|
15
|
+
"src/env.ts": {
|
|
16
|
+
"bytes": 245,
|
|
17
|
+
"imports": []
|
|
18
|
+
},
|
|
19
|
+
"src/index.tsx": {
|
|
20
|
+
"bytes": 9249,
|
|
21
|
+
"imports": [
|
|
22
|
+
{
|
|
23
|
+
"path": "src/common/utils.ts",
|
|
24
|
+
"kind": "import-statement"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"path": "src/useCombinedRefs.ts",
|
|
28
|
+
"kind": "import-statement"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"path": "src/useObjectPropEffect.ts",
|
|
32
|
+
"kind": "import-statement"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"path": "src/env.ts",
|
|
36
|
+
"kind": "import-statement"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"outputs": {
|
|
42
|
+
"dist/index.mjs.map": {
|
|
43
|
+
"imports": [],
|
|
44
|
+
"exports": [],
|
|
45
|
+
"inputs": {},
|
|
46
|
+
"bytes": 21104
|
|
47
|
+
},
|
|
48
|
+
"dist/index.mjs": {
|
|
49
|
+
"imports": [],
|
|
50
|
+
"exports": [
|
|
51
|
+
"MediaError",
|
|
52
|
+
"default"
|
|
53
|
+
],
|
|
54
|
+
"entryPoint": "src/index.tsx",
|
|
55
|
+
"inputs": {
|
|
56
|
+
"src/index.tsx": {
|
|
57
|
+
"bytesInOutput": 1748
|
|
58
|
+
},
|
|
59
|
+
"src/common/utils.ts": {
|
|
60
|
+
"bytesInOutput": 522
|
|
61
|
+
},
|
|
62
|
+
"src/useCombinedRefs.ts": {
|
|
63
|
+
"bytesInOutput": 174
|
|
64
|
+
},
|
|
65
|
+
"src/useObjectPropEffect.ts": {
|
|
66
|
+
"bytesInOutput": 602
|
|
67
|
+
},
|
|
68
|
+
"src/env.ts": {
|
|
69
|
+
"bytesInOutput": 72
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"bytes": 3193
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
package/dist/esm.lazy.json
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"imports": []
|
|
30
30
|
},
|
|
31
31
|
"src/index.tsx": {
|
|
32
|
-
"bytes":
|
|
32
|
+
"bytes": 9249,
|
|
33
33
|
"imports": [
|
|
34
34
|
{
|
|
35
35
|
"path": "src/common/utils.ts",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"dist/lazy.mjs": {
|
|
82
82
|
"imports": [
|
|
83
83
|
{
|
|
84
|
-
"path": "dist/-
|
|
84
|
+
"path": "dist/-2IT5KXF6.mjs",
|
|
85
85
|
"kind": "dynamic-import"
|
|
86
86
|
}
|
|
87
87
|
],
|
|
@@ -105,13 +105,13 @@
|
|
|
105
105
|
},
|
|
106
106
|
"bytes": 2304
|
|
107
107
|
},
|
|
108
|
-
"dist/-
|
|
108
|
+
"dist/-2IT5KXF6.mjs.map": {
|
|
109
109
|
"imports": [],
|
|
110
110
|
"exports": [],
|
|
111
111
|
"inputs": {},
|
|
112
|
-
"bytes":
|
|
112
|
+
"bytes": 21104
|
|
113
113
|
},
|
|
114
|
-
"dist/-
|
|
114
|
+
"dist/-2IT5KXF6.mjs": {
|
|
115
115
|
"imports": [],
|
|
116
116
|
"exports": [
|
|
117
117
|
"MediaError",
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var X=Object.create;var p=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var
|
|
1
|
+
"use strict";var X=Object.create;var p=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var ne=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty;var re=(e,n)=>{for(var t in n)p(e,t,{get:n[t],enumerable:!0})},m=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of ee(n))!te.call(e,a)&&a!==t&&p(e,a,{get:()=>n[a],enumerable:!(o=B(n,a))||o.enumerable});return e};var ae=(e,n,t)=>(t=e!=null?X(ne(e)):{},m(n||!e||!e.__esModule?p(t,"default",{value:e,enumerable:!0}):t,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,n)=>ie(n)?!1:e in n,le=e=>e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),ue=(e,n)=>{if(!(typeof n=="boolean"&&!n)){if(se(e,E))return E[e];if(typeof n!=null)return/[A-Z]/.test(e)?le(e):e}};var ye=(e,n)=>typeof e=="boolean"?"":e,g=(e={})=>Object.entries(e).reduce((n,[t,o])=>{let a=ue(t,o);if(!a)return n;let i=ye(o,t);return n[a]=i,n},{});var b=require("react");var d=require("react"),f=(...e)=>{let n=(0,d.useRef)(null);return(0,d.useEffect)(()=>{e.forEach(t=>{!t||(typeof t=="function"?t(n.current):t.current=n.current)})},[e]),n};var M=require("react"),pe=Object.prototype.hasOwnProperty,de=(e,n)=>{if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.some((a,i)=>n[i]===a);let t=Object.keys(e),o=Object.keys(n);if(t.length!==o.length)return!1;for(let a=0;a<t.length;a++)if(!pe.call(n,t[a])||!Object.is(e[t[a]],n[t[a]]))return!1;return!0},c=(e,n,t)=>!de(n,e[t]),ce=(e,n,t)=>{e[t]=n},me=(e,n,t,o=ce,a=c)=>(0,M.useEffect)(()=>{let i=t==null?void 0:t.current;!i||!a(i,n,e)||o(i,n,e)},[t==null?void 0:t.current,n]),l=me;var Ee=()=>{try{return"1.11.0"}catch{}return"UNKNOWN"},ge=Ee(),P=()=>ge;var fe=y.default.forwardRef(({children:e,...n},t)=>y.default.createElement("mux-player",g({...n,ref:t}),e)),r=(e,n,t)=>(0,y.useEffect)(()=>{let o=n==null?void 0:n.current;if(!(!o||!t))return o.addEventListener(e,t),()=>{o.removeEventListener(e,t)}},[n==null?void 0:n.current,t]),Me=(e,n)=>{let{onAbort:t,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,...$}=n;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,t),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,n)=>{let t=(0,b.useRef)(null),o=f(t,n),[a]=Me(t,e);return y.default.createElement(fe,{ref:o,playerSoftwareName:ve,playerSoftwareVersion:Pe,...a})}),xe=be;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.tsx", "../src/common/utils.ts", "../src/useCombinedRefs.ts", "../src/useObjectPropEffect.ts", "../src/env.ts"],
|
|
4
|
-
"sourcesContent": ["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": "mkBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,yCAAAE,KAAA,eAAAC,GAAAH,IAAA,IAAAI,EAAiC,qBAGjCC,EAA2B,2BCC3B,IAAMC,EAAyB,CAC7B,UAAW,QACX,UAAW,QACX,QAAS,MACT,YAAa,cACb,QAAS,UACT,YAAa,cACb,SAAU,WACV,aAAc,cAChB,EAKaC,GAASC,GAAsCA,GAAK,KAGpDC,GAAU,CAAqBC,EAAaC,IACnDJ,GAAMI,CAAC,EAAU,GACdD,KAAKC,EAGRC,GAAeC,GAAmBA,EAAO,QAAQ,SAAWC,GAAU,IAAIA,EAAM,YAAY,GAAG,EAExFC,GAAmB,CAACC,EAAkBC,IAAuC,CACxF,GAAI,SAAOA,GAAc,WAAa,CAACA,GACvC,IAAIR,GAAQO,EAAUV,CAAsB,EAAG,OAAOA,EAAuBU,G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zB,MAAO,GAIT,QAASC,EAAI,EAAGA,EAAIF,EAAM,OAAQE,IAChC,GAAI,CAACP,GAAe,KAAKG,EAAME,EAAME,EAAE,GAAK,CAAC,OAAO,GAAGL,EAAKG,EAAME,IAAKJ,EAAKE,EAAME,GAAG,EACnF,MAAO,GAIX,MAAO,EACT,EAEaC,EAAoB,CAACC,EAAUC,EAAQC,IAC3C,CAACV,GAAaS,EAAGD,EAAIE,EAAE,EAG1BC,GAAqB,CAACH,EAAUC,EAAQC,IAAc,CAC1DF,EAAIE,GAAKD,CACX,EAEaG,GAAsB,CACjCC,EACAC,EACAC,EACAC,EAAcL,GACdM,EAAaV,OAEN,aAAU,IAAM,CACrB,IAAMC,EAAMO,GAAA,YAAAA,EAAK,QACb,CAACP,GACD,CAACS,EAAWT,EAAKM,EAAWD,CAAQ,GACxCG,EAAYR,EAAKM,EAAWD,CAAQ,CACtC,EAAG,CAACE,GAAA,YAAAA,EAAK,QAASD,CAAS,CAAC,EAGvBI,EAAQN,GCjEf,IAAMO,GAAsB,IAAM,CAChC,GAAI,CAEF,MAAO,QACT,MAAE,CAAO,CACT,MAAO,SACT,EAEMC,GAAyBD,GAAoB,EAEtCE,EAAmB,IAAMD,
|
|
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 noVolumePref?: boolean;\n thumbnailTime?: number;\n title?: string;\n tokens?: Tokens;\n theme?: string;\n themeProps?: { [k: string]: any };\n onAbort?: GenericEventListener<MuxPlayerElementEventMap['abort']>;\n onCanPlay?: GenericEventListener<MuxPlayerElementEventMap['canplay']>;\n onCanPlayThrough?: GenericEventListener<MuxPlayerElementEventMap['canplaythrough']>;\n onEmptied?: GenericEventListener<MuxPlayerElementEventMap['emptied']>;\n onLoadStart?: GenericEventListener<MuxPlayerElementEventMap['loadstart']>;\n onLoadedData?: GenericEventListener<MuxPlayerElementEventMap['loadeddata']>;\n onLoadedMetadata?: GenericEventListener<MuxPlayerElementEventMap['loadedmetadata']>;\n onProgress?: GenericEventListener<MuxPlayerElementEventMap['progress']>;\n onDurationChange?: GenericEventListener<MuxPlayerElementEventMap['durationchange']>;\n onVolumeChange?: GenericEventListener<MuxPlayerElementEventMap['volumechange']>;\n onRateChange?: GenericEventListener<MuxPlayerElementEventMap['ratechange']>;\n onResize?: GenericEventListener<MuxPlayerElementEventMap['resize']>;\n onWaiting?: GenericEventListener<MuxPlayerElementEventMap['waiting']>;\n onPlay?: GenericEventListener<MuxPlayerElementEventMap['play']>;\n onPlaying?: GenericEventListener<MuxPlayerElementEventMap['playing']>;\n onTimeUpdate?: GenericEventListener<MuxPlayerElementEventMap['timeupdate']>;\n onPause?: GenericEventListener<MuxPlayerElementEventMap['pause']>;\n onSeeking?: GenericEventListener<MuxPlayerElementEventMap['seeking']>;\n onSeeked?: GenericEventListener<MuxPlayerElementEventMap['seeked']>;\n onStalled?: GenericEventListener<MuxPlayerElementEventMap['stalled']>;\n onSuspend?: GenericEventListener<MuxPlayerElementEventMap['suspend']>;\n onEnded?: GenericEventListener<MuxPlayerElementEventMap['ended']>;\n onError?: GenericEventListener<MuxPlayerElementEventMap['error']>;\n onCuePointChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointchange']>;\n onCuePointsChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointschange']>;\n // onPlayerReady?: EventListener;\n} & Partial<MuxMediaPropTypes> &\n Partial<VideoApiAttributes>;\n\nconst MuxPlayerInternal = React.forwardRef<MuxPlayerRefAttributes, MuxPlayerProps>(({ children, ...props }, ref) => {\n return React.createElement('mux-player', toNativeProps({ ...props, ref }), children);\n});\n\nconst useEventCallbackEffect = <K extends keyof MuxPlayerElementEventMap>(\n type: K,\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n callback: GenericEventListener<MuxPlayerElementEventMap[K]> | undefined\n) => {\n return useEffect(() => {\n const eventTarget = ref?.current;\n if (!eventTarget || !callback) return;\n eventTarget.addEventListener(type, callback);\n return () => {\n eventTarget.removeEventListener(type, callback);\n };\n }, [ref?.current, callback]);\n};\n\nconst usePlayer = (\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n props: MuxPlayerProps\n) => {\n const {\n onAbort,\n onCanPlay,\n onCanPlayThrough,\n onEmptied,\n onLoadStart,\n onLoadedData,\n onLoadedMetadata,\n onProgress,\n onDurationChange,\n onVolumeChange,\n onRateChange,\n onResize,\n onWaiting,\n onPlay,\n onPlaying,\n onTimeUpdate,\n onPause,\n onSeeking,\n onSeeked,\n onStalled,\n onSuspend,\n onEnded,\n onError,\n onCuePointChange,\n onCuePointsChange,\n // onPlayerReady,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n currentTime,\n themeProps,\n ...remainingProps\n } = props;\n useObjectPropEffect('playbackRates', playbackRates, ref);\n useObjectPropEffect('metadata', metadata, ref);\n useObjectPropEffect('themeProps', themeProps, ref);\n useObjectPropEffect('tokens', tokens, ref);\n useObjectPropEffect('playbackId', playbackId, ref);\n useObjectPropEffect(\n 'paused',\n paused,\n ref,\n (playerEl: HTMLMediaElement, pausedVal?: boolean) => {\n if (pausedVal == null) return;\n if (pausedVal) {\n playerEl.pause();\n } else {\n playerEl.play();\n }\n },\n (playerEl, value, propName) => {\n if (playerEl.hasAttribute('autoplay') && !playerEl.hasPlayed) {\n return false;\n }\n return defaultHasChanged(playerEl, value, propName);\n }\n );\n useObjectPropEffect('currentTime', currentTime, ref, (playerEl: HTMLMediaElement, currentTimeVal?: number) => {\n if (currentTimeVal == null) return;\n playerEl.currentTime = currentTimeVal;\n });\n useEventCallbackEffect('abort', ref, onAbort);\n useEventCallbackEffect('canplay', ref, onCanPlay);\n useEventCallbackEffect('canplaythrough', ref, onCanPlayThrough);\n useEventCallbackEffect('emptied', ref, onEmptied);\n useEventCallbackEffect('loadstart', ref, onLoadStart);\n useEventCallbackEffect('loadeddata', ref, onLoadedData);\n useEventCallbackEffect('loadedmetadata', ref, onLoadedMetadata);\n useEventCallbackEffect('progress', ref, onProgress);\n useEventCallbackEffect('durationchange', ref, onDurationChange);\n useEventCallbackEffect('volumechange', ref, onVolumeChange);\n useEventCallbackEffect('ratechange', ref, onRateChange);\n useEventCallbackEffect('resize', ref, onResize);\n useEventCallbackEffect('waiting', ref, onWaiting);\n useEventCallbackEffect('play', ref, onPlay);\n useEventCallbackEffect('playing', ref, onPlaying);\n useEventCallbackEffect('timeupdate', ref, onTimeUpdate);\n useEventCallbackEffect('pause', ref, onPause);\n useEventCallbackEffect('seeking', ref, onSeeking);\n useEventCallbackEffect('seeked', ref, onSeeked);\n useEventCallbackEffect('stalled', ref, onStalled);\n useEventCallbackEffect('suspend', ref, onSuspend);\n useEventCallbackEffect('ended', ref, onEnded);\n useEventCallbackEffect('error', ref, onError);\n useEventCallbackEffect('cuepointchange', ref, onCuePointChange);\n useEventCallbackEffect('cuepointschange', ref, onCuePointsChange);\n // useEventCallbackEffect('playerready', ref, onPlayerReady);\n return [remainingProps];\n};\n\nconst playerSoftwareVersion = getPlayerVersion();\nconst playerSoftwareName = 'mux-player-react';\n\nconst MuxPlayer = React.forwardRef<\n MuxPlayerRefAttributes,\n Omit<MuxPlayerProps, 'playerSoftwareVersion' | 'playerSoftwareName'>\n>((props, ref) => {\n const innerPlayerRef = useRef<MuxPlayerElement>(null);\n const playerRef = useCombinedRefs(innerPlayerRef, ref);\n const [remainingProps] = usePlayer(innerPlayerRef, props);\n\n return (\n <MuxPlayerInternal\n /** @TODO Fix types relationships (CJP) */\n ref={playerRef as typeof innerPlayerRef}\n playerSoftwareName={playerSoftwareName}\n playerSoftwareVersion={playerSoftwareVersion}\n {...remainingProps}\n />\n );\n});\n\nexport default MuxPlayer;\n", "// NOTE: As a forward-looking implementation, we may want to assume\n// prop names -> attribute names is always a simple name.toLowerCase()\n// and provide a mechanism for passing in per-component overrides for\n// e.g. kebab cases, as that's the way React/Preact handles these. (CJP)\nconst ReactPropToAttrNameMap = {\n className: 'class',\n classname: 'class',\n htmlFor: 'for',\n crossOrigin: 'crossorigin',\n viewBox: 'viewBox',\n playsInline: 'playsinline',\n autoPlay: 'autoplay',\n playbackRate: 'playbackrate',\n};\n\ntype KeyTypes = string | number | symbol;\ntype Maybe<T> = T | null | undefined;\n\nexport const isNil = (x: unknown): x is null | undefined => x == undefined;\n\n// Type Guard to determine if a given key is actually a key of some object of type T\nexport const isKeyOf = <T extends {} = any>(k: KeyTypes, o: Maybe<T>): k is keyof T => {\n if (isNil(o)) return false;\n return k in o;\n};\n\nconst toKebabCase = (string: string) => string.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);\n\nexport const toNativeAttrName = (propName: string, propValue: any): string | undefined => {\n if (typeof propValue === 'boolean' && !propValue) return undefined;\n if (isKeyOf(propName, ReactPropToAttrNameMap)) return ReactPropToAttrNameMap[propName];\n if (typeof propValue == undefined) return undefined;\n if (/[A-Z]/.test(propName)) return toKebabCase(propName);\n return propName;\n};\nexport const toStyleAttr = <T>(x: T) => x;\n\nexport const toNativeAttrValue = (propValue: any, propName: string) => {\n if (typeof propValue === 'boolean') return '';\n return propValue;\n};\n\nexport const toNativeProps = (props = {}) => {\n return Object.entries(props).reduce<{ [k: string]: string }>((transformedProps, [propName, propValue]) => {\n const attrName = toNativeAttrName(propName, propValue);\n\n // prop was stripped. Don't add.\n if (!attrName) {\n return transformedProps;\n }\n\n const attrValue = toNativeAttrValue(propValue, propName);\n transformedProps[attrName] = attrValue;\n return transformedProps;\n }, {});\n};\n", "import { useEffect, useRef } from 'react';\nimport type { MutableRefObject, ForwardedRef } from 'react';\n\ntype Maybe<T> = T | null | undefined;\ntype RefCb<T> = (instance: Maybe<T>) => void;\ntype RefObj<T> = MutableRefObject<Maybe<T>>;\ntype RefTypes<T> = RefObj<T> | RefCb<T> | ForwardedRef<T>;\ninterface useCombinedRefs {\n <T>(...refs: Maybe<RefTypes<T>>[]): RefObj<T>;\n}\n\nexport const useCombinedRefs: useCombinedRefs = (...refs) => {\n const targetRef = useRef(null);\n\n useEffect(() => {\n refs.forEach((ref) => {\n if (!ref) return;\n\n if (typeof ref === 'function') {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n });\n }, [refs]);\n\n return targetRef;\n};\n\n// TS assumed default export was interface def instead of function value (CJP)\nconst defaultUseCombinedRefs = useCombinedRefs;\nexport default defaultUseCombinedRefs;\n", "import { useEffect } from 'react';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Slightly modified version of React's shallowEqual, with optimizations for Arrays\n * so we may treat them specifically as unequal if they are not a) both arrays\n * or b) don't contain the same (shallowly compared) elements.\n */\nconst shallowEqual = (objA: any, objB: any): boolean => {\n if (Object.is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n if (Array.isArray(objA)) {\n // Early \"cheap\" array compares\n if (!Array.isArray(objB) || objA.length !== objB.length) return false;\n // Shallow compare for arrays\n return objA.some((vVal, i) => objB[i] === vVal);\n }\n\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (let i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const defaultHasChanged = (obj: any, v: any, k: string) => {\n return !shallowEqual(v, obj[k]);\n};\n\nconst defaultUpdateValue = (obj: any, v: any, k: string) => {\n obj[k] = v;\n};\n\nexport const useObjectPropEffect = <T extends { [k: string]: any }, V>(\n propName: string,\n propValue: V | null | undefined,\n ref: React.MutableRefObject<T | null> | null | undefined,\n updateValue = defaultUpdateValue,\n hasChanged = defaultHasChanged\n) => {\n return useEffect(() => {\n const obj = ref?.current;\n if (!obj) return;\n if (!hasChanged(obj, propValue, propName)) return;\n updateValue(obj, propValue, propName);\n }, [ref?.current, propValue]);\n};\n\nexport default useObjectPropEffect;\n", "const getEnvPlayerVersion = () => {\n try {\n // @ts-ignore\n return PLAYER_VERSION as string;\n } catch {}\n return 'UNKNOWN';\n};\n\nconst player_version: string = getEnvPlayerVersion();\n\nexport const getPlayerVersion = () => player_version;\n"],
|
|
5
|
+
"mappings": "mkBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,yCAAAE,KAAA,eAAAC,GAAAH,IAAA,IAAAI,EAAiC,qBAGjCC,EAA2B,2BCC3B,IAAMC,EAAyB,CAC7B,UAAW,QACX,UAAW,QACX,QAAS,MACT,YAAa,cACb,QAAS,UACT,YAAa,cACb,SAAU,WACV,aAAc,cAChB,EAKaC,GAASC,GAAsCA,GAAK,KAGpDC,GAAU,CAAqBC,EAAaC,IACnDJ,GAAMI,CAAC,EAAU,GACdD,KAAKC,EAGRC,GAAeC,GAAmBA,EAAO,QAAQ,SAAWC,GAAU,IAAIA,EAAM,YAAY,GAAG,EAExFC,GAAmB,CAACC,EAAkBC,IAAuC,CACxF,GAAI,SAAOA,GAAc,WAAa,CAACA,GACvC,IAAIR,GAAQO,EAAUV,CAAsB,EAAG,OAAOA,EAAuBU,GAC7E,GAAI,OAAOC,GAAa,KACxB,MAAI,QAAQ,KAAKD,CAAQ,EAAUJ,GAAYI,CAAQ,EAChDA,EACT,EAGO,IAAME,GAAoB,CAACC,EAAgBC,IAC5C,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,EACv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F,EAAKwB,CAAS,EAChDtB,EAAuB,SAAUF,EAAKyB,CAAQ,EAC9CvB,EAAuB,UAAWF,EAAK0B,CAAS,EAChDxB,EAAuB,UAAWF,EAAK2B,CAAS,EAChDzB,EAAuB,QAASF,EAAK4B,CAAO,EAC5C1B,EAAuB,QAASF,EAAK6B,CAAO,EAC5C3B,EAAuB,iBAAkBF,EAAK8B,CAAgB,EAC9D5B,EAAuB,kBAAmBF,EAAK+B,CAAiB,EAEzD,CAACQ,CAAc,CACxB,EAEMQ,GAAwBC,EAAiB,EACzCC,GAAqB,mBAErBC,GAAY,EAAArD,QAAM,WAGtB,CAACE,EAAOC,IAAQ,CAChB,IAAMmD,KAAiB,UAAyB,IAAI,EAC9CC,EAAYC,EAAgBF,EAAgBnD,CAAG,EAC/C,CAACuC,CAAc,EAAIjC,GAAU6C,EAAgBpD,CAAK,EAExD,OACE,EAAAF,QAAA,cAACD,GAAA,CAEC,IAAKwD,EACL,mBAAoBH,GACpB,sBAAuBF,GACtB,GAAGR,EACN,CAEJ,CAAC,EAEMe,GAAQJ",
|
|
6
6
|
"names": ["src_exports", "__export", "src_default", "__toCommonJS", "import_react", "import_mux_player", "ReactPropToAttrNameMap", "isNil", "x", "isKeyOf", "k", "o", "toKebabCase", "string", "match", "toNativeAttrName", "propName", "propValue", "toNativeAttrValue", "propValue", "propName", "toNativeProps", "props", "transformedProps", "attrName", "toNativeAttrName", "attrValue", "import_react", "import_react", "useCombinedRefs", "refs", "targetRef", "ref", "import_react", "hasOwnProperty", "shallowEqual", "objA", "objB", "vVal", "keysA", "keysB", "i", "defaultHasChanged", "obj", "v", "k", "defaultUpdateValue", "useObjectPropEffect", "propName", "propValue", "ref", "updateValue", "hasChanged", "useObjectPropEffect_default", "getEnvPlayerVersion", "player_version", "getPlayerVersion", "MuxPlayerInternal", "React", "children", "props", "ref", "toNativeProps", "useEventCallbackEffect", "type", "callback", "eventTarget", "usePlayer", "onAbort", "onCanPlay", "onCanPlayThrough", "onEmptied", "onLoadStart", "onLoadedData", "onLoadedMetadata", "onProgress", "onDurationChange", "onVolumeChange", "onRateChange", "onResize", "onWaiting", "onPlay", "onPlaying", "onTimeUpdate", "onPause", "onSeeking", "onSeeked", "onStalled", "onSuspend", "onEnded", "onError", "onCuePointChange", "onCuePointsChange", "metadata", "tokens", "paused", "playbackId", "playbackRates", "currentTime", "themeProps", "remainingProps", "useObjectPropEffect_default", "playerEl", "pausedVal", "value", "propName", "defaultHasChanged", "currentTimeVal", "playerSoftwareVersion", "getPlayerVersion", "playerSoftwareName", "MuxPlayer", "innerPlayerRef", "playerRef", "useCombinedRefs", "src_default"]
|
|
7
7
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import y,{useEffect as ie}from"react";import{MediaError as be}from"@mux/mux-player";var d={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},_=e=>e==null,q=(e,
|
|
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,n)=>_(n)?!1:e in n,J=e=>e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Y=(e,n)=>{if(!(typeof n=="boolean"&&!n)){if(q(e,d))return d[e];if(typeof n!=null)return/[A-Z]/.test(e)?J(e):e}};var $=(e,n)=>typeof e=="boolean"?"":e,c=(e={})=>Object.entries(e).reduce((n,[t,o])=>{let a=Y(t,o);if(!a)return n;let i=$(o,t);return n[a]=i,n},{});import{useRef as se}from"react";import{useEffect as Q,useRef as X}from"react";var m=(...e)=>{let n=X(null);return Q(()=>{e.forEach(t=>{!t||(typeof t=="function"?t(n.current):t.current=n.current)})},[e]),n};import{useEffect as B}from"react";var ee=Object.prototype.hasOwnProperty,ne=(e,n)=>{if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.some((a,i)=>n[i]===a);let t=Object.keys(e),o=Object.keys(n);if(t.length!==o.length)return!1;for(let a=0;a<t.length;a++)if(!ee.call(n,t[a])||!Object.is(e[t[a]],n[t[a]]))return!1;return!0},p=(e,n,t)=>!ne(n,e[t]),te=(e,n,t)=>{e[t]=n},re=(e,n,t,o=te,a=p)=>B(()=>{let i=t==null?void 0:t.current;!i||!a(i,n,e)||o(i,n,e)},[t==null?void 0:t.current,n]),l=re;var ae=()=>{try{return"1.11.0"}catch{}return"UNKNOWN"},oe=ae(),E=()=>oe;var le=y.forwardRef(({children:e,...n},t)=>y.createElement("mux-player",c({...n,ref:t}),e)),r=(e,n,t)=>ie(()=>{let o=n==null?void 0:n.current;if(!(!o||!t))return o.addEventListener(e,t),()=>{o.removeEventListener(e,t)}},[n==null?void 0:n.current,t]),ue=(e,n)=>{let{onAbort:t,onCanPlay:o,onCanPlayThrough:a,onEmptied:i,onLoadStart:g,onLoadedData: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}=n;return l("playbackRates",j,e),l("metadata",K,e),l("themeProps",F,e),l("tokens",D,e),l("playbackId",H,e),l("paused",U,e,(s,u)=>{u!=null&&(u?s.pause():s.play())},(s,u,Z)=>s.hasAttribute("autoplay")&&!s.hasPlayed?!1:p(s,u,Z)),l("currentTime",z,e,(s,u)=>{u!=null&&(s.currentTime=u)}),r("abort",e,t),r("canplay",e,o),r("canplaythrough",e,a),r("emptied",e,i),r("loadstart",e,g),r("loadeddata",e,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,n)=>{let t=se(null),o=m(t,n),[a]=ue(t,e);return y.createElement(le,{ref:o,playerSoftwareName:pe,playerSoftwareVersion:ye,...a})}),Ce=de;export{be as MediaError,Ce as default};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.tsx", "../src/common/utils.ts", "../src/useCombinedRefs.ts", "../src/useObjectPropEffect.ts", "../src/env.ts"],
|
|
4
|
-
"sourcesContent": ["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,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,IAAMC,EAAYH,EAAO,IAAI,EA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CAAQ,CACtC,EAAG,CAACE,GAAA,YAAAA,EAAK,QAASD,CAAS,CAAC,EAGvBI,EAAQN,GCjEf,IAAMO,GAAsB,IAAM,CAChC,GAAI,CAEF,MAAO,QACT,MAAE,CAAO,CACT,MAAO,SACT,EAEMC,GAAyBD,GAAoB,EAEtCE,EAAmB,IAAMD,
|
|
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 noVolumePref?: boolean;\n thumbnailTime?: number;\n title?: string;\n tokens?: Tokens;\n theme?: string;\n themeProps?: { [k: string]: any };\n onAbort?: GenericEventListener<MuxPlayerElementEventMap['abort']>;\n onCanPlay?: GenericEventListener<MuxPlayerElementEventMap['canplay']>;\n onCanPlayThrough?: GenericEventListener<MuxPlayerElementEventMap['canplaythrough']>;\n onEmptied?: GenericEventListener<MuxPlayerElementEventMap['emptied']>;\n onLoadStart?: GenericEventListener<MuxPlayerElementEventMap['loadstart']>;\n onLoadedData?: GenericEventListener<MuxPlayerElementEventMap['loadeddata']>;\n onLoadedMetadata?: GenericEventListener<MuxPlayerElementEventMap['loadedmetadata']>;\n onProgress?: GenericEventListener<MuxPlayerElementEventMap['progress']>;\n onDurationChange?: GenericEventListener<MuxPlayerElementEventMap['durationchange']>;\n onVolumeChange?: GenericEventListener<MuxPlayerElementEventMap['volumechange']>;\n onRateChange?: GenericEventListener<MuxPlayerElementEventMap['ratechange']>;\n onResize?: GenericEventListener<MuxPlayerElementEventMap['resize']>;\n onWaiting?: GenericEventListener<MuxPlayerElementEventMap['waiting']>;\n onPlay?: GenericEventListener<MuxPlayerElementEventMap['play']>;\n onPlaying?: GenericEventListener<MuxPlayerElementEventMap['playing']>;\n onTimeUpdate?: GenericEventListener<MuxPlayerElementEventMap['timeupdate']>;\n onPause?: GenericEventListener<MuxPlayerElementEventMap['pause']>;\n onSeeking?: GenericEventListener<MuxPlayerElementEventMap['seeking']>;\n onSeeked?: GenericEventListener<MuxPlayerElementEventMap['seeked']>;\n onStalled?: GenericEventListener<MuxPlayerElementEventMap['stalled']>;\n onSuspend?: GenericEventListener<MuxPlayerElementEventMap['suspend']>;\n onEnded?: GenericEventListener<MuxPlayerElementEventMap['ended']>;\n onError?: GenericEventListener<MuxPlayerElementEventMap['error']>;\n onCuePointChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointchange']>;\n onCuePointsChange?: GenericEventListener<MuxPlayerElementEventMap['cuepointschange']>;\n // onPlayerReady?: EventListener;\n} & Partial<MuxMediaPropTypes> &\n Partial<VideoApiAttributes>;\n\nconst MuxPlayerInternal = React.forwardRef<MuxPlayerRefAttributes, MuxPlayerProps>(({ children, ...props }, ref) => {\n return React.createElement('mux-player', toNativeProps({ ...props, ref }), children);\n});\n\nconst useEventCallbackEffect = <K extends keyof MuxPlayerElementEventMap>(\n type: K,\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n callback: GenericEventListener<MuxPlayerElementEventMap[K]> | undefined\n) => {\n return useEffect(() => {\n const eventTarget = ref?.current;\n if (!eventTarget || !callback) return;\n eventTarget.addEventListener(type, callback);\n return () => {\n eventTarget.removeEventListener(type, callback);\n };\n }, [ref?.current, callback]);\n};\n\nconst usePlayer = (\n ref: // | ((instance: EventTarget | null) => void)\n React.MutableRefObject<MuxPlayerElement | null> | null | undefined,\n props: MuxPlayerProps\n) => {\n const {\n onAbort,\n onCanPlay,\n onCanPlayThrough,\n onEmptied,\n onLoadStart,\n onLoadedData,\n onLoadedMetadata,\n onProgress,\n onDurationChange,\n onVolumeChange,\n onRateChange,\n onResize,\n onWaiting,\n onPlay,\n onPlaying,\n onTimeUpdate,\n onPause,\n onSeeking,\n onSeeked,\n onStalled,\n onSuspend,\n onEnded,\n onError,\n onCuePointChange,\n onCuePointsChange,\n // onPlayerReady,\n metadata,\n tokens,\n paused,\n playbackId,\n playbackRates,\n currentTime,\n themeProps,\n ...remainingProps\n } = props;\n useObjectPropEffect('playbackRates', playbackRates, ref);\n useObjectPropEffect('metadata', metadata, ref);\n useObjectPropEffect('themeProps', themeProps, ref);\n useObjectPropEffect('tokens', tokens, ref);\n useObjectPropEffect('playbackId', playbackId, ref);\n useObjectPropEffect(\n 'paused',\n paused,\n ref,\n (playerEl: HTMLMediaElement, pausedVal?: boolean) => {\n if (pausedVal == null) return;\n if (pausedVal) {\n playerEl.pause();\n } else {\n playerEl.play();\n }\n },\n (playerEl, value, propName) => {\n if (playerEl.hasAttribute('autoplay') && !playerEl.hasPlayed) {\n return false;\n }\n return defaultHasChanged(playerEl, value, propName);\n }\n );\n useObjectPropEffect('currentTime', currentTime, ref, (playerEl: HTMLMediaElement, currentTimeVal?: number) => {\n if (currentTimeVal == null) return;\n playerEl.currentTime = currentTimeVal;\n });\n useEventCallbackEffect('abort', ref, onAbort);\n useEventCallbackEffect('canplay', ref, onCanPlay);\n useEventCallbackEffect('canplaythrough', ref, onCanPlayThrough);\n useEventCallbackEffect('emptied', ref, onEmptied);\n useEventCallbackEffect('loadstart', ref, onLoadStart);\n useEventCallbackEffect('loadeddata', ref, onLoadedData);\n useEventCallbackEffect('loadedmetadata', ref, onLoadedMetadata);\n useEventCallbackEffect('progress', ref, onProgress);\n useEventCallbackEffect('durationchange', ref, onDurationChange);\n useEventCallbackEffect('volumechange', ref, onVolumeChange);\n useEventCallbackEffect('ratechange', ref, onRateChange);\n useEventCallbackEffect('resize', ref, onResize);\n useEventCallbackEffect('waiting', ref, onWaiting);\n useEventCallbackEffect('play', ref, onPlay);\n useEventCallbackEffect('playing', ref, onPlaying);\n useEventCallbackEffect('timeupdate', ref, onTimeUpdate);\n useEventCallbackEffect('pause', ref, onPause);\n useEventCallbackEffect('seeking', ref, onSeeking);\n useEventCallbackEffect('seeked', ref, onSeeked);\n useEventCallbackEffect('stalled', ref, onStalled);\n useEventCallbackEffect('suspend', ref, onSuspend);\n useEventCallbackEffect('ended', ref, onEnded);\n useEventCallbackEffect('error', ref, onError);\n useEventCallbackEffect('cuepointchange', ref, onCuePointChange);\n useEventCallbackEffect('cuepointschange', ref, onCuePointsChange);\n // useEventCallbackEffect('playerready', ref, onPlayerReady);\n return [remainingProps];\n};\n\nconst playerSoftwareVersion = getPlayerVersion();\nconst playerSoftwareName = 'mux-player-react';\n\nconst MuxPlayer = React.forwardRef<\n MuxPlayerRefAttributes,\n Omit<MuxPlayerProps, 'playerSoftwareVersion' | 'playerSoftwareName'>\n>((props, ref) => {\n const innerPlayerRef = useRef<MuxPlayerElement>(null);\n const playerRef = useCombinedRefs(innerPlayerRef, ref);\n const [remainingProps] = usePlayer(innerPlayerRef, props);\n\n return (\n <MuxPlayerInternal\n /** @TODO Fix types relationships (CJP) */\n ref={playerRef as typeof innerPlayerRef}\n playerSoftwareName={playerSoftwareName}\n playerSoftwareVersion={playerSoftwareVersion}\n {...remainingProps}\n />\n );\n});\n\nexport default MuxPlayer;\n", "// NOTE: As a forward-looking implementation, we may want to assume\n// prop names -> attribute names is always a simple name.toLowerCase()\n// and provide a mechanism for passing in per-component overrides for\n// e.g. kebab cases, as that's the way React/Preact handles these. (CJP)\nconst ReactPropToAttrNameMap = {\n className: 'class',\n classname: 'class',\n htmlFor: 'for',\n crossOrigin: 'crossorigin',\n viewBox: 'viewBox',\n playsInline: 'playsinline',\n autoPlay: 'autoplay',\n playbackRate: 'playbackrate',\n};\n\ntype KeyTypes = string | number | symbol;\ntype Maybe<T> = T | null | undefined;\n\nexport const isNil = (x: unknown): x is null | undefined => x == undefined;\n\n// Type Guard to determine if a given key is actually a key of some object of type T\nexport const isKeyOf = <T extends {} = any>(k: KeyTypes, o: Maybe<T>): k is keyof T => {\n if (isNil(o)) return false;\n return k in o;\n};\n\nconst toKebabCase = (string: string) => string.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);\n\nexport const toNativeAttrName = (propName: string, propValue: any): string | undefined => {\n if (typeof propValue === 'boolean' && !propValue) return undefined;\n if (isKeyOf(propName, ReactPropToAttrNameMap)) return ReactPropToAttrNameMap[propName];\n if (typeof propValue == undefined) return undefined;\n if (/[A-Z]/.test(propName)) return toKebabCase(propName);\n return propName;\n};\nexport const toStyleAttr = <T>(x: T) => x;\n\nexport const toNativeAttrValue = (propValue: any, propName: string) => {\n if (typeof propValue === 'boolean') return '';\n return propValue;\n};\n\nexport const toNativeProps = (props = {}) => {\n return Object.entries(props).reduce<{ [k: string]: string }>((transformedProps, [propName, propValue]) => {\n const attrName = toNativeAttrName(propName, propValue);\n\n // prop was stripped. Don't add.\n if (!attrName) {\n return transformedProps;\n }\n\n const attrValue = toNativeAttrValue(propValue, propName);\n transformedProps[attrName] = attrValue;\n return transformedProps;\n }, {});\n};\n", "import { useEffect, useRef } from 'react';\nimport type { MutableRefObject, ForwardedRef } from 'react';\n\ntype Maybe<T> = T | null | undefined;\ntype RefCb<T> = (instance: Maybe<T>) => void;\ntype RefObj<T> = MutableRefObject<Maybe<T>>;\ntype RefTypes<T> = RefObj<T> | RefCb<T> | ForwardedRef<T>;\ninterface useCombinedRefs {\n <T>(...refs: Maybe<RefTypes<T>>[]): RefObj<T>;\n}\n\nexport const useCombinedRefs: useCombinedRefs = (...refs) => {\n const targetRef = useRef(null);\n\n useEffect(() => {\n refs.forEach((ref) => {\n if (!ref) return;\n\n if (typeof ref === 'function') {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n });\n }, [refs]);\n\n return targetRef;\n};\n\n// TS assumed default export was interface def instead of function value (CJP)\nconst defaultUseCombinedRefs = useCombinedRefs;\nexport default defaultUseCombinedRefs;\n", "import { useEffect } from 'react';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Slightly modified version of React's shallowEqual, with optimizations for Arrays\n * so we may treat them specifically as unequal if they are not a) both arrays\n * or b) don't contain the same (shallowly compared) elements.\n */\nconst shallowEqual = (objA: any, objB: any): boolean => {\n if (Object.is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n if (Array.isArray(objA)) {\n // Early \"cheap\" array compares\n if (!Array.isArray(objB) || objA.length !== objB.length) return false;\n // Shallow compare for arrays\n return objA.some((vVal, i) => objB[i] === vVal);\n }\n\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (let i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const defaultHasChanged = (obj: any, v: any, k: string) => {\n return !shallowEqual(v, obj[k]);\n};\n\nconst defaultUpdateValue = (obj: any, v: any, k: string) => {\n obj[k] = v;\n};\n\nexport const useObjectPropEffect = <T extends { [k: string]: any }, V>(\n propName: string,\n propValue: V | null | undefined,\n ref: React.MutableRefObject<T | null> | null | undefined,\n updateValue = defaultUpdateValue,\n hasChanged = defaultHasChanged\n) => {\n return useEffect(() => {\n const obj = ref?.current;\n if (!obj) return;\n if (!hasChanged(obj, propValue, propName)) return;\n updateValue(obj, propValue, propName);\n }, [ref?.current, propValue]);\n};\n\nexport default useObjectPropEffect;\n", "const getEnvPlayerVersion = () => {\n try {\n // @ts-ignore\n return PLAYER_VERSION as string;\n } catch {}\n return 'UNKNOWN';\n};\n\nconst player_version: string = getEnvPlayerVersion();\n\nexport const getPlayerVersion = () => player_version;\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,GAAS,aAAAC,OAAiB,QAGjC,OAAS,cAAAC,OAAkB,kBCC3B,IAAMC,EAAyB,CAC7B,UAAW,QACX,UAAW,QACX,QAAS,MACT,YAAa,cACb,QAAS,UACT,YAAa,cACb,SAAU,WACV,aAAc,cAChB,EAKaC,EAASC,GAAsCA,GAAK,KAGpDC,EAAU,CAAqBC,EAAaC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AACD,GAAA,CAEC,IAAK0D,EACL,mBAAoBJ,GACpB,sBAAuBF,GACtB,GAAGR,EACN,CAEJ,CAAC,EAEMgB,GAAQL",
|
|
6
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
7
|
}
|
package/dist/lazy.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import o,{useEffect as h,useState as k}from"react";import i,{Suspense as y}from"react";var m=({condition:t,fallback:r,children:n,...e})=>t?i.createElement(y,{fallback:r,...e},n):i.createElement(i.Fragment,null,r),c=m;import{useState as f,useEffect as b}from"react";var x=()=>{let[t,r]=f(!1);return b(()=>{typeof window!="undefined"&&r(!0)},[]),t},p=x;import{useState as P,useEffect as I}from"react";var g=(t,r)=>{let[n,e]=P(!1);return I(()=>{if(typeof IntersectionObserver=="function"){let a=new IntersectionObserver(([s])=>{e(s.isIntersecting)},r);return t.current&&a.observe(t.current),()=>{a.disconnect()}}},[t,r]),n},u=g;var M=o.lazy(()=>import("./-
|
|
1
|
+
import o,{useEffect as h,useState as k}from"react";import i,{Suspense as y}from"react";var m=({condition:t,fallback:r,children:n,...e})=>t?i.createElement(y,{fallback:r,...e},n):i.createElement(i.Fragment,null,r),c=m;import{useState as f,useEffect as b}from"react";var x=()=>{let[t,r]=f(!1);return b(()=>{typeof window!="undefined"&&r(!0)},[]),t},p=x;import{useState as P,useEffect as I}from"react";var g=(t,r)=>{let[n,e]=P(!1);return I(()=>{if(typeof IntersectionObserver=="function"){let a=new IntersectionObserver(([s])=>{e(s.isIntersecting)},r);return t.current&&a.observe(t.current),()=>{a.disconnect()}}},[t,r]),n},u=g;var M=o.lazy(()=>import("./-2IT5KXF6.mjs")),v=t=>{let{style:r,className:n,onIntersection:e,placeholder:a}=t,s=o.useRef(null),l=u(s);return h(()=>{l&&e&&e()},[l,e]),o.createElement(o.Fragment,null,o.createElement("mux-player",{ref:s,"data-mux-player-react-lazy-placeholder":!0,placeholder:a,style:{"--mux-player-react-lazy-placeholder":a?`url(${a});`:"",...r},className:n||"",nohotkeys:!0,"aria-hidden":!0,tabIndex:-1},o.createElement("div",{"data-mux-player-react-lazy-placeholder-overlay":!0})),o.createElement("style",null,`
|
|
2
2
|
mux-player[data-mux-player-react-lazy-placeholder] {
|
|
3
3
|
aspect-ratio: 16/9;
|
|
4
4
|
display: block;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../node_modules/typescript/lib/lib.scripthost.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2019.full.d.ts","../../../node_modules/@types/react/global.d.ts","../../../node_modules/csstype/index.d.ts","../../../node_modules/@types/prop-types/index.d.ts","../../../node_modules/@types/scheduler/tracing.d.ts","../../../node_modules/@types/react/index.d.ts","../src/ConditionalSuspense.tsx","../src/env.ts","../../../node_modules/hls.js/dist/hls.js.d.ts","../../playback-core/dist/types/mux-embed.d.ts","../../playback-core/dist/types/hls.d.ts","../../playback-core/dist/types/errors.d.ts","../../playback-core/dist/types/types.d.ts","../../playback-core/dist/types/tracks.d.ts","../../playback-core/dist/types/pdt.d.ts","../../playback-core/dist/types/index.d.ts","../../../node_modules/media-chrome/dist/constants.d.ts","../../../node_modules/media-chrome/dist/labels/labels.d.ts","../../../node_modules/media-chrome/dist/utils/time.d.ts","../../../node_modules/media-chrome/dist/media-chrome-button.d.ts","../../../node_modules/media-chrome/dist/media-airplay-button.d.ts","../../../node_modules/media-chrome/dist/media-cast-button.d.ts","../../../node_modules/media-chrome/dist/media-gesture-receiver.d.ts","../../../node_modules/media-chrome/dist/media-container.d.ts","../../../node_modules/media-chrome/dist/utils/attribute-token-list.d.ts","../../../node_modules/media-chrome/dist/media-controller.d.ts","../../../node_modules/media-chrome/dist/media-chrome-range.d.ts","../../../node_modules/media-chrome/dist/media-control-bar.d.ts","../../../node_modules/media-chrome/dist/media-text-display.d.ts","../../../node_modules/media-chrome/dist/media-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"},"0c7129bda64d3182c63631823158a8e1d97cf8c017038f9a55a50a342e301443",{"version":"6ff45ab1a5c3f32638dd1131cc94ecd68f11566363ea16dca3c8a7d556a81bbb","affectsGlobalScope":true},"773d1148d4729e5b25d0bdb65552c2854378506fbb408424a5947dbfdfd8b789","de64daa4e510abaaf4b4970c6dd37e39c3b8a263cccbeb80a41c69ae5a2a34ba","4793eb8f2aa04221093b0fa780ff6bf7cf92381c616fc94719e5c29508492017","bc87a0cdc972f4b11e138495209c7a076653f38ee00c51f82738859510c46539","dccea7b665fe08ed006acd191a7e68123ba7ec49848ac7c28a164962bf21254e","7baf82385aff7b41234df1aefaa903365f62e36b52615d1fac7e2b0053c33a2d","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":"ae1c025f69b6606e96701d4fdb5f1226887794e4d2d4c25afa2d8a5759ce118f","affectsGlobalScope":true},"2f39ccc3f2cad7f2a1e0ad14a744877ed08dae4ae75510109ac981ceb783b566","ff0b943978c6a9952a4c64928b0383814cc21b363dc5e37f169af36423f919f7","68b73a50106aa0c13f5c8c0b47aee3e5b7e788ce2ba1042fdf944781fcbea619","93317a5a58dd240994f1d73a70ac13b670b106b160465e594bdd92ecc61b466b",{"version":"498d6a91f4bbfbd412e928a5fd6306d98a8b8b49c334b3ef1b1dccd8ec327e2f","signature":"d84a480259a7bda3cd794ab264e29fda120eb72c8c9270396a584479bf5b827f"},{"version":"f21932f853b3dbd3949e14c7d31d2dcfba3418c5de50878884a54cf0ba14e904","signature":"014089c3590328e311f0651db51765945a630df49cccfaf71c884d53bafd70d2"},{"version":"721526438283d40d50c6356064d346f1c57693f7e9930a3854c20c73bf4380a5","signature":"066053c842a2d9edb616d9c88dab6b19eaf8f4630bf862c774d0d6cc98c62a91"},{"version":"07eb3db85200c1da0f06eb18520127820bcb14e7e978120d3ca539c483ed2b9c","signature":"1ac8b0a0948270c3820be66263ce4cc02fcfa7f1c28563ccb7a98fbbe9d0a2b3"},{"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],[86],[52,53,54,55,56,57,58,61,62,63,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],[55],[59,60],[64],[77],[62],[41],[41,43,51,93,94,95,96],[41,42,51,97,98,99],[51],[51,85,87,89,91,92],[89,90],[51,88],[44],[44,45,46,47,48,49,50],[48],[46,48],[45,46,47],[41,51,93],[41,51,93,97]],"referencedMap":[[41,1],[87,2],[85,3],[56,4],[68,4],[57,4],[61,5],[65,6],[66,6],[70,4],[71,4],[72,4],[73,4],[74,4],[75,4],[80,6],[78,7],[79,4],[69,4],[67,6],[77,8],[84,8],[42,9],[97,10],[100,11],[95,9],[98,9],[99,9],[96,9],[92,12],[93,13],[91,14],[89,15],[46,16],[51,17],[45,16],[50,18],[49,19],[48,20]],"exportedModulesMap":[[41,1],[87,2],[85,3],[56,4],[68,4],[57,4],[61,5],[65,6],[66,6],[70,4],[71,4],[72,4],[73,4],[74,4],[75,4],[80,6],[78,7],[79,4],[69,4],[67,6],[77,8],[84,8],[42,9],[97,21],[100,22],[95,9],[96,9],[92,12],[93,13],[91,14],[89,15],[46,16],[51,17],[45,16],[50,18],[49,19],[48,20]],"semanticDiagnosticsPerFile":[39,37,41,40,38,44,52,87,86,85,53,56,68,57,55,62,59,63,61,65,66,70,58,71,83,72,73,74,75,76,81,80,78,79,69,64,67,77,82,84,60,54,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,94,43,97,100,95,98,99,96,92,93,90,91,88,89,47,46,51,45,50,49,48],"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/pdt.d.ts","../../playback-core/dist/types/index.d.ts","../../../node_modules/media-chrome/dist/constants.d.ts","../../../node_modules/media-chrome/dist/labels/labels.d.ts","../../../node_modules/media-chrome/dist/utils/time.d.ts","../../../node_modules/media-chrome/dist/media-chrome-button.d.ts","../../../node_modules/media-chrome/dist/media-airplay-button.d.ts","../../../node_modules/media-chrome/dist/media-cast-button.d.ts","../../../node_modules/media-chrome/dist/media-gesture-receiver.d.ts","../../../node_modules/media-chrome/dist/media-container.d.ts","../../../node_modules/media-chrome/dist/utils/attribute-token-list.d.ts","../../../node_modules/media-chrome/dist/media-controller.d.ts","../../../node_modules/media-chrome/dist/media-chrome-range.d.ts","../../../node_modules/media-chrome/dist/media-control-bar.d.ts","../../../node_modules/media-chrome/dist/media-text-display.d.ts","../../../node_modules/media-chrome/dist/media-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-seek-backward-button.d.ts","../../../node_modules/media-chrome/dist/media-preview-time-display.d.ts","../../../node_modules/media-chrome/dist/media-preview-thumbnail.d.ts","../../../node_modules/media-chrome/dist/media-time-range.d.ts","../../../node_modules/media-chrome/dist/media-loading-indicator.d.ts","../../../node_modules/media-chrome/dist/media-volume-range.d.ts","../../../node_modules/media-chrome/dist/index.d.ts","../../../node_modules/media-chrome/dist/experimental/media-chrome-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"},"13378086813d59e9aca3aab2f412580e33061d9a8ce87a1ef4e925202159b19b",{"version":"6ff45ab1a5c3f32638dd1131cc94ecd68f11566363ea16dca3c8a7d556a81bbb","affectsGlobalScope":true},"773d1148d4729e5b25d0bdb65552c2854378506fbb408424a5947dbfdfd8b789","de64daa4e510abaaf4b4970c6dd37e39c3b8a263cccbeb80a41c69ae5a2a34ba","4793eb8f2aa04221093b0fa780ff6bf7cf92381c616fc94719e5c29508492017","bc87a0cdc972f4b11e138495209c7a076653f38ee00c51f82738859510c46539","dccea7b665fe08ed006acd191a7e68123ba7ec49848ac7c28a164962bf21254e","7baf82385aff7b41234df1aefaa903365f62e36b52615d1fac7e2b0053c33a2d","497c87d8c813be59945a9e7b2a15bad7949e53ec20d1a7baa63cfb2406e235fa","1bca2772bfe6da518ab061f96c01d7d71485b9afe80ea04048d468b6f081889c","5e5782f6925aa6e0d6bce51846e387f44e34b13433b41724ab4bd0073c1b2068","fafb38b956eca800afa3ea73eb300b1aaebfd43a75c2fd04d63fb2b82b276320","68e358046b225cf675744ecbfdefcc6dee118a773b408105d46dcf61142b1e50","79e04a665d69d0edbf243a4356efc1801c039bdac192adf7626c385f0289e7a1","20cac294891937096696114350b93757abc058c9d4ceea190ea2c1ba6feb77b7","45d4b72312fabc1ebb56aa01579f22cd6187de6d15c08ae8a3bd6b8f7329381d","ca5baab21182653233a6cb221476f7eacc3c4565d5e72ddc3e6b0310756a0bce","13704a243feed6e325468680b174768eafb1628abc45a56c4f35f4af8418b1cb","b2c3bd6183d4d4dd331e2d1931df945edfafc74070107246dfad63e0936bbbf5","aaf536e0839ecd949bbd4f7094226e02b568b9dbc26afe5c69cc23ef511da0d2","3481924cd34243ff7ebfe4c8f6f6c0ec89447617b1606ee21496784d78a28ed6","5641d20d7a4e161e42aba4c0463512e0a2eee026123f4b270b28de71d1961cad","e5be73f1092140ae199020bfb7b33d5093269a71535c941ce9014080911c426a","5f46492772bb5d45ff17e2010ec6e3dc0dae0974cd159763180cd11c9ab510b5","416710f3b46d2a66fbaa6e76275cfd282c5794c073f892f925f062725c6f2a3a","175c1dcc31e458ed13d1655e2773e8c1a5345fda1d2993f8c09201490dd95054","49e54658266510cc6f5daf9ba6d0bec1f53e3031556fcd06973352eb319f9800","5a8252ff93354daf68494b767b131d9285cc7ff301a92085d34a4b539db6b96a","f01ae56812a493de0399df3c895a4214cfb79fce77b065729036beae1528f172","24e7c377150337f5db7c632f4bd41a483170d19c6476c9be6c77a7b53457cee1","778d1a9159f08ad0921b481f7d08d180f98c6f5733a6b7407ad22a24763a686b","10106d063c13e13b71ad2bcb504a8afc4f77f401953446d27b34fdbb36fa676e","b9ab77378dd701c92c9fa2a2496bb11ffa6fef070880b96a53058289ec8a310e","0414571c06823f212a1aa34156e6889294d80c2dc788544648e3f4949f171a93","8f0bcdac0c51ecbb05e0e9c97d3c63a7eb415ef9ae36937ebba4a8d4f08cfd2b","c71429de89a9009c8ab818a5e75f1ac354aa0bf0b194d89ae0ac24977c75bfb1","3387c30139c0be6d192983013c9fcabaf376e35ae1db6b0f2791234ef070f120","2f706043337de8263f44f20f75b04144db12faed25966ff02e4ab48b58d32c99","661a04ad362b9833789c5b36613372e4c67475bb8c4af82abfb65d09d9a3d7ab","7802c89a2ee5622730ed821fe148bf47a6881d318b37ee34f7ada0edcd74a005","4ebf326143effdcc0e07460f3497bde23ca5adefef47f8502ac8d84d411c3b60","2e0c6a0fab4c554961b58dc9a93d20a0167f3340ff111da77f1928e1f29f0cc8","76f80c5148923283518d43aaf7d7a899936c99b725f40f44762b1faab876996d",{"version":"ae1c025f69b6606e96701d4fdb5f1226887794e4d2d4c25afa2d8a5759ce118f","affectsGlobalScope":true},"2f39ccc3f2cad7f2a1e0ad14a744877ed08dae4ae75510109ac981ceb783b566","ff0b943978c6a9952a4c64928b0383814cc21b363dc5e37f169af36423f919f7","68b73a50106aa0c13f5c8c0b47aee3e5b7e788ce2ba1042fdf944781fcbea619","0c4788204025d4bed54259bfe3444a457e64657d196453375f973a0618c090d1",{"version":"498d6a91f4bbfbd412e928a5fd6306d98a8b8b49c334b3ef1b1dccd8ec327e2f","signature":"d84a480259a7bda3cd794ab264e29fda120eb72c8c9270396a584479bf5b827f"},{"version":"f21932f853b3dbd3949e14c7d31d2dcfba3418c5de50878884a54cf0ba14e904","signature":"014089c3590328e311f0651db51765945a630df49cccfaf71c884d53bafd70d2"},{"version":"721526438283d40d50c6356064d346f1c57693f7e9930a3854c20c73bf4380a5","signature":"066053c842a2d9edb616d9c88dab6b19eaf8f4630bf862c774d0d6cc98c62a91"},{"version":"665d8a1d9af76b1432bd4f52891498012bd2a95363c6b288192e34dcd87fbef9","signature":"725dfc270849ab29fc78a999f17a4a1d0906a191bf038559410636bbca3f6255"},{"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],[84],[52,53,54,55,56,57,58,61,62,63,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82],[55],[59,60],[64],[62],[41],[41,43,51,91,92,93,94],[41,42,51,95,96,97],[51],[51,83,85,87,89,90],[87,88],[51,86],[44],[44,45,46,47,48,49,50],[48],[46,48],[45,46,47],[41,51,91],[41,51,91,95]],"referencedMap":[[41,1],[85,2],[83,3],[56,4],[68,4],[57,4],[61,5],[65,6],[66,6],[70,4],[71,4],[72,4],[73,4],[74,4],[75,4],[78,6],[77,4],[69,4],[67,6],[80,7],[82,7],[42,8],[95,9],[98,10],[93,8],[96,8],[97,8],[94,8],[90,11],[91,12],[89,13],[87,14],[46,15],[51,16],[45,15],[50,17],[49,18],[48,19]],"exportedModulesMap":[[41,1],[85,2],[83,3],[56,4],[68,4],[57,4],[61,5],[65,6],[66,6],[70,4],[71,4],[72,4],[73,4],[74,4],[75,4],[78,6],[77,4],[69,4],[67,6],[80,7],[82,7],[42,8],[95,20],[98,21],[93,8],[94,8],[90,11],[91,12],[89,13],[87,14],[46,15],[51,16],[45,15],[50,17],[49,18],[48,19]],"semanticDiagnosticsPerFile":[39,37,41,40,38,44,52,85,84,83,53,56,68,57,55,62,59,63,61,65,66,70,58,71,81,72,73,74,75,76,79,78,77,69,64,67,80,82,60,54,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,92,43,95,98,93,96,97,94,90,91,88,89,86,87,47,46,51,45,50,49,48],"latestChangedDtsFile":"./types/lazy.d.ts"},"version":"4.9.4"}
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mux/mux-player-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0-canary.0-1c29f8f",
|
|
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",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@mux/mux-player": "1.
|
|
69
|
-
"@mux/playback-core": "0.18.0",
|
|
68
|
+
"@mux/mux-player": "1.11.0-canary.0-1c29f8f",
|
|
69
|
+
"@mux/playback-core": "0.18.1-canary.0-1c29f8f",
|
|
70
70
|
"prop-types": "^15.7.2"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
@@ -80,6 +80,5 @@
|
|
|
80
80
|
"react-dom": "^17.0.2",
|
|
81
81
|
"shx": "^0.3.4",
|
|
82
82
|
"typescript": "^4.9.4"
|
|
83
|
-
}
|
|
84
|
-
"gitHead": "3c8564674467b09dfcec611f2b24122537dbb840"
|
|
83
|
+
}
|
|
85
84
|
}
|
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.
|
package/dist/-OHQE4KKI.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
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.1"}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=-OHQE4KKI.mjs.map
|
package/dist/-OHQE4KKI.mjs.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/index.tsx", "../src/common/utils.ts", "../src/useCombinedRefs.ts", "../src/useObjectPropEffect.ts", "../src/env.ts"],
|
|
4
|
-
"sourcesContent": ["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,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,OAA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wB,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
|
-
}
|