@livepeer-frameworks/player-wc 0.1.0

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.
Files changed (141) hide show
  1. package/dist/cjs/components/fw-context-menu.js +17 -0
  2. package/dist/cjs/components/fw-context-menu.js.map +1 -0
  3. package/dist/cjs/components/fw-dev-mode-panel.js +273 -0
  4. package/dist/cjs/components/fw-dev-mode-panel.js.map +1 -0
  5. package/dist/cjs/components/fw-error-overlay.js +101 -0
  6. package/dist/cjs/components/fw-error-overlay.js.map +1 -0
  7. package/dist/cjs/components/fw-idle-screen.js +182 -0
  8. package/dist/cjs/components/fw-idle-screen.js.map +1 -0
  9. package/dist/cjs/components/fw-loading-spinner.js +62 -0
  10. package/dist/cjs/components/fw-loading-spinner.js.map +1 -0
  11. package/dist/cjs/components/fw-player-controls.js +258 -0
  12. package/dist/cjs/components/fw-player-controls.js.map +1 -0
  13. package/dist/cjs/components/fw-player.js +570 -0
  14. package/dist/cjs/components/fw-player.js.map +1 -0
  15. package/dist/cjs/components/fw-seek-bar.js +233 -0
  16. package/dist/cjs/components/fw-seek-bar.js.map +1 -0
  17. package/dist/cjs/components/fw-settings-menu.js +126 -0
  18. package/dist/cjs/components/fw-settings-menu.js.map +1 -0
  19. package/dist/cjs/components/fw-skip-indicator.js +143 -0
  20. package/dist/cjs/components/fw-skip-indicator.js.map +1 -0
  21. package/dist/cjs/components/fw-speed-indicator.js +61 -0
  22. package/dist/cjs/components/fw-speed-indicator.js.map +1 -0
  23. package/dist/cjs/components/fw-stats-panel.js +141 -0
  24. package/dist/cjs/components/fw-stats-panel.js.map +1 -0
  25. package/dist/cjs/components/fw-subtitle-renderer.js +70 -0
  26. package/dist/cjs/components/fw-subtitle-renderer.js.map +1 -0
  27. package/dist/cjs/components/fw-title-overlay.js +72 -0
  28. package/dist/cjs/components/fw-title-overlay.js.map +1 -0
  29. package/dist/cjs/components/fw-toast.js +74 -0
  30. package/dist/cjs/components/fw-toast.js.map +1 -0
  31. package/dist/cjs/components/fw-volume-control.js +140 -0
  32. package/dist/cjs/components/fw-volume-control.js.map +1 -0
  33. package/dist/cjs/controllers/player-controller-host.js +315 -0
  34. package/dist/cjs/controllers/player-controller-host.js.map +1 -0
  35. package/dist/cjs/define.js +45 -0
  36. package/dist/cjs/define.js.map +1 -0
  37. package/dist/cjs/icons/index.js +153 -0
  38. package/dist/cjs/icons/index.js.map +1 -0
  39. package/dist/cjs/index.js +88 -0
  40. package/dist/cjs/index.js.map +1 -0
  41. package/dist/cjs/node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js +33 -0
  42. package/dist/cjs/node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js.map +1 -0
  43. package/dist/cjs/styles/shared-styles.js +1967 -0
  44. package/dist/cjs/styles/shared-styles.js.map +1 -0
  45. package/dist/cjs/styles/utility-styles.js +725 -0
  46. package/dist/cjs/styles/utility-styles.js.map +1 -0
  47. package/dist/esm/components/fw-context-menu.js +17 -0
  48. package/dist/esm/components/fw-context-menu.js.map +1 -0
  49. package/dist/esm/components/fw-dev-mode-panel.js +273 -0
  50. package/dist/esm/components/fw-dev-mode-panel.js.map +1 -0
  51. package/dist/esm/components/fw-error-overlay.js +101 -0
  52. package/dist/esm/components/fw-error-overlay.js.map +1 -0
  53. package/dist/esm/components/fw-idle-screen.js +182 -0
  54. package/dist/esm/components/fw-idle-screen.js.map +1 -0
  55. package/dist/esm/components/fw-loading-spinner.js +62 -0
  56. package/dist/esm/components/fw-loading-spinner.js.map +1 -0
  57. package/dist/esm/components/fw-player-controls.js +258 -0
  58. package/dist/esm/components/fw-player-controls.js.map +1 -0
  59. package/dist/esm/components/fw-player.js +570 -0
  60. package/dist/esm/components/fw-player.js.map +1 -0
  61. package/dist/esm/components/fw-seek-bar.js +233 -0
  62. package/dist/esm/components/fw-seek-bar.js.map +1 -0
  63. package/dist/esm/components/fw-settings-menu.js +126 -0
  64. package/dist/esm/components/fw-settings-menu.js.map +1 -0
  65. package/dist/esm/components/fw-skip-indicator.js +143 -0
  66. package/dist/esm/components/fw-skip-indicator.js.map +1 -0
  67. package/dist/esm/components/fw-speed-indicator.js +61 -0
  68. package/dist/esm/components/fw-speed-indicator.js.map +1 -0
  69. package/dist/esm/components/fw-stats-panel.js +141 -0
  70. package/dist/esm/components/fw-stats-panel.js.map +1 -0
  71. package/dist/esm/components/fw-subtitle-renderer.js +70 -0
  72. package/dist/esm/components/fw-subtitle-renderer.js.map +1 -0
  73. package/dist/esm/components/fw-title-overlay.js +72 -0
  74. package/dist/esm/components/fw-title-overlay.js.map +1 -0
  75. package/dist/esm/components/fw-toast.js +74 -0
  76. package/dist/esm/components/fw-toast.js.map +1 -0
  77. package/dist/esm/components/fw-volume-control.js +140 -0
  78. package/dist/esm/components/fw-volume-control.js.map +1 -0
  79. package/dist/esm/controllers/player-controller-host.js +313 -0
  80. package/dist/esm/controllers/player-controller-host.js.map +1 -0
  81. package/dist/esm/define.js +43 -0
  82. package/dist/esm/define.js.map +1 -0
  83. package/dist/esm/icons/index.js +141 -0
  84. package/dist/esm/icons/index.js.map +1 -0
  85. package/dist/esm/index.js +18 -0
  86. package/dist/esm/index.js.map +1 -0
  87. package/dist/esm/node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js +31 -0
  88. package/dist/esm/node_modules/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js.map +1 -0
  89. package/dist/esm/styles/shared-styles.js +1965 -0
  90. package/dist/esm/styles/shared-styles.js.map +1 -0
  91. package/dist/esm/styles/utility-styles.js +723 -0
  92. package/dist/esm/styles/utility-styles.js.map +1 -0
  93. package/dist/fw-player.iife.js +4362 -0
  94. package/dist/fw-player.iife.js.map +1 -0
  95. package/dist/types/components/fw-context-menu.d.ts +15 -0
  96. package/dist/types/components/fw-dev-mode-panel.d.ts +24 -0
  97. package/dist/types/components/fw-error-overlay.d.ts +14 -0
  98. package/dist/types/components/fw-idle-screen.d.ts +13 -0
  99. package/dist/types/components/fw-loading-spinner.d.ts +10 -0
  100. package/dist/types/components/fw-player-controls.d.ts +23 -0
  101. package/dist/types/components/fw-player.d.ts +74 -0
  102. package/dist/types/components/fw-seek-bar.d.ts +33 -0
  103. package/dist/types/components/fw-settings-menu.d.ts +16 -0
  104. package/dist/types/components/fw-skip-indicator.d.ts +18 -0
  105. package/dist/types/components/fw-speed-indicator.d.ts +11 -0
  106. package/dist/types/components/fw-stats-panel.d.ts +18 -0
  107. package/dist/types/components/fw-subtitle-renderer.d.ts +21 -0
  108. package/dist/types/components/fw-title-overlay.d.ts +12 -0
  109. package/dist/types/components/fw-toast.d.ts +12 -0
  110. package/dist/types/components/fw-volume-control.d.ts +18 -0
  111. package/dist/types/controllers/player-controller-host.d.ts +119 -0
  112. package/dist/types/define.d.ts +1 -0
  113. package/dist/types/icons/index.d.ts +23 -0
  114. package/dist/types/iife-entry.d.ts +11 -0
  115. package/dist/types/index.d.ts +25 -0
  116. package/dist/types/styles/shared-styles.d.ts +1 -0
  117. package/dist/types/styles/utility-styles.d.ts +1 -0
  118. package/package.json +65 -0
  119. package/src/components/fw-context-menu.ts +23 -0
  120. package/src/components/fw-dev-mode-panel.ts +285 -0
  121. package/src/components/fw-error-overlay.ts +96 -0
  122. package/src/components/fw-idle-screen.ts +182 -0
  123. package/src/components/fw-loading-spinner.ts +63 -0
  124. package/src/components/fw-player-controls.ts +256 -0
  125. package/src/components/fw-player.ts +557 -0
  126. package/src/components/fw-seek-bar.ts +219 -0
  127. package/src/components/fw-settings-menu.ts +128 -0
  128. package/src/components/fw-skip-indicator.ts +139 -0
  129. package/src/components/fw-speed-indicator.ts +57 -0
  130. package/src/components/fw-stats-panel.ts +154 -0
  131. package/src/components/fw-subtitle-renderer.ts +65 -0
  132. package/src/components/fw-title-overlay.ts +64 -0
  133. package/src/components/fw-toast.ts +70 -0
  134. package/src/components/fw-volume-control.ts +140 -0
  135. package/src/controllers/player-controller-host.ts +457 -0
  136. package/src/define.ts +43 -0
  137. package/src/icons/index.ts +209 -0
  138. package/src/iife-entry.ts +11 -0
  139. package/src/index.ts +31 -0
  140. package/src/styles/shared-styles.ts +1962 -0
  141. package/src/styles/utility-styles.ts +720 -0
