@mux/mux-video 0.9.1 → 0.9.2-canary.0-8dbfb52

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,210 @@
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.9.2](https://github.com/muxinc/elements/compare/@mux/mux-video@0.9.1...@mux/mux-video@0.9.2) (2022-10-12)
7
+
8
+ ### Bug Fixes
9
+
10
+ - add default value to object-fit and object-position ([#460](https://github.com/muxinc/elements/issues/460)) ([56b4068](https://github.com/muxinc/elements/commit/56b4068ef170e03fca104561d402337c9172d03b))
11
+
12
+ ## [0.9.1](https://github.com/muxinc/elements/compare/@mux/mux-video@0.9.0...@mux/mux-video@0.9.1) (2022-10-07)
13
+
14
+ ### Bug Fixes
15
+
16
+ - also add media-object-fit/position to video ([#455](https://github.com/muxinc/elements/issues/455)) ([2ffa983](https://github.com/muxinc/elements/commit/2ffa9832153e26a2fc5f52c60317dffc7f174152))
17
+
18
+ # [0.9.0](https://github.com/muxinc/elements/compare/@mux/mux-video@0.8.6...@mux/mux-video@0.9.0) (2022-10-05)
19
+
20
+ ### Bug Fixes
21
+
22
+ - preload bugs, add more tests ([bcfc23d](https://github.com/muxinc/elements/commit/bcfc23d0415d6bc5ffd1f65a8704f1ae40d251b9))
23
+ - preload for mux-audio, add tests ([e795fe0](https://github.com/muxinc/elements/commit/e795fe047af1feac832786aa03d8f419e57881b5))
24
+ - preload playback core change ([15313ea](https://github.com/muxinc/elements/commit/15313eaad81f748b5853a0fdaabfe141963f885e))
25
+ - subsequent preload changes ([bd49465](https://github.com/muxinc/elements/commit/bd494653192c205eed043292427946848e1824f5))
26
+
27
+ ### Features
28
+
29
+ - add `prefer-playback` attribute ([#402](https://github.com/muxinc/elements/issues/402)) ([8da36d6](https://github.com/muxinc/elements/commit/8da36d6b597ddbc4ae006873fee13a971b7ec2f3))
30
+ - remove deprecated .hls and .video props ([#408](https://github.com/muxinc/elements/issues/408)) ([2bd4861](https://github.com/muxinc/elements/commit/2bd48618d1b59d054e470ce9011c5c2f4904f8b6))
31
+
32
+ ### BREAKING CHANGES
33
+
34
+ - remove deprecated .hls and .video props.
35
+
36
+ ## [0.8.6](https://github.com/muxinc/elements/compare/@mux/mux-video@0.8.5...@mux/mux-video@0.8.6) (2022-09-16)
37
+
38
+ ### Bug Fixes
39
+
40
+ - mux-video & mux-audio memory leak ([#387](https://github.com/muxinc/elements/issues/387)) ([4a0d921](https://github.com/muxinc/elements/commit/4a0d921c49a3bf730ad86a77e46a085c44ef91ea))
41
+ - update PlaybackEngine types ([1873781](https://github.com/muxinc/elements/commit/187378165a83e70d62bd5ba954b4986d0ae50738))
42
+
43
+ ## [0.8.5](https://github.com/muxinc/elements/compare/@mux/mux-video@0.8.4...@mux/mux-video@0.8.5) (2022-08-31)
44
+
45
+ ### Bug Fixes
46
+
47
+ - polyfills mutating global ([#355](https://github.com/muxinc/elements/issues/355)) ([71d18a4](https://github.com/muxinc/elements/commit/71d18a427f0171bb214a0df7c1425d3d1bddc47a))
48
+
49
+ ## [0.8.4](https://github.com/muxinc/elements/compare/@mux/mux-video@0.8.3...@mux/mux-video@0.8.4) (2022-08-03)
50
+
51
+ **Note:** Version bump only for package @mux/mux-video
52
+
53
+ ## [0.8.3](https://github.com/muxinc/elements/compare/@mux/mux-video@0.8.2...@mux/mux-video@0.8.3) (2022-08-02)
54
+
55
+ ### Bug Fixes
56
+
57
+ - 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)
58
+
59
+ ## [0.8.2](https://github.com/muxinc/elements/compare/@mux/mux-video@0.8.1...@mux/mux-video@0.8.2) (2022-07-21)
60
+
61
+ **Note:** Version bump only for package @mux/mux-video
62
+
63
+ ## [0.8.1](https://github.com/muxinc/elements/compare/@mux/mux-video@0.8.0...@mux/mux-video@0.8.1) (2022-07-05)
64
+
65
+ **Note:** Version bump only for package @mux/mux-video
66
+
67
+ # 0.8.0 (2022-07-05)
68
+
69
+ ### Bug Fixes
70
+
71
+ - 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))
72
+ - clear some state on playbackId change ([#174](https://github.com/muxinc/elements/issues/174)) ([af0738e](https://github.com/muxinc/elements/commit/af0738ea5ae5a75861f75fc2ae3809ada735f3e2))
73
+ - custom video events handling ([#203](https://github.com/muxinc/elements/issues/203)) ([a909f89](https://github.com/muxinc/elements/commit/a909f89a69ee0d4b67e9d9371ac0f80984016181))
74
+ - error message was not passed back to player ([ade8143](https://github.com/muxinc/elements/commit/ade81438834610a7bddfa158ff20ec671ccd508f))
75
+ - 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))
76
+ - importing castable-video ([44cbb2f](https://github.com/muxinc/elements/commit/44cbb2f26290952ac8d3fe51a1d933352b0b9134))
77
+ - keep .hls but have it log a warning saying to use .\_hls ([11e6c10](https://github.com/muxinc/elements/commit/11e6c102a7e238bc8104c52ae9b94e7e3c2c7e19))
78
+ - make mux-player size based on video element ([#185](https://github.com/muxinc/elements/issues/185)) ([e4af9a8](https://github.com/muxinc/elements/commit/e4af9a885720f172837eb20ea49dc96bf66a77be))
79
+ - **mux-video:** initial muted autoplay attribute should autoplay muted ([#148](https://github.com/muxinc/elements/issues/148)) ([0757127](https://github.com/muxinc/elements/commit/0757127bc3095b43d3b265e46b5eb8123a7e1bb5))
80
+ - **mux-video:** prevent forward custom attrs ([#172](https://github.com/muxinc/elements/issues/172)) ([91a7812](https://github.com/muxinc/elements/commit/91a7812dff7163396440d8d1af26f94d04d3fea3))
81
+ - **mux-video:** use generateInitTime() instead of Date.now. ([3ac1722](https://github.com/muxinc/elements/commit/3ac1722dc2140b1970323d96fa908e384682f93e))
82
+ - 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))
83
+ - prettier format all elements files ([741d607](https://github.com/muxinc/elements/commit/741d607521ca9578cfad9f0a9216a6565b4c56a1))
84
+ - switch cjs extension to .cjs.js ([30e83c3](https://github.com/muxinc/elements/commit/30e83c3ce0bd9bfda4817c30ffe0921e425619e4))
85
+ - update condition for when we should use hls vs native playback. ([b5ada22](https://github.com/muxinc/elements/commit/b5ada22c35be0757442706f9b19b7f53333e8359))
86
+
87
+ ### Features
88
+
89
+ - (interim solution) use local version of CustomVideoElement with updated styles so mux-video will better correspond to video size/position/layout behavior. Add example html for smoke testing. ([5705ebf](https://github.com/muxinc/elements/commit/5705ebf18d9faf9684d2950a2fd3e3476d641c8c))
90
+ - add beaconCollectionDomain option to replace beaconDomain ([a44b699](https://github.com/muxinc/elements/commit/a44b699ae3138590b9d953f693f95971694658df))
91
+ - Add built-in player_version support (fixes [#8](https://github.com/muxinc/elements/issues/8)) ([f623a88](https://github.com/muxinc/elements/commit/f623a882df7cc2464a3243b44e7b666c387425e7))
92
+ - add casting logic without cast-button ([#237](https://github.com/muxinc/elements/issues/237)) ([f7f1fe9](https://github.com/muxinc/elements/commit/f7f1fe9713f8c2dcedb2840f463b5478d6fffca0))
93
+ - add errorTranslator prop & muxVideo.error property ([#195](https://github.com/muxinc/elements/issues/195)) ([3afc2f0](https://github.com/muxinc/elements/commit/3afc2f0af75a5ad8ef00257a4ebc34882ff8c9ab))
94
+ - Add high priority metadata attribute support. Add playback id as video id defaulting. (fixes [#6](https://github.com/muxinc/elements/issues/6)) ([8dbbcbb](https://github.com/muxinc/elements/commit/8dbbcbbc4740bbefb1c733b857f9a2b2992fd1b7))
95
+ - 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)
96
+ - Add prefer-native support to use native video playback of hls if available. (fixes [#5](https://github.com/muxinc/elements/issues/5)). ([3578195](https://github.com/muxinc/elements/commit/3578195857e314d6691aebd19cf9d54063e03019))
97
+ - add support for mux-data beaconDomain. Add support for stream-type and stream-type-specific hls config. ([d99c069](https://github.com/muxinc/elements/commit/d99c06968c25a65bf406fda138e89925a30f229d))
98
+ - Add support for playback_id with query params (fixes [#7](https://github.com/muxinc/elements/issues/7)). ([6b44897](https://github.com/muxinc/elements/commit/6b44897f743551c0760d1c80d52b756b507dc00e))
99
+ - Extended autoplay options ([#116](https://github.com/muxinc/elements/issues/116)) ([475e838](https://github.com/muxinc/elements/commit/475e83884f641c578fa601c9501147d485fc1831))
100
+ - handle 'big boy' cases as well. ([7e2d671](https://github.com/muxinc/elements/commit/7e2d67182ce669ada008222a4016f11e771293a2))
101
+ - make sure mux data is monitoring as early as possible. ([d821ec5](https://github.com/muxinc/elements/commit/d821ec5e49130cf87811b3d6f56d05730330bd4f))
102
+ - **mux-video-init:** 'bake in' hls error recovery. Only auto-load if we have a src. ([a16cd11](https://github.com/muxinc/elements/commit/a16cd112b8a7dafeaf317bff47cf2ef0db1ff067))
103
+ - **mux-video-init:** (temporarily) adding polyfill to mux-video to allow server side smoke testing. ([36eefc8](https://github.com/muxinc/elements/commit/36eefc8962f8e0317fe11deb79aad017de0640a3))
104
+ - **mux-video-init:** Add basic snowpack build (currenty based on media-chrome but will change) plus example. ([467a604](https://github.com/muxinc/elements/commit/467a6042ce4eee327628301235f15c1f6dd41829))
105
+ - **mux-video-init:** add controls to simplify using example ([923a561](https://github.com/muxinc/elements/commit/923a561ee9f52f9a1c53313ecee70044315717f6))
106
+ - **mux-video-init:** Add support initial support for debug, mux data metadata. Update typedefs. Update example. ([7845462](https://github.com/muxinc/elements/commit/7845462eeb1a2553a9bd3ffc728305d45e747201))
107
+ - **mux-video-init:** Adding basic integration of mux-embed (untested). ([2d86620](https://github.com/muxinc/elements/commit/2d86620344c234be7f518e3f0f33ce7f19bfef14))
108
+ - **mux-video-init:** Adding Hls as export of mux-video root module. Adding stub for env-key to use mux data/mux-embed. ([fecde00](https://github.com/muxinc/elements/commit/fecde0055da0d177e3927f12d4d487ca0884c7e5))
109
+ - **mux-video-init:** Adding support for playback id. Clean up example. ([a48f4c6](https://github.com/muxinc/elements/commit/a48f4c64bc8984c8a9b007663c859ca968bdd09b))
110
+ - **mux-video-init:** Beef up typings for mux-embed. ([3b86e54](https://github.com/muxinc/elements/commit/3b86e5433b6f06c5d9d95623d4e9623bdf95835c))
111
+ - **mux-video-init:** example of loading metadata from a URL ([7c47434](https://github.com/muxinc/elements/commit/7c47434c42a31365a9b219a2c00d9203a85c1258))
112
+ - **mux-video-init:** handle various src attr changes. Add unload. ([bdf0559](https://github.com/muxinc/elements/commit/bdf05592488600c3a8b65354a11be4436d2cf045))
113
+ - **mux-video-init:** Initial implementation of mux-video. Start scaffolding out components, types, and build infrastructure. ([b6d7f35](https://github.com/muxinc/elements/commit/b6d7f35fad1b926f644212df6d01522b0ba4a814))
114
+ - **mux-video:** Add basic support for custom video domains. ([82cfb15](https://github.com/muxinc/elements/commit/82cfb15ecb9729329018c1fe999a1585bcae55c7))
115
+ - rename hls to \_hls ([2d53bc2](https://github.com/muxinc/elements/commit/2d53bc2517840d65a8fd5e2bb2d979ce8b491116))
116
+ - **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))
117
+ - **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))
118
+ - 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))
119
+
120
+ # [0.7.0](https://github.com/muxinc/elements/compare/@mux-elements/mux-video@0.6.1...@mux-elements/mux-video@0.7.0) (2022-06-23)
121
+
122
+ ### Features
123
+
124
+ - **mux-video:** Add basic support for custom video domains. ([82cfb15](https://github.com/muxinc/elements/commit/82cfb15ecb9729329018c1fe999a1585bcae55c7))
125
+
126
+ ## [0.6.1](https://github.com/muxinc/elements/compare/@mux-elements/mux-video@0.6.0...@mux-elements/mux-video@0.6.1) (2022-06-07)
127
+
128
+ ### Bug Fixes
129
+
130
+ - importing castable-video ([44cbb2f](https://github.com/muxinc/elements/commit/44cbb2f26290952ac8d3fe51a1d933352b0b9134))
131
+
132
+ # [0.6.0](https://github.com/muxinc/elements/compare/@mux-elements/mux-video@0.5.4...@mux-elements/mux-video@0.6.0) (2022-06-06)
133
+
134
+ ### Features
135
+
136
+ - add casting logic without cast-button ([#237](https://github.com/muxinc/elements/issues/237)) ([f7f1fe9](https://github.com/muxinc/elements/commit/f7f1fe9713f8c2dcedb2840f463b5478d6fffca0))
137
+
138
+ ## [0.5.4](https://github.com/muxinc/elements/compare/@mux-elements/mux-video@0.5.3...@mux-elements/mux-video@0.5.4) (2022-05-26)
139
+
140
+ **Note:** Version bump only for package @mux-elements/mux-video
141
+
142
+ ## [0.5.3](https://github.com/muxinc/elements/compare/@mux-elements/mux-video@0.5.2...@mux-elements/mux-video@0.5.3) (2022-05-23)
143
+
144
+ **Note:** Version bump only for package @mux-elements/mux-video
145
+
146
+ ## [0.5.2](https://github.com/muxinc/elements/compare/@mux-elements/mux-video@0.5.1...@mux-elements/mux-video@0.5.2) (2022-05-20)
147
+
148
+ ### Bug Fixes
149
+
150
+ - switch cjs extension to .cjs.js ([30e83c3](https://github.com/muxinc/elements/commit/30e83c3ce0bd9bfda4817c30ffe0921e425619e4))
151
+
152
+ ## [0.5.1](https://github.com/muxinc/elements/compare/@mux-elements/mux-video@0.5.0...@mux-elements/mux-video@0.5.1) (2022-05-10)
153
+
154
+ ### Bug Fixes
155
+
156
+ - error message was not passed back to player ([ade8143](https://github.com/muxinc/elements/commit/ade81438834610a7bddfa158ff20ec671ccd508f))
157
+ - 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))
158
+
159
+ # [0.5.0](https://github.com/muxinc/elements/compare/@mux-elements/mux-video@0.4.5...@mux-elements/mux-video@0.5.0) (2022-05-03)
160
+
161
+ ### Bug Fixes
162
+
163
+ - custom video events handling ([#203](https://github.com/muxinc/elements/issues/203)) ([a909f89](https://github.com/muxinc/elements/commit/a909f89a69ee0d4b67e9d9371ac0f80984016181))
164
+ - keep .hls but have it log a warning saying to use .\_hls ([11e6c10](https://github.com/muxinc/elements/commit/11e6c102a7e238bc8104c52ae9b94e7e3c2c7e19))
165
+
166
+ ### Features
167
+
168
+ - add errorTranslator prop & muxVideo.error property ([#195](https://github.com/muxinc/elements/issues/195)) ([3afc2f0](https://github.com/muxinc/elements/commit/3afc2f0af75a5ad8ef00257a4ebc34882ff8c9ab))
169
+ - 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)
170
+ - rename hls to \_hls ([2d53bc2](https://github.com/muxinc/elements/commit/2d53bc2517840d65a8fd5e2bb2d979ce8b491116))
171
+
172
+ ## [0.4.5](https://github.com/muxinc/elements/compare/@mux-elements/mux-video@0.4.4...@mux-elements/mux-video@0.4.5) (2022-04-22)
173
+
174
+ ### Bug Fixes
175
+
176
+ - 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))
177
+
178
+ ## [0.4.4](https://github.com/muxinc/elements/compare/@mux-elements/mux-video@0.4.3...@mux-elements/mux-video@0.4.4) (2022-04-18)
179
+
180
+ ### Bug Fixes
181
+
182
+ - make mux-player size based on video element ([#185](https://github.com/muxinc/elements/issues/185)) ([e4af9a8](https://github.com/muxinc/elements/commit/e4af9a885720f172837eb20ea49dc96bf66a77be))
183
+
184
+ ## [0.4.3](https://github.com/muxinc/elements/compare/@mux-elements/mux-video@0.4.2...@mux-elements/mux-video@0.4.3) (2022-04-12)
185
+
186
+ ### Bug Fixes
187
+
188
+ - clear some state on playbackId change ([#174](https://github.com/muxinc/elements/issues/174)) ([af0738e](https://github.com/muxinc/elements/commit/af0738ea5ae5a75861f75fc2ae3809ada735f3e2))
189
+
190
+ ## [0.4.2](https://github.com/muxinc/elements/compare/@mux-elements/mux-video@0.4.1...@mux-elements/mux-video@0.4.2) (2022-04-08)
191
+
192
+ ### Bug Fixes
193
+
194
+ - **mux-video:** prevent forward custom attrs ([#172](https://github.com/muxinc/elements/issues/172)) ([91a7812](https://github.com/muxinc/elements/commit/91a7812dff7163396440d8d1af26f94d04d3fea3))
195
+
196
+ ## [0.4.1](https://github.com/muxinc/elements/compare/@mux-elements/mux-video@0.4.0...@mux-elements/mux-video@0.4.1) (2022-04-01)
197
+
198
+ **Note:** Version bump only for package @mux-elements/mux-video
199
+
200
+ # [0.4.0](https://github.com/muxinc/elements/compare/@mux-elements/mux-video@0.3.0...@mux-elements/mux-video@0.4.0) (2022-03-28)
201
+
202
+ ### Bug Fixes
203
+
204
+ - **mux-video:** initial muted autoplay attribute should autoplay muted ([#148](https://github.com/muxinc/elements/issues/148)) ([0757127](https://github.com/muxinc/elements/commit/0757127bc3095b43d3b265e46b5eb8123a7e1bb5))
205
+ - **mux-video:** use generateInitTime() instead of Date.now. ([3ac1722](https://github.com/muxinc/elements/commit/3ac1722dc2140b1970323d96fa908e384682f93e))
206
+ - prettier format all elements files ([741d607](https://github.com/muxinc/elements/commit/741d607521ca9578cfad9f0a9216a6565b4c56a1))
207
+
208
+ ### Features
209
+
210
+ - add beaconCollectionDomain option to replace beaconDomain ([a44b699](https://github.com/muxinc/elements/commit/a44b699ae3138590b9d953f693f95971694658df))
package/dist/cjs.json ADDED
@@ -0,0 +1,77 @@
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
+ "../../shared/castable-video/castable-video.js": {
12
+ "bytes": 21249,
13
+ "imports": []
14
+ },
15
+ "src/CustomVideoElement.js": {
16
+ "bytes": 9306,
17
+ "imports": [
18
+ {
19
+ "path": "../../shared/polyfills/index.js",
20
+ "kind": "import-statement"
21
+ },
22
+ {
23
+ "path": "../../shared/castable-video/castable-video.js",
24
+ "kind": "import-statement"
25
+ }
26
+ ]
27
+ },
28
+ "src/index.ts": {
29
+ "bytes": 13366,
30
+ "imports": [
31
+ {
32
+ "path": "../../shared/polyfills/index.js",
33
+ "kind": "import-statement"
34
+ },
35
+ {
36
+ "path": "src/env.ts",
37
+ "kind": "import-statement"
38
+ },
39
+ {
40
+ "path": "src/CustomVideoElement.js",
41
+ "kind": "import-statement"
42
+ }
43
+ ]
44
+ }
45
+ },
46
+ "outputs": {
47
+ "dist/index.cjs.js.map": {
48
+ "imports": [],
49
+ "exports": [],
50
+ "inputs": {},
51
+ "bytes": 72085
52
+ },
53
+ "dist/index.cjs.js": {
54
+ "imports": [],
55
+ "exports": [],
56
+ "entryPoint": "src/index.ts",
57
+ "inputs": {
58
+ "src/index.ts": {
59
+ "bytesInOutput": 5671
60
+ },
61
+ "../../shared/polyfills/index.js": {
62
+ "bytesInOutput": 749
63
+ },
64
+ "src/env.ts": {
65
+ "bytesInOutput": 72
66
+ },
67
+ "../../shared/castable-video/castable-video.js": {
68
+ "bytesInOutput": 10880
69
+ },
70
+ "src/CustomVideoElement.js": {
71
+ "bytesInOutput": 3291
72
+ }
73
+ },
74
+ "bytes": 21673
75
+ }
76
+ }
77
+ }
package/dist/esm.json ADDED
@@ -0,0 +1,82 @@
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
+ "../../shared/castable-video/castable-video.js": {
12
+ "bytes": 21249,
13
+ "imports": []
14
+ },
15
+ "src/CustomVideoElement.js": {
16
+ "bytes": 9306,
17
+ "imports": [
18
+ {
19
+ "path": "../../shared/polyfills/index.js",
20
+ "kind": "import-statement"
21
+ },
22
+ {
23
+ "path": "../../shared/castable-video/castable-video.js",
24
+ "kind": "import-statement"
25
+ }
26
+ ]
27
+ },
28
+ "src/index.ts": {
29
+ "bytes": 13366,
30
+ "imports": [
31
+ {
32
+ "path": "../../shared/polyfills/index.js",
33
+ "kind": "import-statement"
34
+ },
35
+ {
36
+ "path": "src/env.ts",
37
+ "kind": "import-statement"
38
+ },
39
+ {
40
+ "path": "src/CustomVideoElement.js",
41
+ "kind": "import-statement"
42
+ }
43
+ ]
44
+ }
45
+ },
46
+ "outputs": {
47
+ "dist/index.mjs.map": {
48
+ "imports": [],
49
+ "exports": [],
50
+ "inputs": {},
51
+ "bytes": 72189
52
+ },
53
+ "dist/index.mjs": {
54
+ "imports": [],
55
+ "exports": [
56
+ "Attributes",
57
+ "MediaError",
58
+ "VideoEvents",
59
+ "default"
60
+ ],
61
+ "entryPoint": "src/index.ts",
62
+ "inputs": {
63
+ "../../shared/polyfills/index.js": {
64
+ "bytesInOutput": 749
65
+ },
66
+ "src/index.ts": {
67
+ "bytesInOutput": 5547
68
+ },
69
+ "src/env.ts": {
70
+ "bytesInOutput": 72
71
+ },
72
+ "../../shared/castable-video/castable-video.js": {
73
+ "bytesInOutput": 10876
74
+ },
75
+ "src/CustomVideoElement.js": {
76
+ "bytesInOutput": 3291
77
+ }
78
+ },
79
+ "bytes": 21205
80
+ }
81
+ }
82
+ }
package/dist/iife.json ADDED
@@ -0,0 +1,119 @@
1
+ {
2
+ "inputs": {
3
+ "../../shared/polyfills/index.js": {
4
+ "bytes": 1440,
5
+ "imports": []
6
+ },
7
+ "../../node_modules/mux-embed/dist/mux.js": {
8
+ "bytes": 105451,
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": 9635,
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
+ "../../shared/castable-video/castable-video.js": {
41
+ "bytes": 21249,
42
+ "imports": []
43
+ },
44
+ "src/CustomVideoElement.js": {
45
+ "bytes": 9306,
46
+ "imports": [
47
+ {
48
+ "path": "../../shared/polyfills/index.js",
49
+ "kind": "import-statement"
50
+ },
51
+ {
52
+ "path": "../../shared/castable-video/castable-video.js",
53
+ "kind": "import-statement"
54
+ }
55
+ ]
56
+ },
57
+ "src/index.ts": {
58
+ "bytes": 13366,
59
+ "imports": [
60
+ {
61
+ "path": "../../shared/polyfills/index.js",
62
+ "kind": "import-statement"
63
+ },
64
+ {
65
+ "path": "../playback-core/dist/index.mjs",
66
+ "kind": "import-statement"
67
+ },
68
+ {
69
+ "path": "src/env.ts",
70
+ "kind": "import-statement"
71
+ },
72
+ {
73
+ "path": "src/CustomVideoElement.js",
74
+ "kind": "import-statement"
75
+ }
76
+ ]
77
+ }
78
+ },
79
+ "outputs": {
80
+ "dist/mux-video.js.map": {
81
+ "imports": [],
82
+ "exports": [],
83
+ "inputs": {},
84
+ "bytes": 1820084
85
+ },
86
+ "dist/mux-video.js": {
87
+ "imports": [],
88
+ "exports": [],
89
+ "entryPoint": "src/index.ts",
90
+ "inputs": {
91
+ "../../node_modules/mux-embed/dist/mux.js": {
92
+ "bytesInOutput": 105617
93
+ },
94
+ "../../node_modules/hls.js/dist/hls.js": {
95
+ "bytesInOutput": 374054
96
+ },
97
+ "../../shared/polyfills/index.js": {
98
+ "bytesInOutput": 767
99
+ },
100
+ "../playback-core/dist/index.mjs": {
101
+ "bytesInOutput": 9271
102
+ },
103
+ "src/env.ts": {
104
+ "bytesInOutput": 72
105
+ },
106
+ "../../shared/castable-video/castable-video.js": {
107
+ "bytesInOutput": 11041
108
+ },
109
+ "src/CustomVideoElement.js": {
110
+ "bytesInOutput": 3329
111
+ },
112
+ "src/index.ts": {
113
+ "bytesInOutput": 5422
114
+ }
115
+ },
116
+ "bytes": 510711
117
+ }
118
+ }
119
+ }
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var re=Object.defineProperty;var Ve=Object.getOwnPropertyDescriptor;var He=Object.getOwnPropertyNames;var je=Object.prototype.hasOwnProperty;var Ke=(r,t,e)=>t in r?re(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var qe=(r,t)=>{for(var e in t)re(r,e,{get:t[e],enumerable:!0})},We=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of He(t))!je.call(r,n)&&n!==e&&re(r,n,{get:()=>t[n],enumerable:!(o=Ve(t,n))||o.enumerable});return r};var $e=r=>We(re({},"__esModule",{value:!0}),r);var j=(r,t,e)=>(Ke(r,typeof t!="symbol"?t+"":t,e),e),le=(r,t,e)=>{if(!t.has(r))throw TypeError("Cannot "+e)};var a=(r,t,e)=>(le(r,t,"read from private field"),e?e.call(r):t.get(r)),u=(r,t,e)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,e)},f=(r,t,e,o)=>(le(r,t,"write to private field"),o?o.call(r,e):t.set(r,e),e);var m=(r,t,e)=>(le(r,t,"access private method"),e);var nt={};qe(nt,{Attributes:()=>c,MediaError:()=>p.MediaError,VideoEvents:()=>ge,default:()=>it});module.exports=$e(nt);var U=class{addEventListener(){}removeEventListener(){}dispatchEvent(t){return!0}};if(typeof DocumentFragment=="undefined"){class r extends U{}globalThis.DocumentFragment=r}var K=class extends U{},de=class extends U{},ze={get(r){},define(r,t,e){},upgrade(r){},whenDefined(r){return Promise.resolve(K)}},q,he=class{constructor(t,e={}){u(this,q,void 0);f(this,q,e==null?void 0:e.detail)}get detail(){return a(this,q)}initCustomEvent(){}};q=new WeakMap;function Je(r,t){return new K}var ke={document:{createElement:Je},DocumentFragment,customElements:ze,CustomEvent:he,EventTarget:U,HTMLElement:K,HTMLVideoElement:de},De=typeof window=="undefined"||typeof globalThis.customElements=="undefined",S=De?ke:globalThis,me=De?ke.document:globalThis.document;var p=require("@mux/playback-core");var Xe=()=>{try{return"0.9.1"}catch{}return"UNKNOWN"},Ze=Xe(),Le=()=>Ze;var Qe=r=>{var t,e,o,n,E,Re,h,ae,b,C,N,ie,x,ne,X,we,Z,Ne,B,fe,F,g,M,I,O,k,L,W,Q,xe,G,Ee,ee,Ue,V,pe,te,Ye,H,ye;return t=class extends r{constructor(){super();u(this,L);u(this,Q);u(this,G);u(this,ee);u(this,V);u(this,te);u(this,H);j(this,"castEnabled",!1);u(this,F,{paused:!1});u(this,g,void 0);u(this,M,{});u(this,I,void 0);u(this,O,void 0);u(this,k,void 0);t.instances.add(this),m(this,V,pe).call(this)}static get castElement(){return a(t,e)}static get castEnabled(){return a(t,o)}static get castState(){var s;return(s=a(t,b,C))==null?void 0:s.getCastState()}static async exitCast(){try{await a(t,b,C).endCurrentSession(!0)}catch(i){console.error(i);return}}get castPlayer(){if(t.castElement===this)return a(this,g)}attributeChangedCallback(s){if(!!this.castPlayer)switch(s){case"cast-stream-type":case"cast-src":this.load();break}}async requestCast(s={}){var i;m(i=t,B,fe).call(i,s),f(t,e,this),Object.entries(a(this,M)).forEach(([l,y])=>{a(this,g).controller.addEventListener(l,y)});try{await a(t,b,C).requestSession()}catch{f(t,e,void 0);return}a(this,F).paused=super.paused,super.pause(),this.muted=super.muted;try{await this.load()}catch(l){console.error(l)}}async load(){var _,R;if(!this.castPlayer)return super.load();let s=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType),i=[...this.querySelectorAll("track")].filter(({kind:P,src:A})=>A&&(P==="subtitles"||P==="captions")),l=[],y=0;i.length&&(s.tracks=i.map(P=>{let A=++y;l.length===0&&P.track.mode==="showing"&&l.push(A);let w=new chrome.cast.media.Track(A,chrome.cast.media.TrackType.TEXT);return w.trackContentId=P.src,w.trackContentType="text/vtt",w.subtype=P.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,w.name=P.label,w.language=P.srclang,w})),this.castStreamType==="live"?s.streamType=chrome.cast.media.StreamType.LIVE:s.streamType=chrome.cast.media.StreamType.BUFFERED,s.metadata=new chrome.cast.media.GenericMediaMetadata,s.metadata.title=this.title,s.metadata.images=[{url:this.poster}];let T=new chrome.cast.media.LoadRequest(s);T.currentTime=(_=super.currentTime)!=null?_:0,T.autoplay=!a(this,F).paused,T.activeTrackIds=l,await((R=a(t,N,ie))==null?void 0:R.loadMedia(T)),this.dispatchEvent(new Event("volumechange"))}play(){var s;if(this.castPlayer){this.castPlayer.isPaused&&((s=this.castPlayer.controller)==null||s.playOrPause());return}return super.play()}pause(){var s;if(this.castPlayer){this.castPlayer.isPaused||(s=this.castPlayer.controller)==null||s.playOrPause();return}super.pause()}get castSrc(){var s,i,l;return(l=(i=this.getAttribute("cast-src"))!=null?i:(s=this.querySelector("source"))==null?void 0:s.src)!=null?l:this.currentSrc}set castSrc(s){this.castSrc!=s&&this.setAttribute("cast-src",`${s}`)}get castContentType(){var s;return(s=this.getAttribute("cast-content-type"))!=null?s:void 0}set castContentType(s){this.setAttribute("cast-content-type",`${s}`)}get castStreamType(){var s;return(s=this.getAttribute("cast-stream-type"))!=null?s:void 0}set castStreamType(s){this.setAttribute("cast-stream-type",`${s}`)}get readyState(){if(this.castPlayer)switch(this.castPlayer.playerState){case chrome.cast.media.PlayerState.IDLE:return 0;case chrome.cast.media.PlayerState.BUFFERING:return 2;default:return 3}return super.readyState}get paused(){return this.castPlayer?this.castPlayer.isPaused:super.paused}get muted(){var s;return this.castPlayer?(s=this.castPlayer)==null?void 0:s.isMuted:super.muted}set muted(s){var i;if(this.castPlayer){(s&&!this.castPlayer.isMuted||!s&&this.castPlayer.isMuted)&&((i=this.castPlayer.controller)==null||i.muteOrUnmute());return}super.muted=s}get volume(){var s,i;return this.castPlayer?(i=(s=this.castPlayer)==null?void 0:s.volumeLevel)!=null?i:1:super.volume}set volume(s){var i;if(this.castPlayer){this.castPlayer.volumeLevel=s,(i=this.castPlayer.controller)==null||i.setVolumeLevel();return}super.volume=s}get duration(){var s,i;return this.castPlayer&&a(this,L,W)?(i=(s=this.castPlayer)==null?void 0:s.duration)!=null?i:NaN:super.duration}get currentTime(){var s,i;return this.castPlayer&&a(this,L,W)?(i=(s=this.castPlayer)==null?void 0:s.currentTime)!=null?i:0:super.currentTime}set currentTime(s){var i;if(this.castPlayer){this.castPlayer.currentTime=s,(i=this.castPlayer.controller)==null||i.seek();return}super.currentTime=s}get onentercast(){return a(this,I)}set onentercast(s){a(this,I)&&(this.removeEventListener("entercast",a(this,I)),f(this,I,null)),typeof s=="function"&&(f(this,I,s),this.addEventListener("entercast",s))}get onleavecast(){return a(this,O)}set onleavecast(s){a(this,O)&&(this.removeEventListener("leavecast",a(this,O)),f(this,O,null)),typeof s=="function"&&(f(this,O,s),this.addEventListener("leavecast",s))}get oncastchange(){return a(this,k)}set oncastchange(s){a(this,k)&&(this.removeEventListener("castchange",a(this,k)),f(this,k,null)),typeof s=="function"&&(f(this,k,s),this.addEventListener("castchange",s))}},e=new WeakMap,o=new WeakMap,n=new WeakMap,E=new WeakSet,Re=function(){return typeof chrome!="undefined"&&chrome.cast&&chrome.cast.isAvailable},h=new WeakSet,ae=function(){return typeof cast!="undefined"&&cast.framework},b=new WeakSet,C=function(){if(a(t,h,ae))return cast.framework.CastContext.getInstance()},N=new WeakSet,ie=function(){var s;return(s=a(t,b,C))==null?void 0:s.getCurrentSession()},x=new WeakSet,ne=function(){var s;return(s=a(t,N,ie))==null?void 0:s.getSessionObj().media[0]},X=new WeakSet,we=function(s){return new Promise((i,l)=>{a(t,x,ne).editTracksInfo(s,i,l)})},Z=new WeakSet,Ne=function(s){return new Promise((i,l)=>{a(t,x,ne).getStatus(s,i,l)})},B=new WeakSet,fe=function(s){return a(t,b,C).setOptions({receiverApplicationId:chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0,...s})},F=new WeakMap,g=new WeakMap,M=new WeakMap,I=new WeakMap,O=new WeakMap,k=new WeakMap,L=new WeakSet,W=function(){var s;return(s=this.castPlayer)==null?void 0:s.isMediaLoaded},Q=new WeakSet,xe=function(){a(t,e)===this&&(Object.entries(a(this,M)).forEach(([s,i])=>{a(this,g).controller.removeEventListener(s,i)}),f(t,e,void 0),this.muted=a(this,g).isMuted,this.currentTime=a(this,g).savedPlayerState.currentTime,a(this,g).savedPlayerState.isPaused===!1&&this.play())},G=new WeakSet,Ee=function(){this.dispatchEvent(new CustomEvent("castchange",{detail:a(t,b,C).getCastState()}))},ee=new WeakSet,Ue=async function(){var i,l;let{SESSION_RESUMED:s}=cast.framework.SessionState;if(a(t,b,C).getSessionState()===s&&this.castSrc===((i=a(t,x,ne))==null?void 0:i.media.contentId)){f(t,e,this),Object.entries(a(this,M)).forEach(([y,T])=>{a(this,g).controller.addEventListener(y,T)});try{await m(l=t,Z,Ne).call(l,new chrome.cast.media.GetStatusRequest)}catch(y){console.error(y)}a(this,M)[cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED](),a(this,M)[cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},V=new WeakSet,pe=function(){var s;!a(t,h,ae)||this.castEnabled||(this.castEnabled=!0,m(s=t,B,fe).call(s),this.textTracks.addEventListener("change",m(this,H,ye).bind(this)),m(this,G,Ee).call(this),f(this,g,new cast.framework.RemotePlayer),new cast.framework.RemotePlayerController(a(this,g)),f(this,M,{[cast.framework.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:i})=>{i===!1&&m(this,Q,xe).call(this),this.dispatchEvent(new Event(i?"entercast":"leavecast"))},[cast.framework.RemotePlayerEventType.DURATION_CHANGED]:()=>{this.dispatchEvent(new Event("durationchange"))},[cast.framework.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{this.dispatchEvent(new Event("volumechange"))},[cast.framework.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{this.dispatchEvent(new Event("volumechange"))},[cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{!a(this,L,W)||this.dispatchEvent(new Event("timeupdate"))},[cast.framework.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{this.dispatchEvent(new Event("resize"))},[cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{this.dispatchEvent(new Event(this.paused?"pause":"play"))},[cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var i,l;((i=this.castPlayer)==null?void 0:i.playerState)!==chrome.cast.media.PlayerState.PAUSED&&this.dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(l=this.castPlayer)==null?void 0:l.playerState]))},[cast.framework.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{!a(this,L,W)||(await Promise.resolve(),m(this,te,Ye).call(this))}}))},te=new WeakSet,Ye=function(){m(this,H,ye).call(this)},H=new WeakSet,ye=async function(){var be,Pe,ve,_e,Se,Ce;if(!this.castPlayer)return;let i=((Pe=(be=a(this,g).mediaInfo)==null?void 0:be.tracks)!=null?Pe:[]).filter(({type:d})=>d===chrome.cast.media.TrackType.TEXT),l=[...this.textTracks].filter(({kind:d})=>d==="subtitles"||d==="captions"),y=i.map(({language:d,name:se,trackId:ue})=>{var Ie;let{mode:Me}=(Ie=l.find(Oe=>Oe.language===d&&Oe.label===se))!=null?Ie:{};return Me?{mode:Me,trackId:ue}:!1}).filter(Boolean),_=y.filter(({mode:d})=>d!=="showing").map(({trackId:d})=>d),R=y.find(({mode:d})=>d==="showing"),P=(Se=(_e=(ve=a(t,N,ie))==null?void 0:ve.getSessionObj().media[0])==null?void 0:_e.activeTrackIds)!=null?Se:[],A=P;if(P.length&&(A=A.filter(d=>!_.includes(d))),R!=null&&R.trackId&&(A=[...A,R.trackId]),A=[...new Set(A)],!((d,se)=>d.length===se.length&&d.every(ue=>se.includes(ue)))(P,A))try{let d=new chrome.cast.media.EditTracksInfoRequest(A);await m(Ce=t,X,we).call(Ce,d)}catch(d){console.error(d)}},u(t,E),u(t,h),u(t,b),u(t,N),u(t,x),u(t,X),u(t,Z),u(t,B),j(t,"observedAttributes",["cast-src","cast-content-type","cast-stream-type"]),j(t,"instances",new Set),u(t,e,void 0),u(t,o,!1),j(t,"initCast",()=>{var s;a(t,E,Re)?a(t,h,ae)?a(s=t,n).call(s,chrome.cast.isAvailable):customElements.whenDefined("google-cast-button").then(()=>{var i;return a(i=t,n).call(i,chrome.cast.isAvailable)}):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(()=>{var i;return a(i=t,n).call(i,chrome.cast.isAvailable)})}}),u(t,n,s=>{if(s){f(t,o,!0);let{CAST_STATE_CHANGED:i}=cast.framework.CastContextEventType;a(t,b,C).addEventListener(i,y=>{t.instances.forEach(T=>{var _;return m(_=T,G,Ee).call(_,y)})});let{SESSION_STATE_CHANGED:l}=cast.framework.CastContextEventType;a(t,b,C).addEventListener(l,y=>{t.instances.forEach(T=>{var _;return m(_=T,ee,Ue).call(_,y)})}),t.instances.forEach(y=>{var T;return m(T=y,V,pe).call(T)})}}),t};if(globalThis.HTMLVideoElement&&globalThis.customElements){let r=Qe(HTMLVideoElement);globalThis.customElements.get("castable-video")||(globalThis.customElements.define("castable-video",r,{extends:"video"}),globalThis.CastableVideoElement=r),r.initCast()}var ge=["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","castchange","entercast","leavecast"],Be=me.createElement("template");Be.innerHTML=`
1
+ "use strict";var re=Object.defineProperty;var Ve=Object.getOwnPropertyDescriptor;var He=Object.getOwnPropertyNames;var je=Object.prototype.hasOwnProperty;var Ke=(r,t,e)=>t in r?re(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var qe=(r,t)=>{for(var e in t)re(r,e,{get:t[e],enumerable:!0})},We=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of He(t))!je.call(r,n)&&n!==e&&re(r,n,{get:()=>t[n],enumerable:!(o=Ve(t,n))||o.enumerable});return r};var $e=r=>We(re({},"__esModule",{value:!0}),r);var j=(r,t,e)=>(Ke(r,typeof t!="symbol"?t+"":t,e),e),le=(r,t,e)=>{if(!t.has(r))throw TypeError("Cannot "+e)};var a=(r,t,e)=>(le(r,t,"read from private field"),e?e.call(r):t.get(r)),u=(r,t,e)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,e)},f=(r,t,e,o)=>(le(r,t,"write to private field"),o?o.call(r,e):t.set(r,e),e);var m=(r,t,e)=>(le(r,t,"access private method"),e);var nt={};qe(nt,{Attributes:()=>c,MediaError:()=>p.MediaError,VideoEvents:()=>ge,default:()=>it});module.exports=$e(nt);var U=class{addEventListener(){}removeEventListener(){}dispatchEvent(t){return!0}};if(typeof DocumentFragment=="undefined"){class r extends U{}globalThis.DocumentFragment=r}var K=class extends U{},de=class extends U{},ze={get(r){},define(r,t,e){},upgrade(r){},whenDefined(r){return Promise.resolve(K)}},q,he=class{constructor(t,e={}){u(this,q,void 0);f(this,q,e==null?void 0:e.detail)}get detail(){return a(this,q)}initCustomEvent(){}};q=new WeakMap;function Je(r,t){return new K}var ke={document:{createElement:Je},DocumentFragment,customElements:ze,CustomEvent:he,EventTarget:U,HTMLElement:K,HTMLVideoElement:de},De=typeof window=="undefined"||typeof globalThis.customElements=="undefined",S=De?ke:globalThis,me=De?ke.document:globalThis.document;var p=require("@mux/playback-core");var Xe=()=>{try{return"0.9.2"}catch{}return"UNKNOWN"},Ze=Xe(),Le=()=>Ze;var Qe=r=>{var t,e,o,n,E,Re,h,ae,b,C,N,ie,x,ne,X,we,Z,Ne,B,fe,F,g,M,I,O,k,L,W,Q,xe,G,Ee,ee,Ue,V,pe,te,Ye,H,ye;return t=class extends r{constructor(){super();u(this,L);u(this,Q);u(this,G);u(this,ee);u(this,V);u(this,te);u(this,H);j(this,"castEnabled",!1);u(this,F,{paused:!1});u(this,g,void 0);u(this,M,{});u(this,I,void 0);u(this,O,void 0);u(this,k,void 0);t.instances.add(this),m(this,V,pe).call(this)}static get castElement(){return a(t,e)}static get castEnabled(){return a(t,o)}static get castState(){var s;return(s=a(t,b,C))==null?void 0:s.getCastState()}static async exitCast(){try{await a(t,b,C).endCurrentSession(!0)}catch(i){console.error(i);return}}get castPlayer(){if(t.castElement===this)return a(this,g)}attributeChangedCallback(s){if(!!this.castPlayer)switch(s){case"cast-stream-type":case"cast-src":this.load();break}}async requestCast(s={}){var i;m(i=t,B,fe).call(i,s),f(t,e,this),Object.entries(a(this,M)).forEach(([l,y])=>{a(this,g).controller.addEventListener(l,y)});try{await a(t,b,C).requestSession()}catch{f(t,e,void 0);return}a(this,F).paused=super.paused,super.pause(),this.muted=super.muted;try{await this.load()}catch(l){console.error(l)}}async load(){var _,R;if(!this.castPlayer)return super.load();let s=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType),i=[...this.querySelectorAll("track")].filter(({kind:P,src:A})=>A&&(P==="subtitles"||P==="captions")),l=[],y=0;i.length&&(s.tracks=i.map(P=>{let A=++y;l.length===0&&P.track.mode==="showing"&&l.push(A);let w=new chrome.cast.media.Track(A,chrome.cast.media.TrackType.TEXT);return w.trackContentId=P.src,w.trackContentType="text/vtt",w.subtype=P.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,w.name=P.label,w.language=P.srclang,w})),this.castStreamType==="live"?s.streamType=chrome.cast.media.StreamType.LIVE:s.streamType=chrome.cast.media.StreamType.BUFFERED,s.metadata=new chrome.cast.media.GenericMediaMetadata,s.metadata.title=this.title,s.metadata.images=[{url:this.poster}];let T=new chrome.cast.media.LoadRequest(s);T.currentTime=(_=super.currentTime)!=null?_:0,T.autoplay=!a(this,F).paused,T.activeTrackIds=l,await((R=a(t,N,ie))==null?void 0:R.loadMedia(T)),this.dispatchEvent(new Event("volumechange"))}play(){var s;if(this.castPlayer){this.castPlayer.isPaused&&((s=this.castPlayer.controller)==null||s.playOrPause());return}return super.play()}pause(){var s;if(this.castPlayer){this.castPlayer.isPaused||(s=this.castPlayer.controller)==null||s.playOrPause();return}super.pause()}get castSrc(){var s,i,l;return(l=(i=this.getAttribute("cast-src"))!=null?i:(s=this.querySelector("source"))==null?void 0:s.src)!=null?l:this.currentSrc}set castSrc(s){this.castSrc!=s&&this.setAttribute("cast-src",`${s}`)}get castContentType(){var s;return(s=this.getAttribute("cast-content-type"))!=null?s:void 0}set castContentType(s){this.setAttribute("cast-content-type",`${s}`)}get castStreamType(){var s;return(s=this.getAttribute("cast-stream-type"))!=null?s:void 0}set castStreamType(s){this.setAttribute("cast-stream-type",`${s}`)}get readyState(){if(this.castPlayer)switch(this.castPlayer.playerState){case chrome.cast.media.PlayerState.IDLE:return 0;case chrome.cast.media.PlayerState.BUFFERING:return 2;default:return 3}return super.readyState}get paused(){return this.castPlayer?this.castPlayer.isPaused:super.paused}get muted(){var s;return this.castPlayer?(s=this.castPlayer)==null?void 0:s.isMuted:super.muted}set muted(s){var i;if(this.castPlayer){(s&&!this.castPlayer.isMuted||!s&&this.castPlayer.isMuted)&&((i=this.castPlayer.controller)==null||i.muteOrUnmute());return}super.muted=s}get volume(){var s,i;return this.castPlayer?(i=(s=this.castPlayer)==null?void 0:s.volumeLevel)!=null?i:1:super.volume}set volume(s){var i;if(this.castPlayer){this.castPlayer.volumeLevel=s,(i=this.castPlayer.controller)==null||i.setVolumeLevel();return}super.volume=s}get duration(){var s,i;return this.castPlayer&&a(this,L,W)?(i=(s=this.castPlayer)==null?void 0:s.duration)!=null?i:NaN:super.duration}get currentTime(){var s,i;return this.castPlayer&&a(this,L,W)?(i=(s=this.castPlayer)==null?void 0:s.currentTime)!=null?i:0:super.currentTime}set currentTime(s){var i;if(this.castPlayer){this.castPlayer.currentTime=s,(i=this.castPlayer.controller)==null||i.seek();return}super.currentTime=s}get onentercast(){return a(this,I)}set onentercast(s){a(this,I)&&(this.removeEventListener("entercast",a(this,I)),f(this,I,null)),typeof s=="function"&&(f(this,I,s),this.addEventListener("entercast",s))}get onleavecast(){return a(this,O)}set onleavecast(s){a(this,O)&&(this.removeEventListener("leavecast",a(this,O)),f(this,O,null)),typeof s=="function"&&(f(this,O,s),this.addEventListener("leavecast",s))}get oncastchange(){return a(this,k)}set oncastchange(s){a(this,k)&&(this.removeEventListener("castchange",a(this,k)),f(this,k,null)),typeof s=="function"&&(f(this,k,s),this.addEventListener("castchange",s))}},e=new WeakMap,o=new WeakMap,n=new WeakMap,E=new WeakSet,Re=function(){return typeof chrome!="undefined"&&chrome.cast&&chrome.cast.isAvailable},h=new WeakSet,ae=function(){return typeof cast!="undefined"&&cast.framework},b=new WeakSet,C=function(){if(a(t,h,ae))return cast.framework.CastContext.getInstance()},N=new WeakSet,ie=function(){var s;return(s=a(t,b,C))==null?void 0:s.getCurrentSession()},x=new WeakSet,ne=function(){var s;return(s=a(t,N,ie))==null?void 0:s.getSessionObj().media[0]},X=new WeakSet,we=function(s){return new Promise((i,l)=>{a(t,x,ne).editTracksInfo(s,i,l)})},Z=new WeakSet,Ne=function(s){return new Promise((i,l)=>{a(t,x,ne).getStatus(s,i,l)})},B=new WeakSet,fe=function(s){return a(t,b,C).setOptions({receiverApplicationId:chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0,...s})},F=new WeakMap,g=new WeakMap,M=new WeakMap,I=new WeakMap,O=new WeakMap,k=new WeakMap,L=new WeakSet,W=function(){var s;return(s=this.castPlayer)==null?void 0:s.isMediaLoaded},Q=new WeakSet,xe=function(){a(t,e)===this&&(Object.entries(a(this,M)).forEach(([s,i])=>{a(this,g).controller.removeEventListener(s,i)}),f(t,e,void 0),this.muted=a(this,g).isMuted,this.currentTime=a(this,g).savedPlayerState.currentTime,a(this,g).savedPlayerState.isPaused===!1&&this.play())},G=new WeakSet,Ee=function(){this.dispatchEvent(new CustomEvent("castchange",{detail:a(t,b,C).getCastState()}))},ee=new WeakSet,Ue=async function(){var i,l;let{SESSION_RESUMED:s}=cast.framework.SessionState;if(a(t,b,C).getSessionState()===s&&this.castSrc===((i=a(t,x,ne))==null?void 0:i.media.contentId)){f(t,e,this),Object.entries(a(this,M)).forEach(([y,T])=>{a(this,g).controller.addEventListener(y,T)});try{await m(l=t,Z,Ne).call(l,new chrome.cast.media.GetStatusRequest)}catch(y){console.error(y)}a(this,M)[cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED](),a(this,M)[cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},V=new WeakSet,pe=function(){var s;!a(t,h,ae)||this.castEnabled||(this.castEnabled=!0,m(s=t,B,fe).call(s),this.textTracks.addEventListener("change",m(this,H,ye).bind(this)),m(this,G,Ee).call(this),f(this,g,new cast.framework.RemotePlayer),new cast.framework.RemotePlayerController(a(this,g)),f(this,M,{[cast.framework.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:i})=>{i===!1&&m(this,Q,xe).call(this),this.dispatchEvent(new Event(i?"entercast":"leavecast"))},[cast.framework.RemotePlayerEventType.DURATION_CHANGED]:()=>{this.dispatchEvent(new Event("durationchange"))},[cast.framework.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{this.dispatchEvent(new Event("volumechange"))},[cast.framework.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{this.dispatchEvent(new Event("volumechange"))},[cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{!a(this,L,W)||this.dispatchEvent(new Event("timeupdate"))},[cast.framework.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{this.dispatchEvent(new Event("resize"))},[cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{this.dispatchEvent(new Event(this.paused?"pause":"play"))},[cast.framework.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var i,l;((i=this.castPlayer)==null?void 0:i.playerState)!==chrome.cast.media.PlayerState.PAUSED&&this.dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(l=this.castPlayer)==null?void 0:l.playerState]))},[cast.framework.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{!a(this,L,W)||(await Promise.resolve(),m(this,te,Ye).call(this))}}))},te=new WeakSet,Ye=function(){m(this,H,ye).call(this)},H=new WeakSet,ye=async function(){var be,Pe,ve,_e,Se,Ce;if(!this.castPlayer)return;let i=((Pe=(be=a(this,g).mediaInfo)==null?void 0:be.tracks)!=null?Pe:[]).filter(({type:d})=>d===chrome.cast.media.TrackType.TEXT),l=[...this.textTracks].filter(({kind:d})=>d==="subtitles"||d==="captions"),y=i.map(({language:d,name:se,trackId:ue})=>{var Ie;let{mode:Me}=(Ie=l.find(Oe=>Oe.language===d&&Oe.label===se))!=null?Ie:{};return Me?{mode:Me,trackId:ue}:!1}).filter(Boolean),_=y.filter(({mode:d})=>d!=="showing").map(({trackId:d})=>d),R=y.find(({mode:d})=>d==="showing"),P=(Se=(_e=(ve=a(t,N,ie))==null?void 0:ve.getSessionObj().media[0])==null?void 0:_e.activeTrackIds)!=null?Se:[],A=P;if(P.length&&(A=A.filter(d=>!_.includes(d))),R!=null&&R.trackId&&(A=[...A,R.trackId]),A=[...new Set(A)],!((d,se)=>d.length===se.length&&d.every(ue=>se.includes(ue)))(P,A))try{let d=new chrome.cast.media.EditTracksInfoRequest(A);await m(Ce=t,X,we).call(Ce,d)}catch(d){console.error(d)}},u(t,E),u(t,h),u(t,b),u(t,N),u(t,x),u(t,X),u(t,Z),u(t,B),j(t,"observedAttributes",["cast-src","cast-content-type","cast-stream-type"]),j(t,"instances",new Set),u(t,e,void 0),u(t,o,!1),j(t,"initCast",()=>{var s;a(t,E,Re)?a(t,h,ae)?a(s=t,n).call(s,chrome.cast.isAvailable):customElements.whenDefined("google-cast-button").then(()=>{var i;return a(i=t,n).call(i,chrome.cast.isAvailable)}):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(()=>{var i;return a(i=t,n).call(i,chrome.cast.isAvailable)})}}),u(t,n,s=>{if(s){f(t,o,!0);let{CAST_STATE_CHANGED:i}=cast.framework.CastContextEventType;a(t,b,C).addEventListener(i,y=>{t.instances.forEach(T=>{var _;return m(_=T,G,Ee).call(_,y)})});let{SESSION_STATE_CHANGED:l}=cast.framework.CastContextEventType;a(t,b,C).addEventListener(l,y=>{t.instances.forEach(T=>{var _;return m(_=T,ee,Ue).call(_,y)})}),t.instances.forEach(y=>{var T;return m(T=y,V,pe).call(T)})}}),t};if(globalThis.HTMLVideoElement&&globalThis.customElements){let r=Qe(HTMLVideoElement);globalThis.customElements.get("castable-video")||(globalThis.customElements.define("castable-video",r,{extends:"video"}),globalThis.CastableVideoElement=r),r.initCast()}var ge=["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","castchange","entercast","leavecast"],Be=me.createElement("template");Be.innerHTML=`
2
2
  <style>
3
3
  :host {
4
4
  display: inline-block;
@@ -12,8 +12,8 @@
12
12
  max-height: 100%;
13
13
  min-width: 100%;
14
14
  min-height: 100%;
15
- object-fit: var(--media-object-fit);
16
- object-position: var(--media-object-position);
15
+ object-fit: var(--media-object-fit, contain);
16
+ object-position: var(--media-object-position, 50% 50%);
17
17
  }
18
18
  </style>
19
19
  <video is="castable-video" part="video" crossorigin></video>