@mux/mux-audio 0.10.9 → 0.10.10-canary.0-bc2cd48

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 ADDED
@@ -0,0 +1,339 @@
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
+ ## [0.10.10](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.10.9...@mux/mux-audio@0.10.10) (2023-09-05)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **mux-video,mux-audio:** reload core on DOM connect ([#765](https://github.com/muxinc/elements/issues/765)) ([3b61394](https://github.com/muxinc/elements/commit/3b61394e4a60ded6c2a7f30b85c281f5ef5cea03))
12
+
13
+
14
+
15
+
16
+
17
+ ## [0.10.9](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.10.8...@mux/mux-audio@0.10.9) (2023-08-30)
18
+
19
+ **Note:** Version bump only for package @mux/mux-audio
20
+
21
+
22
+
23
+
24
+
25
+ ## [0.10.8](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.10.7...@mux/mux-audio@0.10.8) (2023-08-23)
26
+
27
+ **Note:** Version bump only for package @mux/mux-audio
28
+
29
+
30
+
31
+
32
+
33
+ ## [0.10.7](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.10.6...@mux/mux-audio@0.10.7) (2023-08-15)
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * Reverting packages type (defaults to cjs) for accuracy per node … ([#745](https://github.com/muxinc/elements/issues/745)) ([9e7a171](https://github.com/muxinc/elements/commit/9e7a17113e14b711c8da9b1bdafe65ee86454b3b))
39
+
40
+
41
+
42
+
43
+
44
+ ## [0.10.6](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.10.5...@mux/mux-audio@0.10.6) (2023-08-14)
45
+
46
+ **Note:** Version bump only for package @mux/mux-audio
47
+
48
+
49
+
50
+
51
+
52
+ ## [0.10.5](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.10.4...@mux/mux-audio@0.10.5) (2023-07-07)
53
+
54
+ **Note:** Version bump only for package @mux/mux-audio
55
+
56
+
57
+
58
+
59
+
60
+ ## [0.10.4](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.10.3...@mux/mux-audio@0.10.4) (2023-06-29)
61
+
62
+ **Note:** Version bump only for package @mux/mux-audio
63
+
64
+
65
+
66
+
67
+
68
+ ## [0.10.3](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.10.2...@mux/mux-audio@0.10.3) (2023-06-12)
69
+
70
+
71
+ ### Bug Fixes
72
+
73
+ * **playback-core, mux-video:** Handle native playback edge cases wher… ([#705](https://github.com/muxinc/elements/issues/705)) ([16f8941](https://github.com/muxinc/elements/commit/16f8941799a5186f28205a70105b26764f39b295))
74
+
75
+
76
+
77
+
78
+
79
+ ## [0.10.2](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.10.1...@mux/mux-audio@0.10.2) (2023-06-06)
80
+
81
+
82
+ ### Bug Fixes
83
+
84
+ * use custom-media-element pkg ([#697](https://github.com/muxinc/elements/issues/697)) ([71c3341](https://github.com/muxinc/elements/commit/71c334157cbb16f88d57b020425534e9dde2b4ca))
85
+
86
+
87
+
88
+
89
+
90
+ ## [0.10.1](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.10.0...@mux/mux-audio@0.10.1) (2023-05-08)
91
+
92
+
93
+ ### Bug Fixes
94
+
95
+ * upgrade to hls.js 1.4.1 ([#685](https://github.com/muxinc/elements/issues/685)) ([15ca4ac](https://github.com/muxinc/elements/commit/15ca4acc3b5093a409baa938429d9afaa30c80bd))
96
+
97
+
98
+
99
+
100
+
101
+ # [0.10.0](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.9.6...@mux/mux-audio@0.10.0) (2023-04-14)
102
+
103
+
104
+ ### Features
105
+
106
+ * add currentPdt getter and getStartDate() method ([#661](https://github.com/muxinc/elements/issues/661)) ([530170b](https://github.com/muxinc/elements/commit/530170b789d7734d2b70fde7d59abb1ebf8a582c))
107
+
108
+
109
+
110
+
111
+
112
+ ## [0.9.6](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.9.5...@mux/mux-audio@0.9.6) (2023-03-31)
113
+
114
+
115
+ ### Bug Fixes
116
+
117
+ * update typedefs, disable skipLibChecks in tsconfig ([#601](https://github.com/muxinc/elements/issues/601)) ([1664aec](https://github.com/muxinc/elements/commit/1664aec20e4cf4a59779848b298d4504eef24080))
118
+
119
+
120
+
121
+
122
+
123
+ ## [0.9.5](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.9.4...@mux/mux-audio@0.9.5) (2023-02-15)
124
+
125
+ **Note:** Version bump only for package @mux/mux-audio
126
+
127
+
128
+
129
+
130
+
131
+ ## [0.9.4](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.9.3...@mux/mux-audio@0.9.4) (2023-02-14)
132
+
133
+
134
+ ### Bug Fixes
135
+
136
+ * **playback-core:** Typescript + min acrobatics to make svelte and others happy ([fdf34bb](https://github.com/muxinc/elements/commit/fdf34bb8fd409f0c2b5945802251ed2e6ffafd7e))
137
+
138
+
139
+
140
+
141
+
142
+ ## [0.9.3](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.9.2...@mux/mux-audio@0.9.3) (2023-02-02)
143
+
144
+ **Note:** Version bump only for package @mux/mux-audio
145
+
146
+
147
+
148
+
149
+
150
+ ## [0.9.2](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.9.1...@mux/mux-audio@0.9.2) (2023-02-01)
151
+
152
+ **Note:** Version bump only for package @mux/mux-audio
153
+
154
+
155
+
156
+
157
+
158
+ ## [0.9.1](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.9.0...@mux/mux-audio@0.9.1) (2023-01-20)
159
+
160
+ **Note:** Version bump only for package @mux/mux-audio
161
+
162
+
163
+
164
+
165
+
166
+ # [0.9.0](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.8.1...@mux/mux-audio@0.9.0) (2022-12-13)
167
+
168
+
169
+ ### Features
170
+
171
+ * allow video, audio and player elements to get any metadata-* attrs set ([#501](https://github.com/muxinc/elements/issues/501)) ([8ee139d](https://github.com/muxinc/elements/commit/8ee139d2bbd08e1e3c08d047f870c1dcf01dac7e))
172
+
173
+
174
+
175
+
176
+
177
+ ## [0.8.1](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.8.0...@mux/mux-audio@0.8.1) (2022-11-21)
178
+
179
+
180
+ ### Bug Fixes
181
+
182
+ * add async effect for loading media ([#492](https://github.com/muxinc/elements/issues/492)) ([d2b250a](https://github.com/muxinc/elements/commit/d2b250a2d86e4e6a4c17fc34196e6468c4fedf1f))
183
+
184
+
185
+
186
+
187
+
188
+ # [0.8.0](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.7.0...@mux/mux-audio@0.8.0) (2022-10-25)
189
+
190
+
191
+ ### Features
192
+
193
+ * **mux-audio:** Add disable cookies attr and prop. ([ef453ed](https://github.com/muxinc/elements/commit/ef453edf9cb9696150ae89f995a6af8472161153))
194
+
195
+
196
+
197
+
198
+
199
+ # [0.7.0](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.6.4...@mux/mux-audio@0.7.0) (2022-10-05)
200
+
201
+ ### Bug Fixes
202
+
203
+ - preload for mux-audio, add tests ([e795fe0](https://github.com/muxinc/elements/commit/e795fe047af1feac832786aa03d8f419e57881b5))
204
+ - preload playback core change ([15313ea](https://github.com/muxinc/elements/commit/15313eaad81f748b5853a0fdaabfe141963f885e))
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
+ - remove deprecated .hls and .video props ([#408](https://github.com/muxinc/elements/issues/408)) ([2bd4861](https://github.com/muxinc/elements/commit/2bd48618d1b59d054e470ce9011c5c2f4904f8b6))
210
+
211
+ ### BREAKING CHANGES
212
+
213
+ - remove deprecated .hls and .video props.
214
+
215
+ ## [0.6.4](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.6.3...@mux/mux-audio@0.6.4) (2022-09-16)
216
+
217
+ ### Bug Fixes
218
+
219
+ - mux-video & mux-audio memory leak ([#387](https://github.com/muxinc/elements/issues/387)) ([4a0d921](https://github.com/muxinc/elements/commit/4a0d921c49a3bf730ad86a77e46a085c44ef91ea))
220
+ - update PlaybackEngine types ([1873781](https://github.com/muxinc/elements/commit/187378165a83e70d62bd5ba954b4986d0ae50738))
221
+
222
+ ## [0.6.3](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.6.2...@mux/mux-audio@0.6.3) (2022-08-31)
223
+
224
+ ### Bug Fixes
225
+
226
+ - polyfills mutating global ([#355](https://github.com/muxinc/elements/issues/355)) ([71d18a4](https://github.com/muxinc/elements/commit/71d18a427f0171bb214a0df7c1425d3d1bddc47a))
227
+
228
+ ## [0.6.2](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.6.1...@mux/mux-audio@0.6.2) (2022-08-02)
229
+
230
+ ### Bug Fixes
231
+
232
+ - CustomVideo.nativeEl being null in some cases ([#316](https://github.com/muxinc/elements/issues/316)) ([0563c30](https://github.com/muxinc/elements/commit/0563c3041cccd9b985a9093a8c7c7cc80433147c)), closes [#314](https://github.com/muxinc/elements/issues/314)
233
+
234
+ ## [0.6.1](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.6.0...@mux/mux-audio@0.6.1) (2022-07-21)
235
+
236
+ **Note:** Version bump only for package @mux/mux-audio
237
+
238
+ # 0.6.0 (2022-07-05)
239
+
240
+ ### Bug Fixes
241
+
242
+ - Add catches with error logging if mux-video or mux-audio fails to load or parse metadata from metadata-url. ([c53a9be](https://github.com/muxinc/elements/commit/c53a9be15b7a8ec8e7191ce1136152bf3d046a63))
243
+ - clear some state on playbackId change ([#174](https://github.com/muxinc/elements/issues/174)) ([af0738e](https://github.com/muxinc/elements/commit/af0738ea5ae5a75861f75fc2ae3809ada735f3e2))
244
+ - custom video events handling ([#203](https://github.com/muxinc/elements/issues/203)) ([a909f89](https://github.com/muxinc/elements/commit/a909f89a69ee0d4b67e9d9371ac0f80984016181))
245
+ - error message was not passed back to player ([ade8143](https://github.com/muxinc/elements/commit/ade81438834610a7bddfa158ff20ec671ccd508f))
246
+ - fix 3x init of playback-core if `src` used ([#213](https://github.com/muxinc/elements/issues/213)) ([1d3e465](https://github.com/muxinc/elements/commit/1d3e465f8cc40544f0fb2c17ff4fb435c9e9a807))
247
+ - keep .hls but have it log a warning saying to use .\_hls ([11e6c10](https://github.com/muxinc/elements/commit/11e6c102a7e238bc8104c52ae9b94e7e3c2c7e19))
248
+ - **mux-audio:** Fix mux-audio, add shadow & props ([c74a448](https://github.com/muxinc/elements/commit/c74a448347cf6585944a08c977b138c560229e4e))
249
+ - **mux-audio:** use generateInitTime() instead of Date.now. ([6b67651](https://github.com/muxinc/elements/commit/6b67651245ee32ee864c8c114cdf480c618e2d8a))
250
+ - **mux-audio:** Use window polyfill for CustomAudioElement browser dependencies. ([2afb742](https://github.com/muxinc/elements/commit/2afb742911a29e708283faaca5fc966b9493670a))
251
+ - point pkgjson#browser at mjs build for webpack 4 ([#191](https://github.com/muxinc/elements/issues/191)) ([a73a495](https://github.com/muxinc/elements/commit/a73a4951052bfc77cc24667b9bc0a05efbcbb355))
252
+ - prettier format all elements files ([741d607](https://github.com/muxinc/elements/commit/741d607521ca9578cfad9f0a9216a6565b4c56a1))
253
+ - switch cjs extension to .cjs.js ([30e83c3](https://github.com/muxinc/elements/commit/30e83c3ce0bd9bfda4817c30ffe0921e425619e4))
254
+
255
+ ### Features
256
+
257
+ - add beaconCollectionDomain option to replace beaconDomain ([a44b699](https://github.com/muxinc/elements/commit/a44b699ae3138590b9d953f693f95971694658df))
258
+ - add part=video/audio for mux-video/audio ([49e5b6f](https://github.com/muxinc/elements/commit/49e5b6f14fde14d429afae5c5a46d7595c4e027e)), closes [#125](https://github.com/muxinc/elements/issues/125)
259
+ - Extended autoplay options ([#116](https://github.com/muxinc/elements/issues/116)) ([475e838](https://github.com/muxinc/elements/commit/475e83884f641c578fa601c9501147d485fc1831))
260
+ - Initial immplementation of mux-audio. ([a33b2ea](https://github.com/muxinc/elements/commit/a33b2ea1ba5b0a3c2c684291f98b3071bc4267ba))
261
+ - rename hls to \_hls ([2d53bc2](https://github.com/muxinc/elements/commit/2d53bc2517840d65a8fd5e2bb2d979ce8b491116))
262
+ - support hls audio as first pass impl. Re-add playback-id support. ([d5229d2](https://github.com/muxinc/elements/commit/d5229d26be74338158a4037ff82f23123011cc6c))
263
+ - **support-media-types:** Add support for non hls media. Add (optional) type attribute. (refs [#23](https://github.com/muxinc/elements/issues/23)) ([fe4cdd5](https://github.com/muxinc/elements/commit/fe4cdd59f63188033d737c9166ef0522b6ef74d6))
264
+ - **support-media-types:** ignore case for shorthand types. (fixes [#23](https://github.com/muxinc/elements/issues/23)) ([64eb088](https://github.com/muxinc/elements/commit/64eb0888d3d41880ff26b471db0cb964b61350ad))
265
+ - Updates to make mux-audio and mux-video builds easy to use in next.js (fixes [#15](https://github.com/muxinc/elements/issues/15)) ([99b8ea7](https://github.com/muxinc/elements/commit/99b8ea74785903c5b300007cf8c3bc8a7601ae2d))
266
+
267
+ ## [0.5.6](https://github.com/muxinc/elements/compare/@mux-elements/mux-audio@0.5.5...@mux-elements/mux-audio@0.5.6) (2022-06-23)
268
+
269
+ **Note:** Version bump only for package @mux-elements/mux-audio
270
+
271
+ ## [0.5.5](https://github.com/muxinc/elements/compare/@mux-elements/mux-audio@0.5.4...@mux-elements/mux-audio@0.5.5) (2022-06-06)
272
+
273
+ **Note:** Version bump only for package @mux-elements/mux-audio
274
+
275
+ ## [0.5.4](https://github.com/muxinc/elements/compare/@mux-elements/mux-audio@0.5.3...@mux-elements/mux-audio@0.5.4) (2022-05-26)
276
+
277
+ **Note:** Version bump only for package @mux-elements/mux-audio
278
+
279
+ ## [0.5.3](https://github.com/muxinc/elements/compare/@mux-elements/mux-audio@0.5.2...@mux-elements/mux-audio@0.5.3) (2022-05-23)
280
+
281
+ **Note:** Version bump only for package @mux-elements/mux-audio
282
+
283
+ ## [0.5.2](https://github.com/muxinc/elements/compare/@mux-elements/mux-audio@0.5.1...@mux-elements/mux-audio@0.5.2) (2022-05-20)
284
+
285
+ ### Bug Fixes
286
+
287
+ - switch cjs extension to .cjs.js ([30e83c3](https://github.com/muxinc/elements/commit/30e83c3ce0bd9bfda4817c30ffe0921e425619e4))
288
+
289
+ ## [0.5.1](https://github.com/muxinc/elements/compare/@mux-elements/mux-audio@0.5.0...@mux-elements/mux-audio@0.5.1) (2022-05-10)
290
+
291
+ ### Bug Fixes
292
+
293
+ - error message was not passed back to player ([ade8143](https://github.com/muxinc/elements/commit/ade81438834610a7bddfa158ff20ec671ccd508f))
294
+ - fix 3x init of playback-core if `src` used ([#213](https://github.com/muxinc/elements/issues/213)) ([1d3e465](https://github.com/muxinc/elements/commit/1d3e465f8cc40544f0fb2c17ff4fb435c9e9a807))
295
+
296
+ # [0.5.0](https://github.com/muxinc/elements/compare/@mux-elements/mux-audio@0.4.4...@mux-elements/mux-audio@0.5.0) (2022-05-03)
297
+
298
+ ### Bug Fixes
299
+
300
+ - custom video events handling ([#203](https://github.com/muxinc/elements/issues/203)) ([a909f89](https://github.com/muxinc/elements/commit/a909f89a69ee0d4b67e9d9371ac0f80984016181))
301
+ - keep .hls but have it log a warning saying to use .\_hls ([11e6c10](https://github.com/muxinc/elements/commit/11e6c102a7e238bc8104c52ae9b94e7e3c2c7e19))
302
+
303
+ ### Features
304
+
305
+ - add part=video/audio for mux-video/audio ([49e5b6f](https://github.com/muxinc/elements/commit/49e5b6f14fde14d429afae5c5a46d7595c4e027e)), closes [#125](https://github.com/muxinc/elements/issues/125)
306
+ - rename hls to \_hls ([2d53bc2](https://github.com/muxinc/elements/commit/2d53bc2517840d65a8fd5e2bb2d979ce8b491116))
307
+
308
+ ## [0.4.4](https://github.com/muxinc/elements/compare/@mux-elements/mux-audio@0.4.3...@mux-elements/mux-audio@0.4.4) (2022-04-22)
309
+
310
+ ### Bug Fixes
311
+
312
+ - point pkgjson#browser at mjs build for webpack 4 ([#191](https://github.com/muxinc/elements/issues/191)) ([a73a495](https://github.com/muxinc/elements/commit/a73a4951052bfc77cc24667b9bc0a05efbcbb355))
313
+
314
+ ## [0.4.3](https://github.com/muxinc/elements/compare/@mux-elements/mux-audio@0.4.2...@mux-elements/mux-audio@0.4.3) (2022-04-18)
315
+
316
+ **Note:** Version bump only for package @mux-elements/mux-audio
317
+
318
+ ## [0.4.2](https://github.com/muxinc/elements/compare/@mux-elements/mux-audio@0.4.1...@mux-elements/mux-audio@0.4.2) (2022-04-12)
319
+
320
+ ### Bug Fixes
321
+
322
+ - clear some state on playbackId change ([#174](https://github.com/muxinc/elements/issues/174)) ([af0738e](https://github.com/muxinc/elements/commit/af0738ea5ae5a75861f75fc2ae3809ada735f3e2))
323
+
324
+ ## [0.4.1](https://github.com/muxinc/elements/compare/@mux-elements/mux-audio@0.4.0...@mux-elements/mux-audio@0.4.1) (2022-04-01)
325
+
326
+ **Note:** Version bump only for package @mux-elements/mux-audio
327
+
328
+ # [0.4.0](https://github.com/muxinc/elements/compare/@mux-elements/mux-audio@0.3.0...@mux-elements/mux-audio@0.4.0) (2022-03-28)
329
+
330
+ ### Bug Fixes
331
+
332
+ - **mux-audio:** Fix mux-audio, add shadow & props ([c74a448](https://github.com/muxinc/elements/commit/c74a448347cf6585944a08c977b138c560229e4e))
333
+ - **mux-audio:** use generateInitTime() instead of Date.now. ([6b67651](https://github.com/muxinc/elements/commit/6b67651245ee32ee864c8c114cdf480c618e2d8a))
334
+ - **mux-audio:** Use window polyfill for CustomAudioElement browser dependencies. ([2afb742](https://github.com/muxinc/elements/commit/2afb742911a29e708283faaca5fc966b9493670a))
335
+ - prettier format all elements files ([741d607](https://github.com/muxinc/elements/commit/741d607521ca9578cfad9f0a9216a6565b4c56a1))
336
+
337
+ ### Features
338
+
339
+ - add beaconCollectionDomain option to replace beaconDomain ([a44b699](https://github.com/muxinc/elements/commit/a44b699ae3138590b9d953f693f95971694658df))
package/dist/cjs.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "inputs": {
3
+ "src/polyfills/index.ts": {
4
+ "bytes": 2117,
5
+ "imports": []
6
+ },
7
+ "src/env.ts": {
8
+ "bytes": 391,
9
+ "imports": []
10
+ },
11
+ "../../node_modules/custom-media-element/custom-media-element.js": {
12
+ "bytes": 10645,
13
+ "imports": []
14
+ },
15
+ "src/index.ts": {
16
+ "bytes": 11784,
17
+ "imports": [
18
+ {
19
+ "path": "src/polyfills/index.ts",
20
+ "kind": "import-statement"
21
+ },
22
+ {
23
+ "path": "src/env.ts",
24
+ "kind": "import-statement"
25
+ },
26
+ {
27
+ "path": "../../node_modules/custom-media-element/custom-media-element.js",
28
+ "kind": "import-statement"
29
+ }
30
+ ]
31
+ }
32
+ },
33
+ "outputs": {
34
+ "dist/index.cjs.js.map": {
35
+ "imports": [],
36
+ "exports": [],
37
+ "inputs": {},
38
+ "bytes": 38971
39
+ },
40
+ "dist/index.cjs.js": {
41
+ "imports": [],
42
+ "exports": [],
43
+ "entryPoint": "src/index.ts",
44
+ "inputs": {
45
+ "src/index.ts": {
46
+ "bytesInOutput": 5214
47
+ },
48
+ "src/polyfills/index.ts": {
49
+ "bytesInOutput": 739
50
+ },
51
+ "src/env.ts": {
52
+ "bytesInOutput": 73
53
+ },
54
+ "../../node_modules/custom-media-element/custom-media-element.js": {
55
+ "bytesInOutput": 5139
56
+ }
57
+ },
58
+ "bytes": 12166
59
+ }
60
+ }
61
+ }
package/dist/esm.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "inputs": {
3
+ "src/polyfills/index.ts": {
4
+ "bytes": 2117,
5
+ "imports": []
6
+ },
7
+ "src/env.ts": {
8
+ "bytes": 391,
9
+ "imports": []
10
+ },
11
+ "../../node_modules/custom-media-element/custom-media-element.js": {
12
+ "bytes": 10645,
13
+ "imports": []
14
+ },
15
+ "src/index.ts": {
16
+ "bytes": 11784,
17
+ "imports": [
18
+ {
19
+ "path": "src/polyfills/index.ts",
20
+ "kind": "import-statement"
21
+ },
22
+ {
23
+ "path": "src/env.ts",
24
+ "kind": "import-statement"
25
+ },
26
+ {
27
+ "path": "../../node_modules/custom-media-element/custom-media-element.js",
28
+ "kind": "import-statement"
29
+ }
30
+ ]
31
+ }
32
+ },
33
+ "outputs": {
34
+ "dist/index.mjs.map": {
35
+ "imports": [],
36
+ "exports": [],
37
+ "inputs": {},
38
+ "bytes": 39204
39
+ },
40
+ "dist/index.mjs": {
41
+ "imports": [],
42
+ "exports": [
43
+ "AudioEvents",
44
+ "MediaError",
45
+ "default"
46
+ ],
47
+ "entryPoint": "src/index.ts",
48
+ "inputs": {
49
+ "src/polyfills/index.ts": {
50
+ "bytesInOutput": 739
51
+ },
52
+ "src/index.ts": {
53
+ "bytesInOutput": 5112
54
+ },
55
+ "src/env.ts": {
56
+ "bytesInOutput": 73
57
+ },
58
+ "../../node_modules/custom-media-element/custom-media-element.js": {
59
+ "bytesInOutput": 5135
60
+ }
61
+ },
62
+ "bytes": 11709
63
+ }
64
+ }
65
+ }
package/dist/iife.json ADDED
@@ -0,0 +1,95 @@
1
+ {
2
+ "inputs": {
3
+ "src/polyfills/index.ts": {
4
+ "bytes": 2117,
5
+ "imports": []
6
+ },
7
+ "../../node_modules/mux-embed/dist/mux.js": {
8
+ "bytes": 85194,
9
+ "imports": []
10
+ },
11
+ "../../node_modules/hls.js/dist/hls.mjs": {
12
+ "bytes": 889425,
13
+ "imports": []
14
+ },
15
+ "../playback-core/dist/index.mjs": {
16
+ "bytes": 17803,
17
+ "imports": [
18
+ {
19
+ "path": "../../node_modules/mux-embed/dist/mux.js",
20
+ "kind": "import-statement"
21
+ },
22
+ {
23
+ "path": "../../node_modules/hls.js/dist/hls.mjs",
24
+ "kind": "import-statement"
25
+ }
26
+ ]
27
+ },
28
+ "src/env.ts": {
29
+ "bytes": 391,
30
+ "imports": []
31
+ },
32
+ "../../node_modules/custom-media-element/custom-media-element.js": {
33
+ "bytes": 10645,
34
+ "imports": []
35
+ },
36
+ "src/index.ts": {
37
+ "bytes": 11784,
38
+ "imports": [
39
+ {
40
+ "path": "src/polyfills/index.ts",
41
+ "kind": "import-statement"
42
+ },
43
+ {
44
+ "path": "../playback-core/dist/index.mjs",
45
+ "kind": "import-statement"
46
+ },
47
+ {
48
+ "path": "src/env.ts",
49
+ "kind": "import-statement"
50
+ },
51
+ {
52
+ "path": "../../node_modules/custom-media-element/custom-media-element.js",
53
+ "kind": "import-statement"
54
+ }
55
+ ]
56
+ }
57
+ },
58
+ "outputs": {
59
+ "dist/mux-audio.js.map": {
60
+ "imports": [],
61
+ "exports": [],
62
+ "inputs": {},
63
+ "bytes": 1947198
64
+ },
65
+ "dist/mux-audio.js": {
66
+ "imports": [],
67
+ "exports": [],
68
+ "entryPoint": "src/index.ts",
69
+ "inputs": {
70
+ "../../node_modules/mux-embed/dist/mux.js": {
71
+ "bytesInOutput": 85395
72
+ },
73
+ "src/polyfills/index.ts": {
74
+ "bytesInOutput": 767
75
+ },
76
+ "../playback-core/dist/index.mjs": {
77
+ "bytesInOutput": 16226
78
+ },
79
+ "../../node_modules/hls.js/dist/hls.mjs": {
80
+ "bytesInOutput": 357004
81
+ },
82
+ "src/env.ts": {
83
+ "bytesInOutput": 74
84
+ },
85
+ "../../node_modules/custom-media-element/custom-media-element.js": {
86
+ "bytesInOutput": 5180
87
+ },
88
+ "src/index.ts": {
89
+ "bytesInOutput": 5017
90
+ }
91
+ },
92
+ "bytes": 471035
93
+ }
94
+ }
95
+ }
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Y=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var ot=Object.getOwnPropertyNames;var ut=Object.prototype.hasOwnProperty;var lt=(i,e,t)=>e in i?Y(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var dt=(i,e)=>{for(var t in e)Y(i,t,{get:e[t],enumerable:!0})},ct=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of ot(e))!ut.call(i,u)&&u!==t&&Y(i,u,{get:()=>e[u],enumerable:!(a=at(e,u))||a.enumerable});return i};var ht=i=>ct(Y({},"__esModule",{value:!0}),i);var F=(i,e,t)=>(lt(i,typeof e!="symbol"?e+"":e,t),t),H=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var c=(i,e,t)=>(H(i,e,"read from private field"),t?t.call(i):e.get(i)),h=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},b=(i,e,t,a)=>(H(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var g=(i,e,t)=>(H(i,e,"access private method"),t);var Ct={};dt(Ct,{AudioEvents:()=>W,MediaError:()=>d.MediaError,default:()=>Tt});module.exports=ht(Ct);var _=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends _{}globalThis.DocumentFragment=i}var I=class extends _{},V=class extends _{},mt={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(I)}},N,q=class{constructor(e,t={}){h(this,N,void 0);b(this,N,t==null?void 0:t.detail)}get detail(){return c(this,N)}initCustomEvent(){}};N=new WeakMap;function pt(i,e){return new I}var Q={document:{createElement:pt},DocumentFragment,customElements:mt,CustomEvent:q,EventTarget:_,HTMLElement:I,HTMLVideoElement:V},X=typeof window=="undefined"||typeof globalThis.customElements=="undefined",U=X?Q:globalThis,_t=X?Q.document:globalThis.document;var d=require("@mux/playback-core");var bt=()=>{try{return"0.10.9"}catch{}return"UNKNOWN"},ft=bt(),Z=()=>ft;var W=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"],tt,$=(tt=globalThis.document)==null?void 0:tt.createElement("template");$&&($.innerHTML=`
1
+ "use strict";var Y=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var ot=Object.getOwnPropertyNames;var lt=Object.prototype.hasOwnProperty;var ut=(i,e,t)=>e in i?Y(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var dt=(i,e)=>{for(var t in e)Y(i,t,{get:e[t],enumerable:!0})},ct=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of ot(e))!lt.call(i,l)&&l!==t&&Y(i,l,{get:()=>e[l],enumerable:!(a=at(e,l))||a.enumerable});return i};var ht=i=>ct(Y({},"__esModule",{value:!0}),i);var H=(i,e,t)=>(ut(i,typeof e!="symbol"?e+"":e,t),t),V=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var c=(i,e,t)=>(V(i,e,"read from private field"),t?t.call(i):e.get(i)),h=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},b=(i,e,t,a)=>(V(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var f=(i,e,t)=>(V(i,e,"access private method"),t);var Ct={};dt(Ct,{AudioEvents:()=>J,MediaError:()=>d.MediaError,default:()=>Tt});module.exports=ht(Ct);var _=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends _{}globalThis.DocumentFragment=i}var N=class extends _{},q=class extends _{},mt={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(N)}},R,$=class{constructor(e,t={}){h(this,R,void 0);b(this,R,t==null?void 0:t.detail)}get detail(){return c(this,R)}initCustomEvent(){}};R=new WeakMap;function pt(i,e){return new N}var Q={document:{createElement:pt},DocumentFragment,customElements:mt,CustomEvent:$,EventTarget:_,HTMLElement:N,HTMLVideoElement:q},X=typeof window=="undefined"||typeof globalThis.customElements=="undefined",U=X?Q:globalThis,_t=X?Q.document:globalThis.document;var d=require("@mux/playback-core");var bt=()=>{try{return"0.10.10"}catch{}return"UNKNOWN"},ft=bt(),Z=()=>ft;var J=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"],tt,z=(tt=globalThis.document)==null?void 0:tt.createElement("template");z&&(z.innerHTML=`
2
2
  <style>
3
3
  :host {
4
4
  display: inline-block;
@@ -13,7 +13,7 @@
13
13
  }
14
14
  </style>
15
15
  <slot></slot>
16
- `);var et,z=(et=globalThis.document)==null?void 0:et.createElement("template");z&&(z.innerHTML=`
16
+ `);var et,W=(et=globalThis.document)==null?void 0:et.createElement("template");W&&(W.innerHTML=`
17
17
  <style>
18
18
  :host {
19
19
  display: inline-block;
@@ -35,5 +35,5 @@
35
35
  }
36
36
  </style>
37
37
  <slot></slot>
38
- `);var it=(i,{tag:e,is:t})=>{var M,f,T,m,st,x,L,C,P,B,rt,K,nt;let a=(M=globalThis.document)==null?void 0:M.createElement(e,{is:t}),u=a?gt(a):[];return f=class extends i{constructor(){super();h(this,C);h(this,B);h(this,K);h(this,x,void 0);h(this,L,void 0);this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.append(this.constructor.template.content.cloneNode(!0)))}static get observedAttributes(){var r,E,p;return g(r=f,m,st).call(r),[...(p=(E=a==null?void 0:a.constructor)==null?void 0:E.observedAttributes)!=null?p:[],"autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"]}get nativeEl(){var s,r;return(r=(s=c(this,L))!=null?s:this.shadowRoot.querySelector(e))!=null?r:this.querySelector(e)}set nativeEl(s){b(this,L,s)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(s){this.toggleAttribute("muted",Boolean(s))}get src(){return this.getAttribute("src")}set src(s){this.setAttribute("src",`${s}`)}get preload(){var s,r;return(r=this.getAttribute("preload"))!=null?r:(s=this.nativeEl)==null?void 0:s.preload}set preload(s){this.setAttribute("preload",`${s}`)}attributeChangedCallback(s,r,E){g(this,C,P).call(this),g(this,K,nt).call(this,s,r,E)}connectedCallback(){g(this,C,P).call(this)}},T=new WeakMap,m=new WeakSet,st=function(){if(c(this,T))return;b(this,T,!0);let s=new Set(this.observedAttributes);s.delete("muted");for(let r of u){if(r in this.prototype)continue;if(typeof a[r]=="function")this.prototype[r]=function(...p){return g(this,C,P).call(this),(()=>this.call?this.call(r,...p):this.nativeEl[r].apply(this.nativeEl,p))()};else{let p={get(){var l,A,S;g(this,C,P).call(this);let o=r.toLowerCase();if(s.has(o)){let k=this.getAttribute(o);return k===null?!1:k===""?!0:k}return(S=(l=this.get)==null?void 0:l.call(this,r))!=null?S:(A=this.nativeEl)==null?void 0:A[r]}};r!==r.toUpperCase()&&(p.set=function(o){g(this,C,P).call(this);let l=r.toLowerCase();if(s.has(l)){o===!0||o===!1||o==null?this.toggleAttribute(l,Boolean(o)):this.setAttribute(l,o);return}if(this.set){this.set(r,o);return}this.nativeEl[r]=o}),Object.defineProperty(this.prototype,r,p)}}},x=new WeakMap,L=new WeakMap,C=new WeakSet,P=function(){var E,p;if(c(this,x))return;if(b(this,x,!0),!this.nativeEl){let o=document.createElement(e,{is:t});o.part=e,this.shadowRoot.append(o)}this.nativeEl.muted=this.hasAttribute("muted");for(let o of u)g(this,B,rt).call(this,o);let s=new Map,r=this.shadowRoot.querySelector("slot:not([name])");r==null||r.addEventListener("slotchange",()=>{let o=new Map(s);r.assignedElements().filter(l=>["track","source"].includes(l.localName)).forEach(l=>{var S,k;o.delete(l);let A=s.get(l);A||(A=l.cloneNode(),s.set(l,A)),(k=(S=this.nativeEl).append)==null||k.call(S,A)}),o.forEach(l=>l.remove())});for(let o of this.constructor.Events)(p=(E=this.shadowRoot).addEventListener)==null||p.call(E,o,l=>{l.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(l.type,{detail:l.detail}))},!0)},B=new WeakSet,rt=function(s){if(Object.prototype.hasOwnProperty.call(this,s)){let r=this[s];delete this[s],this[s]=r}},K=new WeakSet,nt=function(s,r,E){var p,o,l,A;["id","class"].includes(s)||(E===null?(o=(p=this.nativeEl).removeAttribute)==null||o.call(p,s):(A=(l=this.nativeEl).setAttribute)==null||A.call(l,s,E))},h(f,m),F(f,"Events",W),F(f,"template",e.endsWith("audio")?$:z),h(f,T,void 0),f};function gt(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t))e.push(...Object.getOwnPropertyNames(t));return e}var xt=globalThis.document?it(HTMLElement,{tag:"video"}):class{},j=globalThis.document?it(HTMLElement,{tag:"audio"}):class{};var n={ENV_KEY:"env-key",DEBUG:"debug",PLAYBACK_ID:"playback-id",METADATA_URL:"metadata-url",PREFER_PLAYBACK:"prefer-playback",BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",DISABLE_COOKIES:"disable-cookies",TYPE:"type",STREAM_TYPE:"stream-type",START_TIME:"start-time"},Et=Object.values(n),At=Z(),yt="mux-audio",y,v,D,O,w,J,R=class extends j{constructor(){super();h(this,w);h(this,y,void 0);h(this,v,void 0);h(this,D,void 0);h(this,O,{});b(this,D,(0,d.generatePlayerInitTime)())}static get observedAttributes(){var t;return[...Et,...(t=j.observedAttributes)!=null?t:[]]}get playerInitTime(){return c(this,D)}get playerSoftwareName(){return yt}get playerSoftwareVersion(){return At}get _hls(){var t;return(t=c(this,y))==null?void 0:t.engine}get mux(){return this.nativeEl.mux}get src(){return this.getAttribute("src")}set src(t){t!==this.src&&(t==null?this.removeAttribute("src"):this.setAttribute("src",t))}get preload(){let t=this.getAttribute("preload");return t===""?"auto":["none","metadata","auto"].includes(t)?t:super.preload}set preload(t){t!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(t)?this.setAttribute("preload",t):this.removeAttribute("preload"))}get debug(){return this.getAttribute(n.DEBUG)!=null}set debug(t){t!==this.debug&&(t?this.setAttribute(n.DEBUG,""):this.removeAttribute(n.DEBUG))}get disableCookies(){return this.hasAttribute(n.DISABLE_COOKIES)}set disableCookies(t){t!==this.disableCookies&&(t?this.setAttribute(n.DISABLE_COOKIES,""):this.removeAttribute(n.DISABLE_COOKIES))}get startTime(){let t=this.getAttribute(n.START_TIME);if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}set startTime(t){t!==this.startTime&&(t==null?this.removeAttribute(n.START_TIME):this.setAttribute(n.START_TIME,`${t}`))}get playbackId(){var t;return(t=this.getAttribute(n.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t!==this.playbackId&&(t?this.setAttribute(n.PLAYBACK_ID,t):this.removeAttribute(n.PLAYBACK_ID))}get ended(){return(0,d.getEnded)(this.nativeEl,this._hls)}get envKey(){var t;return(t=this.getAttribute(n.ENV_KEY))!=null?t:void 0}set envKey(t){t!==this.envKey&&(t?this.setAttribute(n.ENV_KEY,t):this.removeAttribute(n.ENV_KEY))}get beaconCollectionDomain(){var t;return(t=this.getAttribute(n.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(n.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(n.BEACON_COLLECTION_DOMAIN))}get streamType(){var t;return(t=this.getAttribute(n.STREAM_TYPE))!=null?t:void 0}set streamType(t){t!==this.streamType&&(t?this.setAttribute(n.STREAM_TYPE,t):this.removeAttribute(n.STREAM_TYPE))}getStartDate(){return(0,d.getStartDate)(this.nativeEl,this._hls)}get currentPdt(){return(0,d.getCurrentPdt)(this.nativeEl,this._hls)}get preferPlayback(){let t=this.getAttribute(n.PREFER_PLAYBACK);if(t===d.PlaybackTypes.MSE||t===d.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===d.PlaybackTypes.MSE||t===d.PlaybackTypes.NATIVE?this.setAttribute(n.PREFER_PLAYBACK,t):this.removeAttribute(n.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(a=>a.startsWith("metadata-")&&![n.METADATA_URL].includes(a)).reduce((a,u)=>{let M=this.getAttribute(u);return M!=null&&(a[u.replace(/^metadata-/,"").replace(/-/g,"_")]=M),a},{}),...c(this,O)}}set metadata(t){b(this,O,t!=null?t:{}),this.mux&&(console.info("Some metadata values may not be overridable at this time. Make sure you set all metadata to override before setting the src."),this.mux.emit("hb",c(this,O)))}load(){b(this,y,(0,d.initialize)(this,this.nativeEl,c(this,y)))}unload(){(0,d.teardown)(this.nativeEl,c(this,y)),b(this,y,void 0)}attributeChangedCallback(t,a,u){var f,T;switch(j.observedAttributes.includes(t)&&!["src","autoplay","preload"].includes(t)&&super.attributeChangedCallback(t,a,u),t){case"src":{let m=!!a,G=!!u;!m&&G?g(this,w,J).call(this):m&&!G?this.unload():m&&G&&(this.unload(),g(this,w,J).call(this));break}case"autoplay":if(u===a)break;(f=c(this,y))==null||f.setAutoplay(this.autoplay);break;case"preload":if(u===a)break;(T=c(this,y))==null||T.setPreload(u);break;case n.PLAYBACK_ID:this.src=(0,d.toMuxVideoURL)(u!=null?u:void 0);break;case n.DEBUG:{let m=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=m);break}case n.METADATA_URL:u&&fetch(u).then(m=>m.json()).then(m=>this.metadata=m).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${u}!`));break;default:break}}disconnectedCallback(){this.unload()}};y=new WeakMap,v=new WeakMap,D=new WeakMap,O=new WeakMap,w=new WeakSet,J=async function(){c(this,v)||(await b(this,v,Promise.resolve()),b(this,v,null),this.load())};U.customElements.get("mux-audio")||(U.customElements.define("mux-audio",R),U.MuxAudioElement=R);var Tt=R;
38
+ `);var it=(i,{tag:e,is:t})=>{var k,g,T,m,st,L,S,C,v,B,rt,K,nt;let a=(k=globalThis.document)==null?void 0:k.createElement(e,{is:t}),l=a?gt(a):[];return g=class extends i{constructor(){super();h(this,C);h(this,B);h(this,K);h(this,L,void 0);h(this,S,void 0);this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.append(this.constructor.template.content.cloneNode(!0)))}static get observedAttributes(){var r,E,p;return f(r=g,m,st).call(r),[...(p=(E=a==null?void 0:a.constructor)==null?void 0:E.observedAttributes)!=null?p:[],"autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"]}get nativeEl(){var s,r;return(r=(s=c(this,S))!=null?s:this.shadowRoot.querySelector(e))!=null?r:this.querySelector(e)}set nativeEl(s){b(this,S,s)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(s){this.toggleAttribute("muted",Boolean(s))}get src(){return this.getAttribute("src")}set src(s){this.setAttribute("src",`${s}`)}get preload(){var s,r;return(r=this.getAttribute("preload"))!=null?r:(s=this.nativeEl)==null?void 0:s.preload}set preload(s){this.setAttribute("preload",`${s}`)}attributeChangedCallback(s,r,E){f(this,C,v).call(this),f(this,K,nt).call(this,s,r,E)}connectedCallback(){f(this,C,v).call(this)}},T=new WeakMap,m=new WeakSet,st=function(){if(c(this,T))return;b(this,T,!0);let s=new Set(this.observedAttributes);s.delete("muted");for(let r of l){if(r in this.prototype)continue;if(typeof a[r]=="function")this.prototype[r]=function(...p){return f(this,C,v).call(this),(()=>this.call?this.call(r,...p):this.nativeEl[r].apply(this.nativeEl,p))()};else{let p={get(){var u,y,I;f(this,C,v).call(this);let o=r.toLowerCase();if(s.has(o)){let M=this.getAttribute(o);return M===null?!1:M===""?!0:M}return(I=(u=this.get)==null?void 0:u.call(this,r))!=null?I:(y=this.nativeEl)==null?void 0:y[r]}};r!==r.toUpperCase()&&(p.set=function(o){f(this,C,v).call(this);let u=r.toLowerCase();if(s.has(u)){o===!0||o===!1||o==null?this.toggleAttribute(u,Boolean(o)):this.setAttribute(u,o);return}if(this.set){this.set(r,o);return}this.nativeEl[r]=o}),Object.defineProperty(this.prototype,r,p)}}},L=new WeakMap,S=new WeakMap,C=new WeakSet,v=function(){var E,p;if(c(this,L))return;if(b(this,L,!0),!this.nativeEl){let o=document.createElement(e,{is:t});o.part=e,this.shadowRoot.append(o)}this.nativeEl.muted=this.hasAttribute("muted");for(let o of l)f(this,B,rt).call(this,o);let s=new Map,r=this.shadowRoot.querySelector("slot:not([name])");r==null||r.addEventListener("slotchange",()=>{let o=new Map(s);r.assignedElements().filter(u=>["track","source"].includes(u.localName)).forEach(u=>{var I,M;o.delete(u);let y=s.get(u);y||(y=u.cloneNode(),s.set(u,y)),(M=(I=this.nativeEl).append)==null||M.call(I,y)}),o.forEach(u=>u.remove())});for(let o of this.constructor.Events)(p=(E=this.shadowRoot).addEventListener)==null||p.call(E,o,u=>{u.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(u.type,{detail:u.detail}))},!0)},B=new WeakSet,rt=function(s){if(Object.prototype.hasOwnProperty.call(this,s)){let r=this[s];delete this[s],this[s]=r}},K=new WeakSet,nt=function(s,r,E){var p,o,u,y;["id","class"].includes(s)||(E===null?(o=(p=this.nativeEl).removeAttribute)==null||o.call(p,s):(y=(u=this.nativeEl).setAttribute)==null||y.call(u,s,E))},h(g,m),H(g,"Events",J),H(g,"template",e.endsWith("audio")?z:W),h(g,T,void 0),g};function gt(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t))e.push(...Object.getOwnPropertyNames(t));return e}var xt=globalThis.document?it(HTMLElement,{tag:"video"}):class{},j=globalThis.document?it(HTMLElement,{tag:"audio"}):class{};var n={ENV_KEY:"env-key",DEBUG:"debug",PLAYBACK_ID:"playback-id",METADATA_URL:"metadata-url",PREFER_PLAYBACK:"prefer-playback",BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",DISABLE_COOKIES:"disable-cookies",TYPE:"type",STREAM_TYPE:"stream-type",START_TIME:"start-time"},Et=Object.values(n),At=Z(),yt="mux-audio",A,P,w,O,x,G,D=class extends j{constructor(){super();h(this,x);h(this,A,void 0);h(this,P,void 0);h(this,w,void 0);h(this,O,{});b(this,w,(0,d.generatePlayerInitTime)())}static get observedAttributes(){var t;return[...Et,...(t=j.observedAttributes)!=null?t:[]]}get playerInitTime(){return c(this,w)}get playerSoftwareName(){return yt}get playerSoftwareVersion(){return At}get _hls(){var t;return(t=c(this,A))==null?void 0:t.engine}get mux(){return this.nativeEl.mux}get src(){return this.getAttribute("src")}set src(t){t!==this.src&&(t==null?this.removeAttribute("src"):this.setAttribute("src",t))}get preload(){let t=this.getAttribute("preload");return t===""?"auto":["none","metadata","auto"].includes(t)?t:super.preload}set preload(t){t!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(t)?this.setAttribute("preload",t):this.removeAttribute("preload"))}get debug(){return this.getAttribute(n.DEBUG)!=null}set debug(t){t!==this.debug&&(t?this.setAttribute(n.DEBUG,""):this.removeAttribute(n.DEBUG))}get disableCookies(){return this.hasAttribute(n.DISABLE_COOKIES)}set disableCookies(t){t!==this.disableCookies&&(t?this.setAttribute(n.DISABLE_COOKIES,""):this.removeAttribute(n.DISABLE_COOKIES))}get startTime(){let t=this.getAttribute(n.START_TIME);if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}set startTime(t){t!==this.startTime&&(t==null?this.removeAttribute(n.START_TIME):this.setAttribute(n.START_TIME,`${t}`))}get playbackId(){var t;return(t=this.getAttribute(n.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t!==this.playbackId&&(t?this.setAttribute(n.PLAYBACK_ID,t):this.removeAttribute(n.PLAYBACK_ID))}get ended(){return(0,d.getEnded)(this.nativeEl,this._hls)}get envKey(){var t;return(t=this.getAttribute(n.ENV_KEY))!=null?t:void 0}set envKey(t){t!==this.envKey&&(t?this.setAttribute(n.ENV_KEY,t):this.removeAttribute(n.ENV_KEY))}get beaconCollectionDomain(){var t;return(t=this.getAttribute(n.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(n.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(n.BEACON_COLLECTION_DOMAIN))}get streamType(){var t;return(t=this.getAttribute(n.STREAM_TYPE))!=null?t:void 0}set streamType(t){t!==this.streamType&&(t?this.setAttribute(n.STREAM_TYPE,t):this.removeAttribute(n.STREAM_TYPE))}getStartDate(){return(0,d.getStartDate)(this.nativeEl,this._hls)}get currentPdt(){return(0,d.getCurrentPdt)(this.nativeEl,this._hls)}get preferPlayback(){let t=this.getAttribute(n.PREFER_PLAYBACK);if(t===d.PlaybackTypes.MSE||t===d.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===d.PlaybackTypes.MSE||t===d.PlaybackTypes.NATIVE?this.setAttribute(n.PREFER_PLAYBACK,t):this.removeAttribute(n.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(a=>a.startsWith("metadata-")&&![n.METADATA_URL].includes(a)).reduce((a,l)=>{let k=this.getAttribute(l);return k!=null&&(a[l.replace(/^metadata-/,"").replace(/-/g,"_")]=k),a},{}),...c(this,O)}}set metadata(t){b(this,O,t!=null?t:{}),this.mux&&(console.info("Some metadata values may not be overridable at this time. Make sure you set all metadata to override before setting the src."),this.mux.emit("hb",c(this,O)))}load(){b(this,A,(0,d.initialize)(this,this.nativeEl,c(this,A)))}unload(){(0,d.teardown)(this.nativeEl,c(this,A)),b(this,A,void 0)}attributeChangedCallback(t,a,l){var g,T;switch(j.observedAttributes.includes(t)&&!["src","autoplay","preload"].includes(t)&&super.attributeChangedCallback(t,a,l),t){case"src":{let m=!!a,F=!!l;!m&&F?f(this,x,G).call(this):m&&!F?this.unload():m&&F&&(this.unload(),f(this,x,G).call(this));break}case"autoplay":if(l===a)break;(g=c(this,A))==null||g.setAutoplay(this.autoplay);break;case"preload":if(l===a)break;(T=c(this,A))==null||T.setPreload(l);break;case n.PLAYBACK_ID:this.src=(0,d.toMuxVideoURL)(l!=null?l:void 0);break;case n.DEBUG:{let m=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=m);break}case n.METADATA_URL:l&&fetch(l).then(m=>m.json()).then(m=>this.metadata=m).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${l}!`));break;default:break}}connectedCallback(){var t;(t=super.connectedCallback)==null||t.call(this),this.nativeEl&&this.src&&!c(this,A)&&f(this,x,G).call(this)}disconnectedCallback(){this.unload()}};A=new WeakMap,P=new WeakMap,w=new WeakMap,O=new WeakMap,x=new WeakSet,G=async function(){c(this,P)||(await b(this,P,Promise.resolve()),b(this,P,null),this.load())};U.customElements.get("mux-audio")||(U.customElements.define("mux-audio",D),U.MuxAudioElement=D);var Tt=D;
39
39
  //# sourceMappingURL=index.cjs.js.map