@@ -0,0 +1,315 @@
1
+ 'use strict';
2
+
3
+ var playerCore = require('@livepeer-frameworks/player-core');
4
+
5
+ const initialState = {
6
+ state: "booting",
7
+ streamState: null,
8
+ endpoints: null,
9
+ metadata: null,
10
+ videoElement: null,
11
+ currentTime: 0,
12
+ duration: NaN,
13
+ isPlaying: false,
14
+ isPaused: true,
15
+ isBuffering: false,
16
+ isMuted: true,
17
+ volume: 1,
18
+ error: null,
19
+ errorDetails: null,
20
+ isPassiveError: false,
21
+ hasPlaybackStarted: false,
22
+ isHoldingSpeed: false,
23
+ holdSpeed: 2,
24
+ isHovering: false,
25
+ shouldShowControls: false,
26
+ isLoopEnabled: false,
27
+ isFullscreen: false,
28
+ isPiPActive: false,
29
+ isEffectivelyLive: false,
30
+ shouldShowIdleScreen: true,
31
+ currentPlayerInfo: null,
32
+ currentSourceInfo: null,
33
+ playbackQuality: null,
34
+ subtitlesEnabled: false,
35
+ qualities: [],
36
+ textTracks: [],
37
+ streamInfo: null,
38
+ toast: null,
39
+ };
40
+ class PlayerControllerHost {
41
+ constructor(host) {
42
+ this.controller = null;
43
+ this.unsubs = [];
44
+ this.currentConfig = null;
45
+ this.s = { ...initialState };
46
+ this.host = host;
47
+ host.addController(this);
48
+ }
49
+ // ---- Configuration & Lifecycle ----
50
+ configure(config) {
51
+ this.currentConfig = config;
52
+ }
53
+ async attach(container) {
54
+ if (!this.currentConfig)
55
+ return;
56
+ this.teardown();
57
+ const controller = new playerCore.PlayerController({
58
+ contentId: this.currentConfig.contentId,
59
+ contentType: this.currentConfig.contentType,
60
+ endpoints: this.currentConfig.endpoints,
61
+ gatewayUrl: this.currentConfig.gatewayUrl,
62
+ mistUrl: this.currentConfig.mistUrl,
63
+ authToken: this.currentConfig.authToken,
64
+ autoplay: this.currentConfig.autoplay,
65
+ muted: this.currentConfig.muted,
66
+ controls: this.currentConfig.controls,
67
+ poster: this.currentConfig.poster,
68
+ debug: this.currentConfig.debug,
69
+ });
70
+ this.controller = controller;
71
+ this.subscribeToEvents(controller);
72
+ this.update({ isLoopEnabled: controller.isLoopEnabled() });
73
+ try {
74
+ await controller.attach(container);
75
+ }
76
+ catch (err) {
77
+ console.warn("[PlayerControllerHost] Attach failed:", err);
78
+ }
79
+ }
80
+ hostConnected() {
81
+ // Controller attachment happens in firstUpdated of the host element
82
+ }
83
+ hostDisconnected() {
84
+ this.teardown();
85
+ this.s = { ...initialState };
86
+ }
87
+ teardown() {
88
+ this.unsubs.forEach((fn) => fn());
89
+ this.unsubs = [];
90
+ this.controller?.destroy();
91
+ this.controller = null;
92
+ }
93
+ // ---- State Updates ----
94
+ update(partial) {
95
+ Object.assign(this.s, partial);
96
+ this.host.requestUpdate();
97
+ }
98
+ syncState() {
99
+ if (!this.controller)
100
+ return;
101
+ const c = this.controller;
102
+ this.update({
103
+ isPlaying: c.isPlaying(),
104
+ isPaused: c.isPaused(),
105
+ isBuffering: c.isBuffering(),
106
+ isMuted: c.isMuted(),
107
+ volume: c.getVolume(),
108
+ hasPlaybackStarted: c.hasPlaybackStarted(),
109
+ shouldShowControls: c.shouldShowControls(),
110
+ shouldShowIdleScreen: c.shouldShowIdleScreen(),
111
+ playbackQuality: c.getPlaybackQuality(),
112
+ isLoopEnabled: c.isLoopEnabled(),
113
+ subtitlesEnabled: c.isSubtitlesEnabled(),
114
+ qualities: c.getQualities(),
115
+ streamInfo: c.getStreamInfo(),
116
+ });
117
+ }
118
+ // ---- Event Subscriptions (mirrors usePlayerController exactly) ----
119
+ subscribeToEvents(controller) {
120
+ const u = this.unsubs;
121
+ u.push(controller.on("stateChange", ({ state }) => {
122
+ this.update({ state });
123
+ this.dispatchEvent("fw-state-change", { state });
124
+ }));
125
+ u.push(controller.on("streamStateChange", ({ state: streamState }) => {
126
+ this.update({
127
+ streamState,
128
+ metadata: controller.getMetadata(),
129
+ isEffectivelyLive: controller.isEffectivelyLive(),
130
+ shouldShowIdleScreen: controller.shouldShowIdleScreen(),
131
+ });
132
+ this.dispatchEvent("fw-stream-state", { state: streamState });
133
+ }));
134
+ u.push(controller.on("timeUpdate", ({ currentTime, duration }) => {
135
+ this.update({ currentTime, duration });
136
+ this.dispatchEvent("fw-time-update", { currentTime, duration });
137
+ }));
138
+ u.push(controller.on("error", ({ error }) => {
139
+ this.update({
140
+ error,
141
+ isPassiveError: controller.isPassiveError(),
142
+ });
143
+ this.dispatchEvent("fw-error", { error });
144
+ }));
145
+ u.push(controller.on("errorCleared", () => {
146
+ this.update({ error: null, isPassiveError: false });
147
+ }));
148
+ u.push(controller.on("ready", ({ videoElement }) => {
149
+ this.update({
150
+ videoElement,
151
+ endpoints: controller.getEndpoints(),
152
+ metadata: controller.getMetadata(),
153
+ streamInfo: controller.getStreamInfo(),
154
+ isEffectivelyLive: controller.isEffectivelyLive(),
155
+ shouldShowIdleScreen: controller.shouldShowIdleScreen(),
156
+ currentPlayerInfo: controller.getCurrentPlayerInfo(),
157
+ currentSourceInfo: controller.getCurrentSourceInfo(),
158
+ qualities: controller.getQualities(),
159
+ });
160
+ this.dispatchEvent("fw-ready", { videoElement });
161
+ const handleVideoEvent = () => {
162
+ if (this.controller?.shouldSuppressVideoEvents?.())
163
+ return;
164
+ this.syncState();
165
+ };
166
+ videoElement.addEventListener("play", handleVideoEvent);
167
+ videoElement.addEventListener("pause", handleVideoEvent);
168
+ videoElement.addEventListener("waiting", handleVideoEvent);
169
+ videoElement.addEventListener("playing", handleVideoEvent);
170
+ u.push(() => {
171
+ videoElement.removeEventListener("play", handleVideoEvent);
172
+ videoElement.removeEventListener("pause", handleVideoEvent);
173
+ videoElement.removeEventListener("waiting", handleVideoEvent);
174
+ videoElement.removeEventListener("playing", handleVideoEvent);
175
+ });
176
+ }));
177
+ u.push(controller.on("playerSelected", ({ player: _player, source }) => {
178
+ this.update({
179
+ currentPlayerInfo: controller.getCurrentPlayerInfo(),
180
+ currentSourceInfo: { url: source.url, type: source.type },
181
+ qualities: controller.getQualities(),
182
+ });
183
+ }));
184
+ u.push(controller.on("volumeChange", ({ volume, muted }) => {
185
+ this.update({ volume, isMuted: muted });
186
+ this.dispatchEvent("fw-volume-change", { volume, muted });
187
+ }));
188
+ u.push(controller.on("loopChange", ({ isLoopEnabled }) => {
189
+ this.update({ isLoopEnabled });
190
+ }));
191
+ u.push(controller.on("fullscreenChange", ({ isFullscreen }) => {
192
+ this.update({ isFullscreen });
193
+ this.dispatchEvent("fw-fullscreen-change", { isFullscreen });
194
+ }));
195
+ u.push(controller.on("pipChange", ({ isPiP }) => {
196
+ this.update({ isPiPActive: isPiP });
197
+ this.dispatchEvent("fw-pip-change", { isPiP });
198
+ }));
199
+ u.push(controller.on("holdSpeedStart", ({ speed }) => {
200
+ this.update({ isHoldingSpeed: true, holdSpeed: speed });
201
+ }));
202
+ u.push(controller.on("holdSpeedEnd", () => {
203
+ this.update({ isHoldingSpeed: false });
204
+ }));
205
+ u.push(controller.on("hoverStart", () => {
206
+ this.update({ isHovering: true, shouldShowControls: true });
207
+ }));
208
+ u.push(controller.on("hoverEnd", () => {
209
+ this.update({
210
+ isHovering: false,
211
+ shouldShowControls: controller.shouldShowControls(),
212
+ });
213
+ }));
214
+ u.push(controller.on("captionsChange", ({ enabled }) => {
215
+ this.update({ subtitlesEnabled: enabled });
216
+ }));
217
+ u.push(controller.on("protocolSwapped", (data) => {
218
+ const message = `Switched to ${data.toProtocol}`;
219
+ this.update({ toast: { message, timestamp: Date.now() } });
220
+ this.dispatchEvent("fw-protocol-swapped", data);
221
+ }));
222
+ u.push(controller.on("playbackFailed", (data) => {
223
+ this.update({
224
+ error: data.message,
225
+ errorDetails: data.details ?? null,
226
+ isPassiveError: false,
227
+ });
228
+ this.dispatchEvent("fw-playback-failed", {
229
+ code: data.code,
230
+ message: data.message,
231
+ });
232
+ }));
233
+ }
234
+ // ---- Event Dispatching ----
235
+ dispatchEvent(name, detail) {
236
+ this.host.dispatchEvent(new CustomEvent(name, { detail, bubbles: true, composed: true }));
237
+ }
238
+ // ---- Action Methods ----
239
+ async play() {
240
+ await this.controller?.play();
241
+ }
242
+ pause() {
243
+ this.controller?.pause();
244
+ }
245
+ togglePlay() {
246
+ this.controller?.togglePlay();
247
+ }
248
+ seek(time) {
249
+ this.controller?.seek(time);
250
+ }
251
+ seekBy(delta) {
252
+ this.controller?.seekBy(delta);
253
+ }
254
+ jumpToLive() {
255
+ this.controller?.jumpToLive();
256
+ }
257
+ setVolume(volume) {
258
+ this.controller?.setVolume(volume);
259
+ }
260
+ toggleMute() {
261
+ this.controller?.toggleMute();
262
+ }
263
+ toggleLoop() {
264
+ this.controller?.toggleLoop();
265
+ }
266
+ async toggleFullscreen() {
267
+ await this.controller?.toggleFullscreen();
268
+ }
269
+ async togglePiP() {
270
+ await this.controller?.togglePictureInPicture();
271
+ }
272
+ toggleSubtitles() {
273
+ this.controller?.toggleSubtitles();
274
+ }
275
+ clearError() {
276
+ this.controller?.clearError();
277
+ this.update({ error: null, errorDetails: null, isPassiveError: false });
278
+ }
279
+ dismissToast() {
280
+ this.update({ toast: null });
281
+ }
282
+ async retry() {
283
+ await this.controller?.retry();
284
+ }
285
+ async reload() {
286
+ await this.controller?.reload();
287
+ }
288
+ getQualities() {
289
+ return this.controller?.getQualities() ?? [];
290
+ }
291
+ selectQuality(id) {
292
+ this.controller?.selectQuality(id);
293
+ }
294
+ handleMouseEnter() {
295
+ this.controller?.handleMouseEnter();
296
+ }
297
+ handleMouseLeave() {
298
+ this.controller?.handleMouseLeave();
299
+ }
300
+ handleMouseMove() {
301
+ this.controller?.handleMouseMove();
302
+ }
303
+ handleTouchStart() {
304
+ this.controller?.handleTouchStart();
305
+ }
306
+ async setDevModeOptions(options) {
307
+ await this.controller?.setDevModeOptions(options);
308
+ }
309
+ getController() {
310
+ return this.controller;
311
+ }
312
+ }
313
+
314
+ exports.PlayerControllerHost = PlayerControllerHost;
315
+ //# sourceMappingURL=player-controller-host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"player-controller-host.js","sources":["../../../../src/controllers/player-controller-host.ts"],"sourcesContent":["/**\n * PlayerControllerHost — Lit ReactiveController wrapping the headless PlayerController.\n * Direct port of usePlayerController.ts from player-react.\n */\nimport type { ReactiveController, ReactiveControllerHost } from \"lit\";\nimport {\n PlayerController,\n type PlayerControllerConfig,\n type PlayerState,\n type StreamState,\n type StreamInfo,\n type PlaybackQuality,\n type ContentEndpoints,\n type ContentMetadata,\n type ClassifiedError,\n} from \"@livepeer-frameworks/player-core\";\n\nexport interface PlayerControllerHostState {\n state: PlayerState;\n streamState: StreamState | null;\n endpoints: ContentEndpoints | null;\n metadata: ContentMetadata | null;\n videoElement: HTMLVideoElement | null;\n currentTime: number;\n duration: number;\n isPlaying: boolean;\n isPaused: boolean;\n isBuffering: boolean;\n isMuted: boolean;\n volume: number;\n error: string | null;\n errorDetails: ClassifiedError[\"details\"] | null;\n isPassiveError: boolean;\n hasPlaybackStarted: boolean;\n isHoldingSpeed: boolean;\n holdSpeed: number;\n isHovering: boolean;\n shouldShowControls: boolean;\n isLoopEnabled: boolean;\n isFullscreen: boolean;\n isPiPActive: boolean;\n isEffectivelyLive: boolean;\n shouldShowIdleScreen: boolean;\n currentPlayerInfo: { name: string; shortname: string } | null;\n currentSourceInfo: { url: string; type: string } | null;\n playbackQuality: PlaybackQuality | null;\n subtitlesEnabled: boolean;\n qualities: Array<{\n id: string;\n label: string;\n bitrate?: number;\n width?: number;\n height?: number;\n isAuto?: boolean;\n active?: boolean;\n }>;\n textTracks: Array<{ id: string; label: string; language?: string; active: boolean }>;\n streamInfo: StreamInfo | null;\n toast: { message: string; timestamp: number } | null;\n}\n\nconst initialState: PlayerControllerHostState = {\n state: \"booting\",\n streamState: null,\n endpoints: null,\n metadata: null,\n videoElement: null,\n currentTime: 0,\n duration: NaN,\n isPlaying: false,\n isPaused: true,\n isBuffering: false,\n isMuted: true,\n volume: 1,\n error: null,\n errorDetails: null,\n isPassiveError: false,\n hasPlaybackStarted: false,\n isHoldingSpeed: false,\n holdSpeed: 2,\n isHovering: false,\n shouldShowControls: false,\n isLoopEnabled: false,\n isFullscreen: false,\n isPiPActive: false,\n isEffectivelyLive: false,\n shouldShowIdleScreen: true,\n currentPlayerInfo: null,\n currentSourceInfo: null,\n playbackQuality: null,\n subtitlesEnabled: false,\n qualities: [],\n textTracks: [],\n streamInfo: null,\n toast: null,\n};\n\ntype HostElement = ReactiveControllerHost & HTMLElement;\n\nexport class PlayerControllerHost implements ReactiveController {\n host: HostElement;\n private controller: PlayerController | null = null;\n private unsubs: Array<() => void> = [];\n private currentConfig: PlayerControllerConfig | null = null;\n\n s: PlayerControllerHostState = { ...initialState };\n\n constructor(host: HostElement) {\n this.host = host;\n host.addController(this);\n }\n\n // ---- Configuration & Lifecycle ----\n\n configure(config: PlayerControllerConfig) {\n this.currentConfig = config;\n }\n\n async attach(container: HTMLDivElement) {\n if (!this.currentConfig) return;\n this.teardown();\n\n const controller = new PlayerController({\n contentId: this.currentConfig.contentId,\n contentType: this.currentConfig.contentType,\n endpoints: this.currentConfig.endpoints,\n gatewayUrl: this.currentConfig.gatewayUrl,\n mistUrl: this.currentConfig.mistUrl,\n authToken: this.currentConfig.authToken,\n autoplay: this.currentConfig.autoplay,\n muted: this.currentConfig.muted,\n controls: this.currentConfig.controls,\n poster: this.currentConfig.poster,\n debug: this.currentConfig.debug,\n });\n\n this.controller = controller;\n this.subscribeToEvents(controller);\n\n this.update({ isLoopEnabled: controller.isLoopEnabled() });\n\n try {\n await controller.attach(container);\n } catch (err) {\n console.warn(\"[PlayerControllerHost] Attach failed:\", err);\n }\n }\n\n hostConnected() {\n // Controller attachment happens in firstUpdated of the host element\n }\n\n hostDisconnected() {\n this.teardown();\n this.s = { ...initialState };\n }\n\n private teardown() {\n this.unsubs.forEach((fn) => fn());\n this.unsubs = [];\n this.controller?.destroy();\n this.controller = null;\n }\n\n // ---- State Updates ----\n\n private update(partial: Partial<PlayerControllerHostState>) {\n Object.assign(this.s, partial);\n this.host.requestUpdate();\n }\n\n private syncState() {\n if (!this.controller) return;\n const c = this.controller;\n this.update({\n isPlaying: c.isPlaying(),\n isPaused: c.isPaused(),\n isBuffering: c.isBuffering(),\n isMuted: c.isMuted(),\n volume: c.getVolume(),\n hasPlaybackStarted: c.hasPlaybackStarted(),\n shouldShowControls: c.shouldShowControls(),\n shouldShowIdleScreen: c.shouldShowIdleScreen(),\n playbackQuality: c.getPlaybackQuality(),\n isLoopEnabled: c.isLoopEnabled(),\n subtitlesEnabled: c.isSubtitlesEnabled(),\n qualities: c.getQualities(),\n streamInfo: c.getStreamInfo(),\n });\n }\n\n // ---- Event Subscriptions (mirrors usePlayerController exactly) ----\n\n private subscribeToEvents(controller: PlayerController) {\n const u = this.unsubs;\n\n u.push(\n controller.on(\"stateChange\", ({ state }) => {\n this.update({ state });\n this.dispatchEvent(\"fw-state-change\", { state });\n })\n );\n\n u.push(\n controller.on(\"streamStateChange\", ({ state: streamState }) => {\n this.update({\n streamState,\n metadata: controller.getMetadata(),\n isEffectivelyLive: controller.isEffectivelyLive(),\n shouldShowIdleScreen: controller.shouldShowIdleScreen(),\n });\n this.dispatchEvent(\"fw-stream-state\", { state: streamState });\n })\n );\n\n u.push(\n controller.on(\"timeUpdate\", ({ currentTime, duration }) => {\n this.update({ currentTime, duration });\n this.dispatchEvent(\"fw-time-update\", { currentTime, duration });\n })\n );\n\n u.push(\n controller.on(\"error\", ({ error }) => {\n this.update({\n error,\n isPassiveError: controller.isPassiveError(),\n });\n this.dispatchEvent(\"fw-error\", { error });\n })\n );\n\n u.push(\n controller.on(\"errorCleared\", () => {\n this.update({ error: null, isPassiveError: false });\n })\n );\n\n u.push(\n controller.on(\"ready\", ({ videoElement }) => {\n this.update({\n videoElement,\n endpoints: controller.getEndpoints(),\n metadata: controller.getMetadata(),\n streamInfo: controller.getStreamInfo(),\n isEffectivelyLive: controller.isEffectivelyLive(),\n shouldShowIdleScreen: controller.shouldShowIdleScreen(),\n currentPlayerInfo: controller.getCurrentPlayerInfo(),\n currentSourceInfo: controller.getCurrentSourceInfo(),\n qualities: controller.getQualities(),\n });\n this.dispatchEvent(\"fw-ready\", { videoElement });\n\n const handleVideoEvent = () => {\n if (this.controller?.shouldSuppressVideoEvents?.()) return;\n this.syncState();\n };\n videoElement.addEventListener(\"play\", handleVideoEvent);\n videoElement.addEventListener(\"pause\", handleVideoEvent);\n videoElement.addEventListener(\"waiting\", handleVideoEvent);\n videoElement.addEventListener(\"playing\", handleVideoEvent);\n u.push(() => {\n videoElement.removeEventListener(\"play\", handleVideoEvent);\n videoElement.removeEventListener(\"pause\", handleVideoEvent);\n videoElement.removeEventListener(\"waiting\", handleVideoEvent);\n videoElement.removeEventListener(\"playing\", handleVideoEvent);\n });\n })\n );\n\n u.push(\n controller.on(\"playerSelected\", ({ player: _player, source }) => {\n this.update({\n currentPlayerInfo: controller.getCurrentPlayerInfo(),\n currentSourceInfo: { url: source.url, type: source.type },\n qualities: controller.getQualities(),\n });\n })\n );\n\n u.push(\n controller.on(\"volumeChange\", ({ volume, muted }) => {\n this.update({ volume, isMuted: muted });\n this.dispatchEvent(\"fw-volume-change\", { volume, muted });\n })\n );\n\n u.push(\n controller.on(\"loopChange\", ({ isLoopEnabled }) => {\n this.update({ isLoopEnabled });\n })\n );\n\n u.push(\n controller.on(\"fullscreenChange\", ({ isFullscreen }) => {\n this.update({ isFullscreen });\n this.dispatchEvent(\"fw-fullscreen-change\", { isFullscreen });\n })\n );\n\n u.push(\n controller.on(\"pipChange\", ({ isPiP }) => {\n this.update({ isPiPActive: isPiP });\n this.dispatchEvent(\"fw-pip-change\", { isPiP });\n })\n );\n\n u.push(\n controller.on(\"holdSpeedStart\", ({ speed }) => {\n this.update({ isHoldingSpeed: true, holdSpeed: speed });\n })\n );\n\n u.push(\n controller.on(\"holdSpeedEnd\", () => {\n this.update({ isHoldingSpeed: false });\n })\n );\n\n u.push(\n controller.on(\"hoverStart\", () => {\n this.update({ isHovering: true, shouldShowControls: true });\n })\n );\n\n u.push(\n controller.on(\"hoverEnd\", () => {\n this.update({\n isHovering: false,\n shouldShowControls: controller.shouldShowControls(),\n });\n })\n );\n\n u.push(\n controller.on(\"captionsChange\", ({ enabled }) => {\n this.update({ subtitlesEnabled: enabled });\n })\n );\n\n u.push(\n controller.on(\"protocolSwapped\", (data) => {\n const message = `Switched to ${data.toProtocol}`;\n this.update({ toast: { message, timestamp: Date.now() } });\n this.dispatchEvent(\"fw-protocol-swapped\", data);\n })\n );\n\n u.push(\n controller.on(\"playbackFailed\", (data) => {\n this.update({\n error: data.message,\n errorDetails: data.details ?? null,\n isPassiveError: false,\n });\n this.dispatchEvent(\"fw-playback-failed\", {\n code: data.code,\n message: data.message,\n });\n })\n );\n }\n\n // ---- Event Dispatching ----\n\n private dispatchEvent(name: string, detail: unknown) {\n this.host.dispatchEvent(new CustomEvent(name, { detail, bubbles: true, composed: true }));\n }\n\n // ---- Action Methods ----\n\n async play() {\n await this.controller?.play();\n }\n pause() {\n this.controller?.pause();\n }\n togglePlay() {\n this.controller?.togglePlay();\n }\n seek(time: number) {\n this.controller?.seek(time);\n }\n seekBy(delta: number) {\n this.controller?.seekBy(delta);\n }\n jumpToLive() {\n this.controller?.jumpToLive();\n }\n setVolume(volume: number) {\n this.controller?.setVolume(volume);\n }\n toggleMute() {\n this.controller?.toggleMute();\n }\n toggleLoop() {\n this.controller?.toggleLoop();\n }\n async toggleFullscreen() {\n await this.controller?.toggleFullscreen();\n }\n async togglePiP() {\n await this.controller?.togglePictureInPicture();\n }\n toggleSubtitles() {\n this.controller?.toggleSubtitles();\n }\n\n clearError() {\n this.controller?.clearError();\n this.update({ error: null, errorDetails: null, isPassiveError: false });\n }\n\n dismissToast() {\n this.update({ toast: null });\n }\n\n async retry() {\n await this.controller?.retry();\n }\n async reload() {\n await this.controller?.reload();\n }\n\n getQualities() {\n return this.controller?.getQualities() ?? [];\n }\n selectQuality(id: string) {\n this.controller?.selectQuality(id);\n }\n\n handleMouseEnter() {\n this.controller?.handleMouseEnter();\n }\n handleMouseLeave() {\n this.controller?.handleMouseLeave();\n }\n handleMouseMove() {\n this.controller?.handleMouseMove();\n }\n handleTouchStart() {\n this.controller?.handleTouchStart();\n }\n\n async setDevModeOptions(options: {\n forcePlayer?: string;\n forceType?: string;\n forceSource?: number;\n playbackMode?: \"auto\" | \"low-latency\" | \"quality\" | \"vod\";\n }) {\n await this.controller?.setDevModeOptions(options);\n }\n\n getController(): PlayerController | null {\n return this.controller;\n }\n}\n"],"names":["PlayerController"],"mappings":";;;;AA6DA,MAAM,YAAY,GAA8B;AAC9C,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,WAAW,EAAE,CAAC;AACd,IAAA,QAAQ,EAAE,GAAG;AACb,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,WAAW,EAAE,KAAK;AAClB,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,kBAAkB,EAAE,KAAK;AACzB,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,kBAAkB,EAAE,KAAK;AACzB,IAAA,aAAa,EAAE,KAAK;AACp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M,GAAA;AACV,QAAA,MAAM,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE;IACjC;IAEA,YAAY,GAAA;QACV,OAAO,IAAI,CAAC,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE;IAC9C;AACA,IAAA,aAAa,CAAC,EAAU,EAAA;AACtB,QAAA,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,EAAE,CAAC;IACpC;IAEA,gBAAgB,GAAA;AACd,QAAA,IAAI,CAAC,UAAU,EAAE,gBAAgB,EAAE;IACrC;IACA,gBAAgB,GAAA;AACd,QAAA,IAAI,CAAC,UAAU,EAAE,gBAAgB,EAAE;IACrC;IACA,eAAe,GAAA;AACb,QAAA,IAAI,CAAC,UAAU,EAAE,eAAe,EAAE;IACpC;IACA,gBAAgB,GAAA;AACd,QAAA,IAAI,CAAC,UAAU,EAAE,gBAAgB,EAAE;IACrC;IAEA,MAAM,iBAAiB,CAAC,OAKvB,EAAA;QACC,MAAM,IAAI,CAAC,UAAU,EAAE,iBAAiB,CAAC,OAAO,CAAC;IACnD;IAEA,aAAa,GAAA;QACX,OAAO,IAAI,CAAC,UAAU;IACxB;AACD;;;;"}
@@ -0,0 +1,45 @@
1
+ 'use strict';
2
+
3
+ var fwPlayer = require('./components/fw-player.js');
4
+ var fwPlayerControls = require('./components/fw-player-controls.js');
5
+ var fwSeekBar = require('./components/fw-seek-bar.js');
6
+ var fwVolumeControl = require('./components/fw-volume-control.js');
7
+ var fwSettingsMenu = require('./components/fw-settings-menu.js');
8
+ var fwIdleScreen = require('./components/fw-idle-screen.js');
9
+ var fwLoadingSpinner = require('./components/fw-loading-spinner.js');
10
+ var fwTitleOverlay = require('./components/fw-title-overlay.js');
11
+ var fwErrorOverlay = require('./components/fw-error-overlay.js');
12
+ var fwToast = require('./components/fw-toast.js');
13
+ var fwStatsPanel = require('./components/fw-stats-panel.js');
14
+ var fwDevModePanel = require('./components/fw-dev-mode-panel.js');
15
+ var fwSubtitleRenderer = require('./components/fw-subtitle-renderer.js');
16
+ var fwSkipIndicator = require('./components/fw-skip-indicator.js');
17
+ var fwSpeedIndicator = require('./components/fw-speed-indicator.js');
18
+ var fwContextMenu = require('./components/fw-context-menu.js');
19
+
20
+ /**
21
+ * Side-effect import that registers all custom elements.
22
+ * Usage: import '@livepeer-frameworks/player-wc/define';
23
+ */
24
+ function safeDefine(name, ctor) {
25
+ if (!customElements.get(name)) {
26
+ customElements.define(name, ctor);
27
+ }
28
+ }
29
+ safeDefine("fw-player", fwPlayer.FwPlayer);
30
+ safeDefine("fw-player-controls", fwPlayerControls.FwPlayerControls);
31
+ safeDefine("fw-seek-bar", fwSeekBar.FwSeekBar);
32
+ safeDefine("fw-volume-control", fwVolumeControl.FwVolumeControl);
33
+ safeDefine("fw-settings-menu", fwSettingsMenu.FwSettingsMenu);
34
+ safeDefine("fw-idle-screen", fwIdleScreen.FwIdleScreen);
35
+ safeDefine("fw-loading-spinner", fwLoadingSpinner.FwLoadingSpinner);
36
+ safeDefine("fw-title-overlay", fwTitleOverlay.FwTitleOverlay);
37
+ safeDefine("fw-error-overlay", fwErrorOverlay.FwErrorOverlay);
38
+ safeDefine("fw-toast", fwToast.FwToast);
39
+ safeDefine("fw-stats-panel", fwStatsPanel.FwStatsPanel);
40
+ safeDefine("fw-dev-mode-panel", fwDevModePanel.FwDevModePanel);
41
+ safeDefine("fw-subtitle-renderer", fwSubtitleRenderer.FwSubtitleRenderer);
42
+ safeDefine("fw-skip-indicator", fwSkipIndicator.FwSkipIndicator);
43
+ safeDefine("fw-speed-indicator", fwSpeedIndicator.FwSpeedIndicator);
44
+ safeDefine("fw-context-menu", fwContextMenu.FwContextMenu);
45
+ //# sourceMappingURL=define.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.js","sources":["../../../src/define.ts"],"sourcesContent":["/**\n * Side-effect import that registers all custom elements.\n * Usage: import '@livepeer-frameworks/player-wc/define';\n */\nimport { FwPlayer } from \"./components/fw-player.js\";\nimport { FwPlayerControls } from \"./components/fw-player-controls.js\";\nimport { FwSeekBar } from \"./components/fw-seek-bar.js\";\nimport { FwVolumeControl } from \"./components/fw-volume-control.js\";\nimport { FwSettingsMenu } from \"./components/fw-settings-menu.js\";\nimport { FwIdleScreen } from \"./components/fw-idle-screen.js\";\nimport { FwLoadingSpinner } from \"./components/fw-loading-spinner.js\";\nimport { FwTitleOverlay } from \"./components/fw-title-overlay.js\";\nimport { FwErrorOverlay } from \"./components/fw-error-overlay.js\";\nimport { FwToast } from \"./components/fw-toast.js\";\nimport { FwStatsPanel } from \"./components/fw-stats-panel.js\";\nimport { FwDevModePanel } from \"./components/fw-dev-mode-panel.js\";\nimport { FwSubtitleRenderer } from \"./components/fw-subtitle-renderer.js\";\nimport { FwSkipIndicator } from \"./components/fw-skip-indicator.js\";\nimport { FwSpeedIndicator } from \"./components/fw-speed-indicator.js\";\nimport { FwContextMenu } from \"./components/fw-context-menu.js\";\n\nfunction safeDefine(name: string, ctor: CustomElementConstructor) {\n if (!customElements.get(name)) {\n customElements.define(name, ctor);\n }\n}\n\nsafeDefine(\"fw-player\", FwPlayer);\nsafeDefine(\"fw-player-controls\", FwPlayerControls);\nsafeDefine(\"fw-seek-bar\", FwSeekBar);\nsafeDefine(\"fw-volume-control\", FwVolumeControl);\nsafeDefine(\"fw-settings-menu\", FwSettingsMenu);\nsafeDefine(\"fw-idle-screen\", FwIdleScreen);\nsafeDefine(\"fw-loading-spinner\", FwLoadingSpinner);\nsafeDefine(\"fw-title-overlay\", FwTitleOverlay);\nsafeDefine(\"fw-error-overlay\", FwErrorOverlay);\nsafeDefine(\"fw-toast\", FwToast);\nsafeDefine(\"fw-stats-panel\", FwStatsPanel);\nsafeDefine(\"fw-dev-mode-panel\", FwDevModePanel);\nsafeDefine(\"fw-subtitle-renderer\", FwSubtitleRenderer);\nsafeDefine(\"fw-skip-indicator\", FwSkipIndicator);\nsafeDefine(\"fw-speed-indicator\", FwSpeedIndicator);\nsafeDefine(\"fw-context-menu\", FwContextMenu);\n"],"names":["FwPlayer","FwPlayerControls","FwSeekBar","FwVolumeControl","FwSettingsMenu","FwIdleScreen","FwLoadingSpinner","FwTitleOverlay","FwErrorOverlay","FwToast","FwStatsPanel","FwDevModePanel","FwSubtitleRenderer","FwSkipIndicator","FwSpeedIndicator","FwContextMenu"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;AAGG;AAkBH,SAAS,UAAU,CAAC,IAAY,EAAE,IAA8B,EAAA;IAC9D,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;AAC7B,QAAA,cAAc,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC;IACnC;AACF;AAEA,UAAU,CAAC,WAAW,EAAEA,iBAAQ,CAAC;AACjC,UAAU,CAAC,oBAAoB,EAAEC,iCAAgB,CAAC;AAClD,UAAU,CAAC,aAAa,EAAEC,mBAAS,CAAC;AACpC,UAAU,CAAC,mBAAmB,EAAEC,+BAAe,CAAC;AAChD,UAAU,CAAC,kBAAkB,EAAEC,6BAAc,CAAC;AAC9C,UAAU,CAAC,gBAAgB,EAAEC,yBAAY,CAAC;AAC1C,UAAU,CAAC,oBAAoB,EAAEC,iCAAgB,CAAC;AAClD,UAAU,CAAC,kBAAkB,EAAEC,6BAAc,CAAC;AAC9C,UAAU,CAAC,kBAAkB,EAAEC,6BAAc,CAAC;AAC9C,UAAU,CAAC,UAAU,EAAEC,eAAO,CAAC;AAC/B,UAAU,CAAC,gBAAgB,EAAEC,yBAAY,CAAC;AAC1C,UAAU,CAAC,mBAAmB,EAAEC,6BAAc,CAAC;AAC/C,UAAU,CAAC,sBAAsB,EAAEC,qCAAkB,CAAC;AACtD,UAAU,CAAC,mBAAmB,EAAEC,+BAAe,CAAC;AAChD,UAAU,CAAC,oBAAoB,EAAEC,iCAAgB,CAAC;AAClD,UAAU,CAAC,iBAAiB,EAAEC,2BAAa,CAAC;;"}
@@ -0,0 +1,153 @@
1
+ 'use strict';
2
+
3
+ var lit = require('lit');
4
+
5
+ /**
6
+ * SVG icons as Lit html template functions.
7
+ * Port of Icons.tsx from player-react.
8
+ */
9
+ const playIcon = (size = 16, color = "currentColor") => lit.html `
10
+ <svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" aria-hidden="true">
11
+ <path d="M8 5v14l11-7z" fill="${color}" />
12
+ </svg>
13
+ `;
14
+ const pauseIcon = (size = 16, color = "currentColor") => lit.html `
15
+ <svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" aria-hidden="true">
16
+ <rect x="6" y="4" width="4" height="16" fill="${color}" />
17
+ <rect x="14" y="4" width="4" height="16" fill="${color}" />
18
+ </svg>
19
+ `;
20
+ const volumeUpIcon = (size = 16, color = "currentColor") => lit.html `
21
+ <svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" aria-hidden="true">
22
+ <polygon points="11,5 6,9 2,9 2,15 6,15 11,19" fill="${color}" />
23
+ <path
24
+ d="M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07"
25
+ stroke="${color}"
26
+ stroke-width="2"
27
+ stroke-linecap="round"
28
+ stroke-linejoin="round"
29
+ />
30
+ </svg>
31
+ `;
32
+ const volumeOffIcon = (size = 16, color = "currentColor") => lit.html `
33
+ <svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" aria-hidden="true">
34
+ <polygon points="11,5 6,9 2,9 2,15 6,15 11,19" fill="${color}" />
35
+ <line
36
+ x1="23"
37
+ y1="9"
38
+ x2="17"
39
+ y2="15"
40
+ stroke="${color}"
41
+ stroke-width="2"
42
+ stroke-linecap="round"
43
+ />
44
+ <line
45
+ x1="17"
46
+ y1="9"
47
+ x2="23"
48
+ y2="15"
49
+ stroke="${color}"
50
+ stroke-width="2"
51
+ stroke-linecap="round"
52
+ />
53
+ </svg>
54
+ `;
55
+ const fullscreenIcon = (size = 16, color = "currentColor") => lit.html `
56
+ <svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" aria-hidden="true">
57
+ <path
58
+ d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3m8 0h3a2 2 0 0 0 2-2v-3"
59
+ stroke="${color}"
60
+ stroke-width="2"
61
+ stroke-linecap="round"
62
+ stroke-linejoin="round"
63
+ />
64
+ </svg>
65
+ `;
66
+ const fullscreenExitIcon = (size = 16, color = "currentColor") => lit.html `
67
+ <svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" aria-hidden="true">
68
+ <path
69
+ d="M8 3v3a2 2 0 0 1-2 2H3M21 8h-3a2 2 0 0 1-2-2V3M3 16h3a2 2 0 0 1 2 2v3M16 21v-3a2 2 0 0 1 2-2h3"
70
+ stroke="${color}"
71
+ stroke-width="2"
72
+ stroke-linecap="round"
73
+ stroke-linejoin="round"
74
+ />
75
+ </svg>
76
+ `;
77
+ const pictureInPictureIcon = (size = 16, color = "currentColor") => lit.html `
78
+ <svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" aria-hidden="true">
79
+ <rect
80
+ x="2"
81
+ y="3"
82
+ width="20"
83
+ height="14"
84
+ rx="2"
85
+ ry="2"
86
+ stroke="${color}"
87
+ stroke-width="2"
88
+ fill="none"
89
+ />
90
+ <rect x="8" y="10" width="10" height="6" rx="1" ry="1" fill="${color}" />
91
+ </svg>
92
+ `;
93
+ const settingsIcon = (size = 16, color = "currentColor") => lit.html `
94
+ <svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" aria-hidden="true">
95
+ <path
96
+ d="M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"
97
+ stroke="${color}"
98
+ stroke-width="2"
99
+ stroke-linecap="round"
100
+ stroke-linejoin="round"
101
+ />
102
+ <path
103
+ d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1Z"
104
+ stroke="${color}"
105
+ stroke-width="2"
106
+ stroke-linecap="round"
107
+ stroke-linejoin="round"
108
+ />
109
+ </svg>
110
+ `;
111
+ const statsIcon = (size = 16, color = "currentColor") => lit.html `
112
+ <svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" aria-hidden="true">
113
+ <rect x="4" y="13" width="4" height="7" fill="${color}" />
114
+ <rect x="10" y="9" width="4" height="11" fill="${color}" />
115
+ <rect x="16" y="4" width="4" height="16" fill="${color}" />
116
+ </svg>
117
+ `;
118
+ const closeIcon = (size = 12, color = "currentColor") => lit.html `
119
+ <svg width="${size}" height="${size}" viewBox="0 0 12 12" fill="none" aria-hidden="true">
120
+ <path d="M9 3L3 9M3 3L9 9" stroke="${color}" stroke-width="1.5" stroke-linecap="round" />
121
+ </svg>
122
+ `;
123
+ const loopIcon = (size = 14, color = "currentColor") => lit.html `
124
+ <svg
125
+ width="${size}"
126
+ height="${size}"
127
+ viewBox="0 0 24 24"
128
+ fill="none"
129
+ stroke="${color}"
130
+ stroke-width="2"
131
+ stroke-linecap="round"
132
+ stroke-linejoin="round"
133
+ aria-hidden="true"
134
+ >
135
+ <polyline points="17 1 21 5 17 9"></polyline>
136
+ <path d="M3 11V9a4 4 0 0 1 4-4h14"></path>
137
+ <polyline points="7 23 3 19 7 15"></polyline>
138
+ <path d="M21 13v2a4 4 0 0 1-4 4H3"></path>
139
+ </svg>
140
+ `;
141
+
142
+ exports.closeIcon = closeIcon;
143
+ exports.fullscreenExitIcon = fullscreenExitIcon;
144
+ exports.fullscreenIcon = fullscreenIcon;
145
+ exports.loopIcon = loopIcon;
146
+ exports.pauseIcon = pauseIcon;
147
+ exports.pictureInPictureIcon = pictureInPictureIcon;
148
+ exports.playIcon = playIcon;
149
+ exports.settingsIcon = settingsIcon;
150
+ exports.statsIcon = statsIcon;
151
+ exports.volumeOffIcon = volumeOffIcon;
152
+ exports.volumeUpIcon = volumeUpIcon;
153
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../src/icons/index.ts"],"sourcesContent":["/**\n * SVG icons as Lit html template functions.\n * Port of Icons.tsx from player-react.\n */\nimport { html, svg, type TemplateResult } from \"lit\";\n\ntype IconTemplate = (size?: number, color?: string) => TemplateResult;\n\nexport const playIcon: IconTemplate = (size = 16, color = \"currentColor\") => html`\n <svg width=\"${size}\" height=\"${size}\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M8 5v14l11-7z\" fill=\"${color}\" />\n </svg>\n`;\n\nexport const pauseIcon: IconTemplate = (size = 16, color = \"currentColor\") => html`\n <svg width=\"${size}\" height=\"${size}\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <rect x=\"6\" y=\"4\" width=\"4\" height=\"16\" fill=\"${color}\" />\n <rect x=\"14\" y=\"4\" width=\"4\" height=\"16\" fill=\"${color}\" />\n </svg>\n`;\n\nexport const skipBackIcon: IconTemplate = (size = 16, color = \"currentColor\") => html`\n <svg width=\"${size}\" height=\"${size}\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z\"\n fill=\"${color}\"\n />\n ${svg`<text x=\"12\" y=\"15\" font-size=\"7\" font-weight=\"bold\" fill=\"${color}\" text-anchor=\"middle\">10</text>`}\n </svg>\n`;\n\nexport const skipForwardIcon: IconTemplate = (size = 16, color = \"currentColor\") => html`\n <svg width=\"${size}\" height=\"${size}\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M12 5V1l5 5-5 5V7c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6h2c0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8z\"\n fill=\"${color}\"\n />\n ${svg`<text x=\"12\" y=\"15\" font-size=\"7\" font-weight=\"bold\" fill=\"${color}\" text-anchor=\"middle\">10</text>`}\n </svg>\n`;\n\nexport const volumeUpIcon: IconTemplate = (size = 16, color = \"currentColor\") => html`\n <svg width=\"${size}\" height=\"${size}\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <polygon points=\"11,5 6,9 2,9 2,15 6,15 11,19\" fill=\"${color}\" />\n <path\n d=\"M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07\"\n stroke=\"${color}\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n`;\n\nexport const volumeOffIcon: IconTemplate = (size = 16, color = \"currentColor\") => html`\n <svg width=\"${size}\" height=\"${size}\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <polygon points=\"11,5 6,9 2,9 2,15 6,15 11,19\" fill=\"${color}\" />\n <line\n x1=\"23\"\n y1=\"9\"\n x2=\"17\"\n y2=\"15\"\n stroke=\"${color}\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n <line\n x1=\"17\"\n y1=\"9\"\n x2=\"23\"\n y2=\"15\"\n stroke=\"${color}\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n </svg>\n`;\n\nexport const fullscreenIcon: IconTemplate = (size = 16, color = \"currentColor\") => html`\n <svg width=\"${size}\" height=\"${size}\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3m8 0h3a2 2 0 0 0 2-2v-3\"\n stroke=\"${color}\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n`;\n\nexport const fullscreenExitIcon: IconTemplate = (size = 16, color = \"currentColor\") => html`\n <svg width=\"${size}\" height=\"${size}\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M8 3v3a2 2 0 0 1-2 2H3M21 8h-3a2 2 0 0 1-2-2V3M3 16h3a2 2 0 0 1 2 2v3M16 21v-3a2 2 0 0 1 2-2h3\"\n stroke=\"${color}\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n`;\n\nexport const pictureInPictureIcon: IconTemplate = (size = 16, color = \"currentColor\") => html`\n <svg width=\"${size}\" height=\"${size}\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <rect\n x=\"2\"\n y=\"3\"\n width=\"20\"\n height=\"14\"\n rx=\"2\"\n ry=\"2\"\n stroke=\"${color}\"\n stroke-width=\"2\"\n fill=\"none\"\n />\n <rect x=\"8\" y=\"10\" width=\"10\" height=\"6\" rx=\"1\" ry=\"1\" fill=\"${color}\" />\n </svg>\n`;\n\nexport const closedCaptionsIcon: IconTemplate = (size = 16, color = \"currentColor\") => html`\n <svg width=\"${size}\" height=\"${size}\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <rect\n x=\"2\"\n y=\"4\"\n width=\"20\"\n height=\"16\"\n rx=\"2\"\n ry=\"2\"\n stroke=\"${color}\"\n stroke-width=\"2\"\n fill=\"none\"\n />\n <path\n d=\"M8 10c0-.6.4-1 1-1h1c.6 0 1 .4 1 1v4c0 .6-.4 1-1 1H9c-.6 0-1-.4-1-1v-4zM14 10c0-.6.4-1 1-1h1c.6 0 1 .4 1 1v4c0 .6-.4 1-1 1h-1c-.6 0-1-.4-1-1v-4z\"\n fill=\"${color}\"\n />\n </svg>\n`;\n\nexport const liveIcon: IconTemplate = (size = 16, color = \"currentColor\") => html`\n <svg width=\"${size}\" height=\"${size}\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"3\" fill=\"${color}\" />\n <path\n d=\"M12 1v6M12 17v6M4.22 4.22l4.24 4.24M15.54 15.54l4.24 4.24M1 12h6M17 12h6M4.22 19.78l4.24-4.24M15.54 8.46l4.24-4.24\"\n stroke=\"${color}\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n </svg>\n`;\n\nexport const settingsIcon: IconTemplate = (size = 16, color = \"currentColor\") => html`\n <svg width=\"${size}\" height=\"${size}\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z\"\n stroke=\"${color}\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n <path\n d=\"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1Z\"\n stroke=\"${color}\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n`;\n\nexport const statsIcon: IconTemplate = (size = 16, color = \"currentColor\") => html`\n <svg width=\"${size}\" height=\"${size}\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <rect x=\"4\" y=\"13\" width=\"4\" height=\"7\" fill=\"${color}\" />\n <rect x=\"10\" y=\"9\" width=\"4\" height=\"11\" fill=\"${color}\" />\n <rect x=\"16\" y=\"4\" width=\"4\" height=\"16\" fill=\"${color}\" />\n </svg>\n`;\n\nexport const seekToLiveIcon: IconTemplate = (size = 16, color = \"currentColor\") => html`\n <svg width=\"${size}\" height=\"${size}\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M5 5v14l11-7z\" fill=\"${color}\" />\n <rect x=\"17\" y=\"5\" width=\"3\" height=\"14\" fill=\"${color}\" />\n </svg>\n`;\n\nexport const closeIcon: IconTemplate = (size = 12, color = \"currentColor\") => html`\n <svg width=\"${size}\" height=\"${size}\" viewBox=\"0 0 12 12\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"${color}\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </svg>\n`;\n\nexport const loopIcon: IconTemplate = (size = 14, color = \"currentColor\") => html`\n <svg\n width=\"${size}\"\n height=\"${size}\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"${color}\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <polyline points=\"17 1 21 5 17 9\"></polyline>\n <path d=\"M3 11V9a4 4 0 0 1 4-4h14\"></path>\n <polyline points=\"7 23 3 19 7 15\"></polyline>\n <path d=\"M21 13v2a4 4 0 0 1-4 4H3\"></path>\n </svg>\n`;\n"],"names":["html"],"mappings":";;;;AAAA;;;AAGG;AAKI,MAAM,QAAQ,GAAiB,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,GAAG,cAAc,KAAKA,QAAI,CAAA;AACjE,cAAA,EAAA,IAAI,aAAa,IAAI,CAAA;oCACD,KAAK,CAAA;;;AAIlC,MAAM,SAAS,GAAiB,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,GAAG,cAAc,KAAKA,QAAI,CAAA;AAClE,cAAA,EAAA,IAAI,aAAa,IAAI,CAAA;oDACe,KAAK,CAAA;qDACJ,KAAK,CAAA;;;AAwBnD,MAAM,YAAY,GAAiB,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,GAAG,cAAc,KAAKA,QAAI,CAAA;AACrE,cAAA,EAAA,IAAI,aAAa,IAAI,CAAA;2DACsB,KAAK,CAAA;;;gBAGhD,KAAK,CAAA;;;;;;;AAQd,MAAM,aAAa,GAAiB,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,GAAG,cAAc,KAAKA,QAAI,CAAA;AACtE,cAAA,EAAA,IAAI,aAAa,IAAI,CAAA;2DACsB,KAAK,CAAA;;;;;;gB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