@mux/mux-audio 0.7.0 → 0.8.0-canary.0-a2befb5

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,157 @@
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.8.0](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.7.0...@mux/mux-audio@0.8.0) (2022-10-25)
7
+
8
+
9
+ ### Features
10
+
11
+ * **mux-audio:** Add disable cookies attr and prop. ([ef453ed](https://github.com/muxinc/elements/commit/ef453edf9cb9696150ae89f995a6af8472161153))
12
+
13
+
14
+
15
+
16
+
17
+ # [0.7.0](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.6.4...@mux/mux-audio@0.7.0) (2022-10-05)
18
+
19
+ ### Bug Fixes
20
+
21
+ - preload for mux-audio, add tests ([e795fe0](https://github.com/muxinc/elements/commit/e795fe047af1feac832786aa03d8f419e57881b5))
22
+ - preload playback core change ([15313ea](https://github.com/muxinc/elements/commit/15313eaad81f748b5853a0fdaabfe141963f885e))
23
+
24
+ ### Features
25
+
26
+ - add `prefer-playback` attribute ([#402](https://github.com/muxinc/elements/issues/402)) ([8da36d6](https://github.com/muxinc/elements/commit/8da36d6b597ddbc4ae006873fee13a971b7ec2f3))
27
+ - remove deprecated .hls and .video props ([#408](https://github.com/muxinc/elements/issues/408)) ([2bd4861](https://github.com/muxinc/elements/commit/2bd48618d1b59d054e470ce9011c5c2f4904f8b6))
28
+
29
+ ### BREAKING CHANGES
30
+
31
+ - remove deprecated .hls and .video props.
32
+
33
+ ## [0.6.4](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.6.3...@mux/mux-audio@0.6.4) (2022-09-16)
34
+
35
+ ### Bug Fixes
36
+
37
+ - mux-video & mux-audio memory leak ([#387](https://github.com/muxinc/elements/issues/387)) ([4a0d921](https://github.com/muxinc/elements/commit/4a0d921c49a3bf730ad86a77e46a085c44ef91ea))
38
+ - update PlaybackEngine types ([1873781](https://github.com/muxinc/elements/commit/187378165a83e70d62bd5ba954b4986d0ae50738))
39
+
40
+ ## [0.6.3](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.6.2...@mux/mux-audio@0.6.3) (2022-08-31)
41
+
42
+ ### Bug Fixes
43
+
44
+ - polyfills mutating global ([#355](https://github.com/muxinc/elements/issues/355)) ([71d18a4](https://github.com/muxinc/elements/commit/71d18a427f0171bb214a0df7c1425d3d1bddc47a))
45
+
46
+ ## [0.6.2](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.6.1...@mux/mux-audio@0.6.2) (2022-08-02)
47
+
48
+ ### Bug Fixes
49
+
50
+ - 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)
51
+
52
+ ## [0.6.1](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.6.0...@mux/mux-audio@0.6.1) (2022-07-21)
53
+
54
+ **Note:** Version bump only for package @mux/mux-audio
55
+
56
+ # 0.6.0 (2022-07-05)
57
+
58
+ ### Bug Fixes
59
+
60
+ - 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))
61
+ - clear some state on playbackId change ([#174](https://github.com/muxinc/elements/issues/174)) ([af0738e](https://github.com/muxinc/elements/commit/af0738ea5ae5a75861f75fc2ae3809ada735f3e2))
62
+ - custom video events handling ([#203](https://github.com/muxinc/elements/issues/203)) ([a909f89](https://github.com/muxinc/elements/commit/a909f89a69ee0d4b67e9d9371ac0f80984016181))
63
+ - error message was not passed back to player ([ade8143](https://github.com/muxinc/elements/commit/ade81438834610a7bddfa158ff20ec671ccd508f))
64
+ - 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))
65
+ - keep .hls but have it log a warning saying to use .\_hls ([11e6c10](https://github.com/muxinc/elements/commit/11e6c102a7e238bc8104c52ae9b94e7e3c2c7e19))
66
+ - **mux-audio:** Fix mux-audio, add shadow & props ([c74a448](https://github.com/muxinc/elements/commit/c74a448347cf6585944a08c977b138c560229e4e))
67
+ - **mux-audio:** use generateInitTime() instead of Date.now. ([6b67651](https://github.com/muxinc/elements/commit/6b67651245ee32ee864c8c114cdf480c618e2d8a))
68
+ - **mux-audio:** Use window polyfill for CustomAudioElement browser dependencies. ([2afb742](https://github.com/muxinc/elements/commit/2afb742911a29e708283faaca5fc966b9493670a))
69
+ - 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))
70
+ - prettier format all elements files ([741d607](https://github.com/muxinc/elements/commit/741d607521ca9578cfad9f0a9216a6565b4c56a1))
71
+ - switch cjs extension to .cjs.js ([30e83c3](https://github.com/muxinc/elements/commit/30e83c3ce0bd9bfda4817c30ffe0921e425619e4))
72
+
73
+ ### Features
74
+
75
+ - add beaconCollectionDomain option to replace beaconDomain ([a44b699](https://github.com/muxinc/elements/commit/a44b699ae3138590b9d953f693f95971694658df))
76
+ - 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)
77
+ - Extended autoplay options ([#116](https://github.com/muxinc/elements/issues/116)) ([475e838](https://github.com/muxinc/elements/commit/475e83884f641c578fa601c9501147d485fc1831))
78
+ - Initial immplementation of mux-audio. ([a33b2ea](https://github.com/muxinc/elements/commit/a33b2ea1ba5b0a3c2c684291f98b3071bc4267ba))
79
+ - rename hls to \_hls ([2d53bc2](https://github.com/muxinc/elements/commit/2d53bc2517840d65a8fd5e2bb2d979ce8b491116))
80
+ - support hls audio as first pass impl. Re-add playback-id support. ([d5229d2](https://github.com/muxinc/elements/commit/d5229d26be74338158a4037ff82f23123011cc6c))
81
+ - **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))
82
+ - **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))
83
+ - 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))
84
+
85
+ ## [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)
86
+
87
+ **Note:** Version bump only for package @mux-elements/mux-audio
88
+
89
+ ## [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)
90
+
91
+ **Note:** Version bump only for package @mux-elements/mux-audio
92
+
93
+ ## [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)
94
+
95
+ **Note:** Version bump only for package @mux-elements/mux-audio
96
+
97
+ ## [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)
98
+
99
+ **Note:** Version bump only for package @mux-elements/mux-audio
100
+
101
+ ## [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)
102
+
103
+ ### Bug Fixes
104
+
105
+ - switch cjs extension to .cjs.js ([30e83c3](https://github.com/muxinc/elements/commit/30e83c3ce0bd9bfda4817c30ffe0921e425619e4))
106
+
107
+ ## [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)
108
+
109
+ ### Bug Fixes
110
+
111
+ - error message was not passed back to player ([ade8143](https://github.com/muxinc/elements/commit/ade81438834610a7bddfa158ff20ec671ccd508f))
112
+ - 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))
113
+
114
+ # [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)
115
+
116
+ ### Bug Fixes
117
+
118
+ - custom video events handling ([#203](https://github.com/muxinc/elements/issues/203)) ([a909f89](https://github.com/muxinc/elements/commit/a909f89a69ee0d4b67e9d9371ac0f80984016181))
119
+ - keep .hls but have it log a warning saying to use .\_hls ([11e6c10](https://github.com/muxinc/elements/commit/11e6c102a7e238bc8104c52ae9b94e7e3c2c7e19))
120
+
121
+ ### Features
122
+
123
+ - 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)
124
+ - rename hls to \_hls ([2d53bc2](https://github.com/muxinc/elements/commit/2d53bc2517840d65a8fd5e2bb2d979ce8b491116))
125
+
126
+ ## [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)
127
+
128
+ ### Bug Fixes
129
+
130
+ - 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))
131
+
132
+ ## [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)
133
+
134
+ **Note:** Version bump only for package @mux-elements/mux-audio
135
+
136
+ ## [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)
137
+
138
+ ### Bug Fixes
139
+
140
+ - clear some state on playbackId change ([#174](https://github.com/muxinc/elements/issues/174)) ([af0738e](https://github.com/muxinc/elements/commit/af0738ea5ae5a75861f75fc2ae3809ada735f3e2))
141
+
142
+ ## [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)
143
+
144
+ **Note:** Version bump only for package @mux-elements/mux-audio
145
+
146
+ # [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)
147
+
148
+ ### Bug Fixes
149
+
150
+ - **mux-audio:** Fix mux-audio, add shadow & props ([c74a448](https://github.com/muxinc/elements/commit/c74a448347cf6585944a08c977b138c560229e4e))
151
+ - **mux-audio:** use generateInitTime() instead of Date.now. ([6b67651](https://github.com/muxinc/elements/commit/6b67651245ee32ee864c8c114cdf480c618e2d8a))
152
+ - **mux-audio:** Use window polyfill for CustomAudioElement browser dependencies. ([2afb742](https://github.com/muxinc/elements/commit/2afb742911a29e708283faaca5fc966b9493670a))
153
+ - prettier format all elements files ([741d607](https://github.com/muxinc/elements/commit/741d607521ca9578cfad9f0a9216a6565b4c56a1))
154
+
155
+ ### Features
156
+
157
+ - add beaconCollectionDomain option to replace beaconDomain ([a44b699](https://github.com/muxinc/elements/commit/a44b699ae3138590b9d953f693f95971694658df))
package/README.md CHANGED
@@ -44,13 +44,13 @@ require('@mux/mux-audio');
44
44
  Alternatively, use the CDN hosted version of this package:
45
45
 
46
46
  ```html
47
- <script src="https://unpkg.com/@mux/mux-audio@0.4"></script>
47
+ <script src="https://cdn.jsdelivr.net/npm/@mux/mux-audio@0"></script>
48
48
  ```
49
49
 
50
50
  If you are using ecmascript modules, you can also load the `mux-audio.mjs` file with `type=module`:
51
51
 
52
52
  ```html
53
- <script type="module" src="https://unpkg.com/@mux/mux-audio@0.4/dist/mux-audio.mjs"></script>
53
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@mux/mux-audio@0/dist/mux-audio.mjs"></script>
54
54
  ```
55
55
 
56
56
  ## Usage
package/dist/cjs.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "inputs": {
3
+ "../../shared/polyfills/index.js": {
4
+ "bytes": 1440,
5
+ "imports": []
6
+ },
7
+ "src/env.ts": {
8
+ "bytes": 391,
9
+ "imports": []
10
+ },
11
+ "src/CustomAudioElement.js": {
12
+ "bytes": 8466,
13
+ "imports": [
14
+ {
15
+ "path": "../../shared/polyfills/index.js",
16
+ "kind": "import-statement"
17
+ }
18
+ ]
19
+ },
20
+ "src/index.ts": {
21
+ "bytes": 10550,
22
+ "imports": [
23
+ {
24
+ "path": "../../shared/polyfills/index.js",
25
+ "kind": "import-statement"
26
+ },
27
+ {
28
+ "path": "src/env.ts",
29
+ "kind": "import-statement"
30
+ },
31
+ {
32
+ "path": "src/CustomAudioElement.js",
33
+ "kind": "import-statement"
34
+ }
35
+ ]
36
+ }
37
+ },
38
+ "outputs": {
39
+ "dist/index.cjs.js.map": {
40
+ "imports": [],
41
+ "exports": [],
42
+ "inputs": {},
43
+ "bytes": 30990
44
+ },
45
+ "dist/index.cjs.js": {
46
+ "imports": [],
47
+ "exports": [],
48
+ "entryPoint": "src/index.ts",
49
+ "inputs": {
50
+ "src/index.ts": {
51
+ "bytesInOutput": 4516
52
+ },
53
+ "../../shared/polyfills/index.js": {
54
+ "bytesInOutput": 734
55
+ },
56
+ "src/env.ts": {
57
+ "bytesInOutput": 67
58
+ },
59
+ "src/CustomAudioElement.js": {
60
+ "bytesInOutput": 2936
61
+ }
62
+ },
63
+ "bytes": 9106
64
+ }
65
+ }
66
+ }
package/dist/esm.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "inputs": {
3
+ "../../shared/polyfills/index.js": {
4
+ "bytes": 1440,
5
+ "imports": []
6
+ },
7
+ "src/env.ts": {
8
+ "bytes": 391,
9
+ "imports": []
10
+ },
11
+ "src/CustomAudioElement.js": {
12
+ "bytes": 8466,
13
+ "imports": [
14
+ {
15
+ "path": "../../shared/polyfills/index.js",
16
+ "kind": "import-statement"
17
+ }
18
+ ]
19
+ },
20
+ "src/index.ts": {
21
+ "bytes": 10550,
22
+ "imports": [
23
+ {
24
+ "path": "../../shared/polyfills/index.js",
25
+ "kind": "import-statement"
26
+ },
27
+ {
28
+ "path": "src/env.ts",
29
+ "kind": "import-statement"
30
+ },
31
+ {
32
+ "path": "src/CustomAudioElement.js",
33
+ "kind": "import-statement"
34
+ }
35
+ ]
36
+ }
37
+ },
38
+ "outputs": {
39
+ "dist/index.mjs.map": {
40
+ "imports": [],
41
+ "exports": [],
42
+ "inputs": {},
43
+ "bytes": 31081
44
+ },
45
+ "dist/index.mjs": {
46
+ "imports": [],
47
+ "exports": [
48
+ "AudioEvents",
49
+ "MediaError",
50
+ "default"
51
+ ],
52
+ "entryPoint": "src/index.ts",
53
+ "inputs": {
54
+ "../../shared/polyfills/index.js": {
55
+ "bytesInOutput": 734
56
+ },
57
+ "src/index.ts": {
58
+ "bytesInOutput": 4401
59
+ },
60
+ "src/env.ts": {
61
+ "bytesInOutput": 67
62
+ },
63
+ "src/CustomAudioElement.js": {
64
+ "bytesInOutput": 2936
65
+ }
66
+ },
67
+ "bytes": 8619
68
+ }
69
+ }
70
+ }
package/dist/iife.json ADDED
@@ -0,0 +1,108 @@
1
+ {
2
+ "inputs": {
3
+ "../../shared/polyfills/index.js": {
4
+ "bytes": 1440,
5
+ "imports": []
6
+ },
7
+ "../../node_modules/mux-embed/dist/mux.js": {
8
+ "bytes": 78025,
9
+ "imports": []
10
+ },
11
+ "../../node_modules/hls.js/dist/hls.js": {
12
+ "bytes": 1036845,
13
+ "imports": []
14
+ },
15
+ "../playback-core/dist/index.mjs": {
16
+ "bytes": 10357,
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.js",
24
+ "kind": "import-statement"
25
+ },
26
+ {
27
+ "path": "../../node_modules/hls.js/dist/hls.js",
28
+ "kind": "import-statement"
29
+ },
30
+ {
31
+ "path": "../../node_modules/hls.js/dist/hls.js",
32
+ "kind": "import-statement"
33
+ }
34
+ ]
35
+ },
36
+ "src/env.ts": {
37
+ "bytes": 391,
38
+ "imports": []
39
+ },
40
+ "src/CustomAudioElement.js": {
41
+ "bytes": 8466,
42
+ "imports": [
43
+ {
44
+ "path": "../../shared/polyfills/index.js",
45
+ "kind": "import-statement"
46
+ }
47
+ ]
48
+ },
49
+ "src/index.ts": {
50
+ "bytes": 10550,
51
+ "imports": [
52
+ {
53
+ "path": "../../shared/polyfills/index.js",
54
+ "kind": "import-statement"
55
+ },
56
+ {
57
+ "path": "../playback-core/dist/index.mjs",
58
+ "kind": "import-statement"
59
+ },
60
+ {
61
+ "path": "src/env.ts",
62
+ "kind": "import-statement"
63
+ },
64
+ {
65
+ "path": "src/CustomAudioElement.js",
66
+ "kind": "import-statement"
67
+ }
68
+ ]
69
+ }
70
+ },
71
+ "outputs": {
72
+ "dist/mux-audio.js.map": {
73
+ "imports": [],
74
+ "exports": [],
75
+ "inputs": {},
76
+ "bytes": 1721123
77
+ },
78
+ "dist/mux-audio.js": {
79
+ "imports": [],
80
+ "exports": [],
81
+ "entryPoint": "src/index.ts",
82
+ "inputs": {
83
+ "../../node_modules/mux-embed/dist/mux.js": {
84
+ "bytesInOutput": 78377
85
+ },
86
+ "../../node_modules/hls.js/dist/hls.js": {
87
+ "bytesInOutput": 374495
88
+ },
89
+ "../../shared/polyfills/index.js": {
90
+ "bytesInOutput": 767
91
+ },
92
+ "../playback-core/dist/index.mjs": {
93
+ "bytesInOutput": 9930
94
+ },
95
+ "src/env.ts": {
96
+ "bytesInOutput": 72
97
+ },
98
+ "src/CustomAudioElement.js": {
99
+ "bytesInOutput": 2988
100
+ },
101
+ "src/index.ts": {
102
+ "bytesInOutput": 4309
103
+ }
104
+ },
105
+ "bytes": 472170
106
+ }
107
+ }
108
+ }
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var P=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var U=(t,i)=>{for(var e in i)P(t,e,{get:i[e],enumerable:!0})},F=(t,i,e,s)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of w(i))!K.call(t,r)&&r!==e&&P(t,r,{get:()=>i[r],enumerable:!(s=Y(i,r))||s.enumerable});return t};var j=t=>F(P({},"__esModule",{value:!0}),t);var O=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)};var y=(t,i,e)=>(O(t,i,"read from private field"),e?e.call(t):i.get(t)),f=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},g=(t,i,e,s)=>(O(t,i,"write to private field"),s?s.call(t,e):i.set(t,e),e);var _=(t,i,e)=>(O(t,i,"access private method"),e);var Z={};U(Z,{AudioEvents:()=>I,MediaError:()=>n.MediaError,default:()=>X});module.exports=j(Z);var h=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class t extends h{}globalThis.DocumentFragment=t}var b=class extends h{},C=class extends h{},V={get(t){},define(t,i,e){},upgrade(t){},whenDefined(t){return Promise.resolve(b)}},p,k=class{constructor(i,e={}){f(this,p,void 0);g(this,p,e==null?void 0:e.detail)}get detail(){return y(this,p)}initCustomEvent(){}};p=new WeakMap;function G(t,i){return new b}var D={document:{createElement:G},DocumentFragment,customElements:V,CustomEvent:k,EventTarget:h,HTMLElement:b,HTMLVideoElement:C},v=typeof window=="undefined"||typeof globalThis.customElements=="undefined",d=v?D:globalThis,x=v?D.document:globalThis.document;var n=require("@mux/playback-core");var H=()=>{try{return"0.7.0"}catch{}return"UNKNOWN"},z=H(),R=()=>z;var I=["abort","canplay","canplaythrough","durationchange","emptied","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"],S=x.createElement("template");S.innerHTML=`
1
+ "use strict";var M=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var U=(t,i)=>{for(var e in i)M(t,e,{get:i[e],enumerable:!0})},F=(t,i,e,a)=>{if(i&&typeof i=="object"||typeof i=="function")for(let s of Y(i))!w.call(t,s)&&s!==e&&M(t,s,{get:()=>i[s],enumerable:!(a=K(i,s))||a.enumerable});return t};var j=t=>F(M({},"__esModule",{value:!0}),t);var P=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)};var y=(t,i,e)=>(P(t,i,"read from private field"),e?e.call(t):i.get(t)),f=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},g=(t,i,e,a)=>(P(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e);var _=(t,i,e)=>(P(t,i,"access private method"),e);var Z={};U(Z,{AudioEvents:()=>L,MediaError:()=>n.MediaError,default:()=>X});module.exports=j(Z);var h=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class t extends h{}globalThis.DocumentFragment=t}var b=class extends h{},C=class extends h{},V={get(t){},define(t,i,e){},upgrade(t){},whenDefined(t){return Promise.resolve(b)}},E,k=class{constructor(i,e={}){f(this,E,void 0);g(this,E,e==null?void 0:e.detail)}get detail(){return y(this,E)}initCustomEvent(){}};E=new WeakMap;function G(t,i){return new b}var S={document:{createElement:G},DocumentFragment,customElements:V,CustomEvent:k,EventTarget:h,HTMLElement:b,HTMLVideoElement:C},x=typeof window=="undefined"||typeof globalThis.customElements=="undefined",d=x?S:globalThis,I=x?S.document:globalThis.document;var n=require("@mux/playback-core");var H=()=>{try{return"0.8.0"}catch{}return"UNKNOWN"},z=H(),v=()=>z;var L=["abort","canplay","canplaythrough","durationchange","emptied","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"],R=I.createElement("template");R.innerHTML=`
2
2
  <style>
3
3
  :host {
4
4
  /* display:inline (like the native el) makes it so you can't fill
@@ -21,5 +21,5 @@
21
21
 
22
22
  <audio part="audio" crossorigin></audio>
23
23
  <slot></slot>
24
- `;var E,m,T,c=class extends d.HTMLElement{constructor(){super();f(this,m);f(this,E,void 0);this.attachShadow({mode:"open"}),this.isConnected&&_(this,m,T).call(this)}static get observedAttributes(){let e=[];Object.getOwnPropertyNames(this.prototype).forEach(r=>{let u=!1;try{typeof this.prototype[r]=="function"&&(u=!0)}catch{}!u&&r!==r.toUpperCase()&&e.push(r.toLowerCase())});let s=Object.getPrototypeOf(this).observedAttributes;return s&&(e=e.concat(s)),e}attributeChangedCallback(e,s,r){_(this,m,T).call(this),this.forwardAttribute(e,s,r)}forwardAttribute(e,s,r){let u=Object.getOwnPropertyNames(Object.getPrototypeOf(this)),l=q(u,e),o=Object.getPrototypeOf(this.constructor).toString().indexOf("function HTMLElement")===0;l&&!o?typeof this[l]=="boolean"?r===null?this[l]=!1:this[l]=!0:this[l]=r:r===null?this.nativeEl.removeAttribute(e):["id","class"].indexOf(e)===-1&&this.nativeEl.setAttribute(e,r)}connectedCallback(){_(this,m,T).call(this)}};E=new WeakMap,m=new WeakSet,T=function(){if(y(this,E))return;g(this,E,!0),this.shadowRoot.append(S.content.cloneNode(!0));let e=this.nativeEl=this.shadowRoot.querySelector("audio");I.forEach(r=>{e.addEventListener(r,u=>{this.dispatchEvent(new CustomEvent(u.type,{detail:u.detail}))})});let s=this.shadowRoot.querySelector("slot");s.addEventListener("slotchange",()=>{s.assignedElements().forEach(r=>{!["track","source"].includes(r.localName)||e.append(r)})}),Array.from(this.attributes).forEach(r=>{this.forwardAttribute(r.name,null,r.value)}),e.defaultMuted&&(e.muted=!0)};var N=[],B=x.createElement("audio"),W=["webkitDisplayingFullscreen","webkitSupportsFullscreen"];for(let t=Object.getPrototypeOf(B);t&&t!==d.HTMLElement.prototype;t=Object.getPrototypeOf(t))Object.keys(t).forEach(i=>{W.indexOf(i)===-1&&N.push(i)});N.forEach(t=>{if(typeof B[t]=="function")c.prototype[t]=function(){return this.nativeEl[t].apply(this.nativeEl,arguments)};else{let e={get(){return this.nativeEl[t]}};t!==t.toUpperCase()&&(e.set=function(s){this.nativeEl[t]=s}),Object.defineProperty(c.prototype,t,e)}});function q(t,i){let e=null;return t.forEach(s=>{s.toLowerCase()==i.toLowerCase()&&(e=s)}),e}d.customElements.get("custom-audio")||(d.customElements.define("custom-audio",c),d.CustomAudioElement=c);var L=c;var a={ENV_KEY:"env-key",DEBUG:"debug",PLAYBACK_ID:"playback-id",METADATA_URL:"metadata-url",PREFER_PLAYBACK:"prefer-playback",METADATA_VIDEO_ID:"metadata-video-id",METADATA_VIDEO_TITLE:"metadata-video-title",METADATA_VIEWER_USER_ID:"metadata-viewer-user-id",BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",TYPE:"type",STREAM_TYPE:"stream-type",START_TIME:"start-time"},$=Object.values(a),J=R(),Q="mux-audio",A=class extends L{constructor(){super();this.__metadata={};this.__playerInitTime=(0,n.generatePlayerInitTime)()}static get observedAttributes(){var e;return[...$,...(e=L.observedAttributes)!=null?e:[]]}get playerInitTime(){return this.__playerInitTime}get playerSoftwareName(){return Q}get playerSoftwareVersion(){return J}get _hls(){var e;return(e=this.__core)==null?void 0:e.engine}get mux(){return this.nativeEl.mux}get src(){return this.getAttribute("src")}set src(e){e!==this.src&&(e==null?this.removeAttribute("src"):this.setAttribute("src",e))}get preload(){let e=this.getAttribute("preload");return e===""?"auto":["none","metadata","auto"].includes(e)?e:super.preload}set preload(e){e!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(e)?this.setAttribute("preload",e):this.removeAttribute("preload"))}get debug(){return this.getAttribute(a.DEBUG)!=null}set debug(e){e!==this.debug&&(e?this.setAttribute(a.DEBUG,""):this.removeAttribute(a.DEBUG))}get startTime(){let e=this.getAttribute(a.START_TIME);if(e==null)return;let s=+e;return Number.isNaN(s)?void 0:s}set startTime(e){e!==this.startTime&&(e==null?this.removeAttribute(a.START_TIME):this.setAttribute(a.START_TIME,`${e}`))}get playbackId(){var e;return(e=this.getAttribute(a.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e!==this.playbackId&&(e?this.setAttribute(a.PLAYBACK_ID,e):this.removeAttribute(a.PLAYBACK_ID))}get envKey(){var e;return(e=this.getAttribute(a.ENV_KEY))!=null?e:void 0}set envKey(e){e!==this.envKey&&(e?this.setAttribute(a.ENV_KEY,e):this.removeAttribute(a.ENV_KEY))}get beaconCollectionDomain(){var e;return(e=this.getAttribute(a.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(a.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(a.BEACON_COLLECTION_DOMAIN))}get streamType(){var e;return(e=this.getAttribute(a.STREAM_TYPE))!=null?e:void 0}set streamType(e){e!==this.streamType&&(e?this.setAttribute(a.STREAM_TYPE,e):this.removeAttribute(a.STREAM_TYPE))}get preferPlayback(){let e=this.getAttribute(a.PREFER_PLAYBACK);if(e===n.PlaybackTypes.MSE||e===n.PlaybackTypes.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===n.PlaybackTypes.MSE||e===n.PlaybackTypes.NATIVE?this.setAttribute(a.PREFER_PLAYBACK,e):this.removeAttribute(a.PREFER_PLAYBACK))}get metadata(){return this.__metadata}set metadata(e){this.__metadata=e!=null?e:{},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",this.__metadata))}load(){this.__core=(0,n.initialize)(this,this.nativeEl,this.__core)}unload(){(0,n.teardown)(this.nativeEl,this.__core),this.__core=void 0}attributeChangedCallback(e,s,r){var u,l;switch(super.attributeChangedCallback(e,s,r),e){case"src":{let o=!!s,M=!!r;!o&&M?this.load():o&&!M?this.unload():o&&M&&(this.unload(),this.load());break}case"autoplay":if(r===s)break;(u=this.__core)==null||u.setAutoplay(this.autoplay);break;case"preload":if(r===s)break;(l=this.__core)==null||l.setPreload(r);break;case a.PLAYBACK_ID:this.src=(0,n.toMuxVideoURL)(r!=null?r:void 0);break;case a.DEBUG:{let o=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=o);break}case a.METADATA_URL:r&&fetch(r).then(o=>o.json()).then(o=>this.metadata=o).catch(o=>console.error(`Unable to load or parse metadata JSON from metadata-url ${r}!`));break;default:break}}disconnectedCallback(){this.unload()}};d.customElements.get("mux-audio")||(d.customElements.define("mux-audio",A),d.MuxAudioElement=A);var X=A;
24
+ `;var p,m,T,c=class extends d.HTMLElement{constructor(){super();f(this,m);f(this,p,void 0);this.attachShadow({mode:"open"}),this.isConnected&&_(this,m,T).call(this)}static get observedAttributes(){let e=[];Object.getOwnPropertyNames(this.prototype).forEach(s=>{let u=!1;try{typeof this.prototype[s]=="function"&&(u=!0)}catch{}!u&&s!==s.toUpperCase()&&e.push(s.toLowerCase())});let a=Object.getPrototypeOf(this).observedAttributes;return a&&(e=e.concat(a)),e}attributeChangedCallback(e,a,s){_(this,m,T).call(this),this.forwardAttribute(e,a,s)}forwardAttribute(e,a,s){let u=Object.getOwnPropertyNames(Object.getPrototypeOf(this)),l=q(u,e),o=Object.getPrototypeOf(this.constructor).toString().indexOf("function HTMLElement")===0;l&&!o?typeof this[l]=="boolean"?s===null?this[l]=!1:this[l]=!0:this[l]=s:s===null?this.nativeEl.removeAttribute(e):["id","class"].indexOf(e)===-1&&this.nativeEl.setAttribute(e,s)}connectedCallback(){_(this,m,T).call(this)}};p=new WeakMap,m=new WeakSet,T=function(){if(y(this,p))return;g(this,p,!0),this.shadowRoot.append(R.content.cloneNode(!0));let e=this.nativeEl=this.shadowRoot.querySelector("audio");L.forEach(s=>{e.addEventListener(s,u=>{this.dispatchEvent(new CustomEvent(u.type,{detail:u.detail}))})});let a=this.shadowRoot.querySelector("slot");a.addEventListener("slotchange",()=>{a.assignedElements().forEach(s=>{!["track","source"].includes(s.localName)||e.append(s)})}),Array.from(this.attributes).forEach(s=>{this.forwardAttribute(s.name,null,s.value)}),e.defaultMuted&&(e.muted=!0)};var N=[],B=I.createElement("audio"),W=["webkitDisplayingFullscreen","webkitSupportsFullscreen"];for(let t=Object.getPrototypeOf(B);t&&t!==d.HTMLElement.prototype;t=Object.getPrototypeOf(t))Object.keys(t).forEach(i=>{W.indexOf(i)===-1&&N.push(i)});N.forEach(t=>{if(typeof B[t]=="function")c.prototype[t]=function(){return this.nativeEl[t].apply(this.nativeEl,arguments)};else{let e={get(){return this.nativeEl[t]}};t!==t.toUpperCase()&&(e.set=function(a){this.nativeEl[t]=a}),Object.defineProperty(c.prototype,t,e)}});function q(t,i){let e=null;return t.forEach(a=>{a.toLowerCase()==i.toLowerCase()&&(e=a)}),e}d.customElements.get("custom-audio")||(d.customElements.define("custom-audio",c),d.CustomAudioElement=c);var D=c;var r={ENV_KEY:"env-key",DEBUG:"debug",PLAYBACK_ID:"playback-id",METADATA_URL:"metadata-url",PREFER_PLAYBACK:"prefer-playback",METADATA_VIDEO_ID:"metadata-video-id",METADATA_VIDEO_TITLE:"metadata-video-title",METADATA_VIEWER_USER_ID:"metadata-viewer-user-id",BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",DISABLE_COOKIES:"disable-cookies",TYPE:"type",STREAM_TYPE:"stream-type",START_TIME:"start-time"},$=Object.values(r),J=v(),Q="mux-audio",A=class extends D{constructor(){super();this.__metadata={};this.__playerInitTime=(0,n.generatePlayerInitTime)()}static get observedAttributes(){var e;return[...$,...(e=D.observedAttributes)!=null?e:[]]}get playerInitTime(){return this.__playerInitTime}get playerSoftwareName(){return Q}get playerSoftwareVersion(){return J}get _hls(){var e;return(e=this.__core)==null?void 0:e.engine}get mux(){return this.nativeEl.mux}get src(){return this.getAttribute("src")}set src(e){e!==this.src&&(e==null?this.removeAttribute("src"):this.setAttribute("src",e))}get preload(){let e=this.getAttribute("preload");return e===""?"auto":["none","metadata","auto"].includes(e)?e:super.preload}set preload(e){e!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(e)?this.setAttribute("preload",e):this.removeAttribute("preload"))}get debug(){return this.getAttribute(r.DEBUG)!=null}set debug(e){e!==this.debug&&(e?this.setAttribute(r.DEBUG,""):this.removeAttribute(r.DEBUG))}get disableCookies(){return this.hasAttribute(r.DISABLE_COOKIES)}set disableCookies(e){e!==this.disableCookies&&(e?this.setAttribute(r.DISABLE_COOKIES,""):this.removeAttribute(r.DISABLE_COOKIES))}get startTime(){let e=this.getAttribute(r.START_TIME);if(e==null)return;let a=+e;return Number.isNaN(a)?void 0:a}set startTime(e){e!==this.startTime&&(e==null?this.removeAttribute(r.START_TIME):this.setAttribute(r.START_TIME,`${e}`))}get playbackId(){var e;return(e=this.getAttribute(r.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e!==this.playbackId&&(e?this.setAttribute(r.PLAYBACK_ID,e):this.removeAttribute(r.PLAYBACK_ID))}get envKey(){var e;return(e=this.getAttribute(r.ENV_KEY))!=null?e:void 0}set envKey(e){e!==this.envKey&&(e?this.setAttribute(r.ENV_KEY,e):this.removeAttribute(r.ENV_KEY))}get beaconCollectionDomain(){var e;return(e=this.getAttribute(r.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(r.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(r.BEACON_COLLECTION_DOMAIN))}get streamType(){var e;return(e=this.getAttribute(r.STREAM_TYPE))!=null?e:void 0}set streamType(e){e!==this.streamType&&(e?this.setAttribute(r.STREAM_TYPE,e):this.removeAttribute(r.STREAM_TYPE))}get preferPlayback(){let e=this.getAttribute(r.PREFER_PLAYBACK);if(e===n.PlaybackTypes.MSE||e===n.PlaybackTypes.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===n.PlaybackTypes.MSE||e===n.PlaybackTypes.NATIVE?this.setAttribute(r.PREFER_PLAYBACK,e):this.removeAttribute(r.PREFER_PLAYBACK))}get metadata(){return this.__metadata}set metadata(e){this.__metadata=e!=null?e:{},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",this.__metadata))}load(){this.__core=(0,n.initialize)(this,this.nativeEl,this.__core)}unload(){(0,n.teardown)(this.nativeEl,this.__core),this.__core=void 0}attributeChangedCallback(e,a,s){var u,l;switch(super.attributeChangedCallback(e,a,s),e){case"src":{let o=!!a,O=!!s;!o&&O?this.load():o&&!O?this.unload():o&&O&&(this.unload(),this.load());break}case"autoplay":if(s===a)break;(u=this.__core)==null||u.setAutoplay(this.autoplay);break;case"preload":if(s===a)break;(l=this.__core)==null||l.setPreload(s);break;case r.PLAYBACK_ID:this.src=(0,n.toMuxVideoURL)(s!=null?s:void 0);break;case r.DEBUG:{let o=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=o);break}case r.METADATA_URL:s&&fetch(s).then(o=>o.json()).then(o=>this.metadata=o).catch(o=>console.error(`Unable to load or parse metadata JSON from metadata-url ${s}!`));break;default:break}}disconnectedCallback(){this.unload()}};d.customElements.get("mux-audio")||(d.customElements.define("mux-audio",A),d.MuxAudioElement=A);var X=A;
25
25
  //# sourceMappingURL=index.cjs.js.map