@uibit/video 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.
- package/LICENSE +21 -0
- package/README.md +25 -0
- package/custom-elements.json +488 -0
- package/dist/frameworks/angular/index.ts +27 -0
- package/dist/frameworks/astro/index.d.ts +10 -0
- package/dist/frameworks/nuxt/index.ts +7 -0
- package/dist/frameworks/preact/index.d.ts +14 -0
- package/dist/frameworks/qwik/index.tsx +10 -0
- package/dist/frameworks/react/index.d.ts +18 -0
- package/dist/frameworks/solid/index.d.ts +15 -0
- package/dist/frameworks/stencil/index.d.ts +13 -0
- package/dist/frameworks/svelte/index.svelte +36 -0
- package/dist/frameworks/vue/index.ts +23 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.d.ts +2 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/styles.js +289 -0
- package/dist/styles.js.map +1 -0
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/video.d.ts +59 -0
- package/dist/video.d.ts.map +1 -0
- package/dist/video.js +456 -0
- package/dist/video.js.map +1 -0
- package/package.json +91 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 UIBit Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Video
|
|
2
|
+
|
|
3
|
+
[Interactive Demonstration](https://rawlings.github.io/uibit/components/video)
|
|
4
|
+
|
|
5
|
+
Video provides a customizable web component wrapper for native `<video>` elements and `<iframe>` video embeds. It replaces standard browser control interfaces with a sleek grayscale control bar featuring timeline scrubbing, volume controls, and fullscreen actions.
|
|
6
|
+
|
|
7
|
+
## Value Delivery
|
|
8
|
+
|
|
9
|
+
- **Unified Aesthetics** – Wraps both native video files and third-party iframe embeds (e.g. YouTube or Vimeo) under a single, cohesive design style.
|
|
10
|
+
- **Enhanced Overlay Interaction** – Displays a custom poster preview and circular play button that transitions to live playback on user interaction.
|
|
11
|
+
- **Accessible Controls** – Implements responsive keyboard navigation for playback control, volume adjusting, and fullscreen triggers.
|
|
12
|
+
|
|
13
|
+
## Ideal Applications
|
|
14
|
+
|
|
15
|
+
- **Product Showcases** – High-resolution feature clips, animations, and video hero slots.
|
|
16
|
+
- **Case Studies & Testimonials** – Client interviews or background reviews hosted on third-party video networks.
|
|
17
|
+
- **Tutorials & Guides** – Embedded step-by-step videos inside help files or documentation articles.
|
|
18
|
+
|
|
19
|
+
## Further Information
|
|
20
|
+
|
|
21
|
+
Detailed design guidelines, customizable attributes, and integration examples are available on our documentation site.
|
|
22
|
+
|
|
23
|
+
## Changelog
|
|
24
|
+
|
|
25
|
+
Please see the [Changelog](CHANGELOG.md) for version history.
|
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0.0",
|
|
3
|
+
"readme": "",
|
|
4
|
+
"modules": [
|
|
5
|
+
{
|
|
6
|
+
"kind": "javascript-module",
|
|
7
|
+
"path": "src/index.ts",
|
|
8
|
+
"declarations": [],
|
|
9
|
+
"exports": [
|
|
10
|
+
{
|
|
11
|
+
"kind": "js",
|
|
12
|
+
"name": "default",
|
|
13
|
+
"declaration": {
|
|
14
|
+
"name": "default",
|
|
15
|
+
"module": "./video"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"kind": "js",
|
|
20
|
+
"name": "Video",
|
|
21
|
+
"declaration": {
|
|
22
|
+
"name": "Video",
|
|
23
|
+
"module": "./video"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"kind": "js",
|
|
28
|
+
"name": "*",
|
|
29
|
+
"declaration": {
|
|
30
|
+
"name": "*",
|
|
31
|
+
"module": "src/types"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"kind": "javascript-module",
|
|
38
|
+
"path": "src/styles.ts",
|
|
39
|
+
"declarations": [
|
|
40
|
+
{
|
|
41
|
+
"kind": "variable",
|
|
42
|
+
"name": "styles",
|
|
43
|
+
"default": "css` :host { display: block; width: 100%; font-size: var(--uibit-video-font-size, var(--uibit-font-size-sm, 0.875rem)); font-family: var(--uibit-video-font-family, inherit); --uibit-video-radius: 0; --uibit-video-bg: #000000; --uibit-video-focus-color: #ffffff; --uibit-video-control-color: #ffffff; } .player-container { position: relative; width: 100%; overflow: hidden; background-color: var(--uibit-video-bg); border-radius: var(--uibit-video-radius); aspect-ratio: 16 / 9; user-select: none; outline: none; } .player-container:focus-visible { outline: 0.125rem solid var(--uibit-video-focus-color); outline-offset: 0.125rem; } ::slotted(video) { width: 100%; height: 100%; object-fit: contain; display: block; } ::slotted(iframe) { width: 100%; height: 100%; border: 0; display: block; } .iframe-container { width: 100%; height: 100%; } /* ── Overlay / Poster ────────────────────────────────────────── */ .poster-overlay { position: absolute; inset: 0; background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; z-index: 10; transition: opacity 0.3s ease; } /* Premium play button - circular, translucent white background with blur and cut-out see-through play icon */ .center-play-btn { position: relative; z-index: 11; width: 4.5rem; height: 4.5rem; border-radius: 9999px; background: rgba(255, 255, 255, 0.75); backdrop-filter: blur(0.5rem); -webkit-backdrop-filter: blur(0.5rem); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: none; opacity: 0.9; transition: opacity 0.2s ease, background-color 0.2s ease; /* Mask out the play icon so it is see-through */ mask: url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><mask id='m'><rect x='0' y='0' width='100' height='100' fill='white'/><polygon points='38,28 75,50 38,72' fill='black'/></mask><circle cx='50' cy='50' r='50' fill='white' mask='url(%23m)'/></svg>\") no-repeat center / contain; -webkit-mask: url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><mask id='m'><rect x='0' y='0' width='100' height='100' fill='white'/><polygon points='38,28 75,50 38,72' fill='black'/></mask><circle cx='50' cy='50' r='50' fill='white' mask='url(%23m)'/></svg>\") no-repeat center / contain; } .center-play-btn:hover { opacity: 1; background: rgba(255, 255, 255, 0.9); } .center-play-btn:active { opacity: 0.8; } /* ── Minimal Single-Row Controls Bar ────────────────────────── */ .controls-bar { position: absolute; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent); /* Vignette gradient */ padding: 1.25rem 1.5rem; color: var(--uibit-video-control-color); opacity: 0; transition: opacity 0.2s ease; } /* Show controls on hover, focus, or when paused */ .player-container:hover .controls-bar, .player-container:focus-within .controls-bar, .player-container.paused .controls-bar, .player-container.seeking .controls-bar { opacity: 1; } .control-btn { background: transparent; border: none; color: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; width: 2.5rem; /* Larger hit target (40px) */ height: 2.5rem; /* Larger hit target (40px) */ padding: 0; opacity: 0.8; transition: transform 0.2s ease, opacity 0.2s ease; } .control-btn:hover { opacity: 1; transform: scale(1.05); } .control-btn:active { transform: scale(0.95); } .control-btn:focus-visible { outline: 0.125rem solid #ffffff; } .control-btn svg { width: 1.125rem; height: 1.125rem; } .time-display { font-size: 0.75rem; font-variant-numeric: tabular-nums; font-weight: 500; opacity: 0.9; white-space: nowrap; } /* ── Timeline (Flex-Grow) ────────────────────────────────────── */ .timeline-container { flex-grow: 1; height: 2rem; /* Larger hit target (32px height) */ display: flex; align-items: center; cursor: pointer; position: relative; } .timeline-bar { width: 100%; height: 0.125rem; /* Ultra thin line */ background: rgba(255, 255, 255, 0.25); position: relative; transition: height 0.15s ease; } .timeline-container:hover .timeline-bar { height: 0.25rem; } .timeline-progress { height: 100%; background: #ffffff; position: absolute; left: 0; top: 0; } /* Handle is circular, borderless, shadowless */ .timeline-handle { width: 0.625rem; height: 0.625rem; border-radius: 9999px; background: #ffffff; position: absolute; top: 50%; transform: translate(-50%, -50%) scale(0); transition: transform 0.15s ease; box-shadow: none; border: none; } .timeline-container:hover .timeline-handle, .timeline-container:active .timeline-handle { transform: translate(-50%, -50%) scale(1); } /* ── Volume Slider ───────────────────────────────────────────── */ .volume-container { display: flex; align-items: center; gap: 0.5rem; } .volume-slider-wrap { width: 0; overflow: hidden; height: 2rem; /* Matches button height for hit alignment */ display: flex; align-items: center; transition: width 0.2s ease; } .volume-container:hover .volume-slider-wrap { width: 3.5rem; } .volume-slider-container { width: 100%; height: 2rem; /* Larger hit target (32px height) */ display: flex; align-items: center; cursor: pointer; position: relative; outline: none; padding: 0 0.3125rem; /* Inset track slightly so the handle does not clip on the edges */ box-sizing: border-box; } .volume-slider-bar { width: 100%; height: 0.125rem; /* Ultra thin line */ background: rgba(255, 255, 255, 0.25); position: relative; transition: height 0.15s ease; } .volume-container:hover .volume-slider-bar, .volume-slider-container:hover .volume-slider-bar { height: 0.25rem; } .volume-slider-progress { height: 100%; background: #ffffff; position: absolute; left: 0; top: 0; } .volume-slider-handle { width: 0.625rem; height: 0.625rem; border-radius: 9999px; background: #ffffff; position: absolute; top: 50%; transform: translate(-50%, -50%) scale(0); transition: transform 0.15s ease; box-shadow: none; border: none; } .volume-container:hover .volume-slider-handle { transform: translate(-50%, -50%) scale(1); } /* Hide raw slots */ .hidden-slot-wrap { display: none; } `"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"exports": [
|
|
47
|
+
{
|
|
48
|
+
"kind": "js",
|
|
49
|
+
"name": "styles",
|
|
50
|
+
"declaration": {
|
|
51
|
+
"name": "styles",
|
|
52
|
+
"module": "src/styles.ts"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"kind": "javascript-module",
|
|
59
|
+
"path": "src/types.ts",
|
|
60
|
+
"declarations": [],
|
|
61
|
+
"exports": []
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"kind": "javascript-module",
|
|
65
|
+
"path": "src/video.ts",
|
|
66
|
+
"declarations": [
|
|
67
|
+
{
|
|
68
|
+
"kind": "class",
|
|
69
|
+
"description": "Enhanced custom video component that wraps a native `<video>` or `<iframe>` element.\nProvides custom interactive player controls with Scandinavian design aesthetics.",
|
|
70
|
+
"name": "Video",
|
|
71
|
+
"cssProperties": [
|
|
72
|
+
{
|
|
73
|
+
"description": "Border radius of the video player.",
|
|
74
|
+
"name": "--uibit-video-radius",
|
|
75
|
+
"default": "0.5rem"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"description": "Background color of the video player.",
|
|
79
|
+
"name": "--uibit-video-bg",
|
|
80
|
+
"default": "#000000"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"description": "Focus outline color.",
|
|
84
|
+
"name": "--uibit-video-focus-color",
|
|
85
|
+
"default": "#000000"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"description": "Background of the control bar.",
|
|
89
|
+
"name": "--uibit-video-control-bg",
|
|
90
|
+
"default": "rgba(17, 24, 39, 0.85)"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"description": "Border of the control bar.",
|
|
94
|
+
"name": "--uibit-video-control-border",
|
|
95
|
+
"default": "rgba(255, 255, 255, 0.1)"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"description": "Color of icons and text.",
|
|
99
|
+
"name": "--uibit-video-control-color",
|
|
100
|
+
"default": "#ffffff"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"slots": [
|
|
104
|
+
{
|
|
105
|
+
"description": "The default slot where the native `<video>` or `<iframe>` element is placed.",
|
|
106
|
+
"name": ""
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"members": [
|
|
110
|
+
{
|
|
111
|
+
"kind": "field",
|
|
112
|
+
"name": "poster",
|
|
113
|
+
"type": {
|
|
114
|
+
"text": "string"
|
|
115
|
+
},
|
|
116
|
+
"default": "''",
|
|
117
|
+
"description": "Poster image URL. Also used as background for iframes before playing.",
|
|
118
|
+
"attribute": "poster"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"kind": "field",
|
|
122
|
+
"name": "controls",
|
|
123
|
+
"type": {
|
|
124
|
+
"text": "boolean"
|
|
125
|
+
},
|
|
126
|
+
"default": "true",
|
|
127
|
+
"description": "Show player controls.",
|
|
128
|
+
"attribute": "controls"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"kind": "field",
|
|
132
|
+
"name": "_isPlaying",
|
|
133
|
+
"type": {
|
|
134
|
+
"text": "boolean"
|
|
135
|
+
},
|
|
136
|
+
"privacy": "private",
|
|
137
|
+
"default": "false"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"kind": "field",
|
|
141
|
+
"name": "_currentTime",
|
|
142
|
+
"type": {
|
|
143
|
+
"text": "number"
|
|
144
|
+
},
|
|
145
|
+
"privacy": "private",
|
|
146
|
+
"default": "0"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"kind": "field",
|
|
150
|
+
"name": "_duration",
|
|
151
|
+
"type": {
|
|
152
|
+
"text": "number"
|
|
153
|
+
},
|
|
154
|
+
"privacy": "private",
|
|
155
|
+
"default": "0"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"kind": "field",
|
|
159
|
+
"name": "_volume",
|
|
160
|
+
"type": {
|
|
161
|
+
"text": "number"
|
|
162
|
+
},
|
|
163
|
+
"privacy": "private",
|
|
164
|
+
"default": "1"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"kind": "field",
|
|
168
|
+
"name": "_isMuted",
|
|
169
|
+
"type": {
|
|
170
|
+
"text": "boolean"
|
|
171
|
+
},
|
|
172
|
+
"privacy": "private",
|
|
173
|
+
"default": "false"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"kind": "field",
|
|
177
|
+
"name": "_isFullscreen",
|
|
178
|
+
"type": {
|
|
179
|
+
"text": "boolean"
|
|
180
|
+
},
|
|
181
|
+
"privacy": "private",
|
|
182
|
+
"default": "false"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"kind": "field",
|
|
186
|
+
"name": "_isSeeking",
|
|
187
|
+
"type": {
|
|
188
|
+
"text": "boolean"
|
|
189
|
+
},
|
|
190
|
+
"privacy": "private",
|
|
191
|
+
"default": "false"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"kind": "field",
|
|
195
|
+
"name": "_isVolumeSeeking",
|
|
196
|
+
"type": {
|
|
197
|
+
"text": "boolean"
|
|
198
|
+
},
|
|
199
|
+
"privacy": "private",
|
|
200
|
+
"default": "false"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"kind": "field",
|
|
204
|
+
"name": "_isIframeMode",
|
|
205
|
+
"type": {
|
|
206
|
+
"text": "boolean"
|
|
207
|
+
},
|
|
208
|
+
"privacy": "private",
|
|
209
|
+
"default": "false"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"kind": "field",
|
|
213
|
+
"name": "_iframePlaying",
|
|
214
|
+
"type": {
|
|
215
|
+
"text": "boolean"
|
|
216
|
+
},
|
|
217
|
+
"privacy": "private",
|
|
218
|
+
"default": "false"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"kind": "field",
|
|
222
|
+
"name": "_containerEl",
|
|
223
|
+
"type": {
|
|
224
|
+
"text": "HTMLElement | undefined"
|
|
225
|
+
},
|
|
226
|
+
"privacy": "private"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"kind": "field",
|
|
230
|
+
"name": "_videoEl",
|
|
231
|
+
"type": {
|
|
232
|
+
"text": "HTMLVideoElement | null"
|
|
233
|
+
},
|
|
234
|
+
"privacy": "private",
|
|
235
|
+
"default": "null"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"kind": "field",
|
|
239
|
+
"name": "_iframeEl",
|
|
240
|
+
"type": {
|
|
241
|
+
"text": "HTMLIFrameElement | null"
|
|
242
|
+
},
|
|
243
|
+
"privacy": "private",
|
|
244
|
+
"default": "null"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"kind": "method",
|
|
248
|
+
"name": "_detectSlottedElements",
|
|
249
|
+
"privacy": "private"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"kind": "method",
|
|
253
|
+
"name": "_setupVideoListeners",
|
|
254
|
+
"privacy": "private"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"kind": "method",
|
|
258
|
+
"name": "_onSlotChange",
|
|
259
|
+
"privacy": "private"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"kind": "method",
|
|
263
|
+
"name": "togglePlay"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"kind": "method",
|
|
267
|
+
"name": "_playIframe",
|
|
268
|
+
"privacy": "private"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"kind": "method",
|
|
272
|
+
"name": "toggleMute"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"kind": "method",
|
|
276
|
+
"name": "_onVolumePointerDown",
|
|
277
|
+
"privacy": "private",
|
|
278
|
+
"parameters": [
|
|
279
|
+
{
|
|
280
|
+
"name": "e",
|
|
281
|
+
"type": {
|
|
282
|
+
"text": "PointerEvent"
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
]
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"kind": "method",
|
|
289
|
+
"name": "_onVolumePointerMove",
|
|
290
|
+
"privacy": "private",
|
|
291
|
+
"parameters": [
|
|
292
|
+
{
|
|
293
|
+
"name": "e",
|
|
294
|
+
"type": {
|
|
295
|
+
"text": "PointerEvent"
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
]
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"kind": "method",
|
|
302
|
+
"name": "_onVolumePointerUp",
|
|
303
|
+
"privacy": "private",
|
|
304
|
+
"parameters": [
|
|
305
|
+
{
|
|
306
|
+
"name": "e",
|
|
307
|
+
"type": {
|
|
308
|
+
"text": "PointerEvent"
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
]
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"kind": "method",
|
|
315
|
+
"name": "_updateVolumeFromEvent",
|
|
316
|
+
"privacy": "private",
|
|
317
|
+
"parameters": [
|
|
318
|
+
{
|
|
319
|
+
"name": "e",
|
|
320
|
+
"type": {
|
|
321
|
+
"text": "PointerEvent"
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
]
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"kind": "method",
|
|
328
|
+
"name": "toggleFullscreen"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"kind": "method",
|
|
332
|
+
"name": "_onFullscreenChange",
|
|
333
|
+
"privacy": "private"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"kind": "method",
|
|
337
|
+
"name": "_onTimelinePointerDown",
|
|
338
|
+
"privacy": "private",
|
|
339
|
+
"parameters": [
|
|
340
|
+
{
|
|
341
|
+
"name": "e",
|
|
342
|
+
"type": {
|
|
343
|
+
"text": "PointerEvent"
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
]
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"kind": "method",
|
|
350
|
+
"name": "_onTimelinePointerMove",
|
|
351
|
+
"privacy": "private",
|
|
352
|
+
"parameters": [
|
|
353
|
+
{
|
|
354
|
+
"name": "e",
|
|
355
|
+
"type": {
|
|
356
|
+
"text": "PointerEvent"
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
]
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"kind": "method",
|
|
363
|
+
"name": "_onTimelinePointerUp",
|
|
364
|
+
"privacy": "private",
|
|
365
|
+
"parameters": [
|
|
366
|
+
{
|
|
367
|
+
"name": "e",
|
|
368
|
+
"type": {
|
|
369
|
+
"text": "PointerEvent"
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
]
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"kind": "method",
|
|
376
|
+
"name": "_updateTimelineFromEvent",
|
|
377
|
+
"privacy": "private",
|
|
378
|
+
"parameters": [
|
|
379
|
+
{
|
|
380
|
+
"name": "e",
|
|
381
|
+
"type": {
|
|
382
|
+
"text": "PointerEvent"
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
]
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"kind": "method",
|
|
389
|
+
"name": "_onKeyDown",
|
|
390
|
+
"privacy": "private",
|
|
391
|
+
"parameters": [
|
|
392
|
+
{
|
|
393
|
+
"name": "e",
|
|
394
|
+
"type": {
|
|
395
|
+
"text": "KeyboardEvent"
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
]
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"kind": "method",
|
|
402
|
+
"name": "_formatTime",
|
|
403
|
+
"privacy": "private",
|
|
404
|
+
"return": {
|
|
405
|
+
"type": {
|
|
406
|
+
"text": "string"
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
"parameters": [
|
|
410
|
+
{
|
|
411
|
+
"name": "sec",
|
|
412
|
+
"type": {
|
|
413
|
+
"text": "number"
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
]
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"kind": "method",
|
|
420
|
+
"name": "_onPlayerClick",
|
|
421
|
+
"privacy": "private",
|
|
422
|
+
"parameters": [
|
|
423
|
+
{
|
|
424
|
+
"name": "e",
|
|
425
|
+
"type": {
|
|
426
|
+
"text": "MouseEvent"
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
]
|
|
430
|
+
}
|
|
431
|
+
],
|
|
432
|
+
"attributes": [
|
|
433
|
+
{
|
|
434
|
+
"name": "poster",
|
|
435
|
+
"type": {
|
|
436
|
+
"text": "string"
|
|
437
|
+
},
|
|
438
|
+
"default": "''",
|
|
439
|
+
"description": "Poster image URL. Also used as background for iframes before playing.",
|
|
440
|
+
"fieldName": "poster"
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"name": "controls",
|
|
444
|
+
"type": {
|
|
445
|
+
"text": "boolean"
|
|
446
|
+
},
|
|
447
|
+
"default": "true",
|
|
448
|
+
"description": "Show player controls.",
|
|
449
|
+
"fieldName": "controls"
|
|
450
|
+
}
|
|
451
|
+
],
|
|
452
|
+
"superclass": {
|
|
453
|
+
"name": "UIBitElement",
|
|
454
|
+
"package": "@uibit/core"
|
|
455
|
+
},
|
|
456
|
+
"tagName": "uibit-video",
|
|
457
|
+
"customElement": true
|
|
458
|
+
}
|
|
459
|
+
],
|
|
460
|
+
"exports": [
|
|
461
|
+
{
|
|
462
|
+
"kind": "js",
|
|
463
|
+
"name": "Video",
|
|
464
|
+
"declaration": {
|
|
465
|
+
"name": "Video",
|
|
466
|
+
"module": "src/video.ts"
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"kind": "custom-element-definition",
|
|
471
|
+
"name": "uibit-video",
|
|
472
|
+
"declaration": {
|
|
473
|
+
"name": "Video",
|
|
474
|
+
"module": "src/video.ts"
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"kind": "js",
|
|
479
|
+
"name": "default",
|
|
480
|
+
"declaration": {
|
|
481
|
+
"name": "Video",
|
|
482
|
+
"module": "src/video.ts"
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
]
|
|
486
|
+
}
|
|
487
|
+
]
|
|
488
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Component, ChangeDetectionStrategy, ElementRef, input, effect, booleanAttribute } from '@angular/core';
|
|
2
|
+
import '@uibit/video';
|
|
3
|
+
import type { Video as HTMLElementClass } from '@uibit/video';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'uibit-video',
|
|
7
|
+
template: '<ng-content></ng-content>',
|
|
8
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9
|
+
standalone: true
|
|
10
|
+
})
|
|
11
|
+
export class NgxVideo {
|
|
12
|
+
constructor(private el: ElementRef<HTMLElementClass>) {
|
|
13
|
+
effect(() => {
|
|
14
|
+
if (this.el.nativeElement) {
|
|
15
|
+
this.el.nativeElement.poster = this.poster();
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
effect(() => {
|
|
19
|
+
if (this.el.nativeElement) {
|
|
20
|
+
this.el.nativeElement.controls = this.controls();
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
readonly poster = input<string, any>('');
|
|
26
|
+
readonly controls = input<boolean, any>(true, { transform: booleanAttribute });
|
|
27
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { JSX } from 'preact';
|
|
2
|
+
import type { Video as HTMLElementClass } from '@uibit/video';
|
|
3
|
+
import '@uibit/video';
|
|
4
|
+
|
|
5
|
+
declare module 'preact' {
|
|
6
|
+
namespace JSX {
|
|
7
|
+
interface IntrinsicElements {
|
|
8
|
+
'uibit-video': JSX.HTMLAttributes<HTMLElementClass> & {
|
|
9
|
+
poster?: string;
|
|
10
|
+
controls?: boolean;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { HTMLAttributes, ClassAttributes } from 'react';
|
|
2
|
+
import type { Video as HTMLElementClass } from '@uibit/video';
|
|
3
|
+
import '@uibit/video';
|
|
4
|
+
|
|
5
|
+
declare global {
|
|
6
|
+
namespace React {
|
|
7
|
+
namespace JSX {
|
|
8
|
+
interface IntrinsicElements {
|
|
9
|
+
'uibit-video': ClassAttributes<HTMLElementClass> & HTMLAttributes<HTMLElementClass> & {
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
class?: string;
|
|
12
|
+
poster?: string;
|
|
13
|
+
controls?: boolean;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { JSX } from 'solid-js';
|
|
2
|
+
import type { Video as HTMLElementClass } from '@uibit/video';
|
|
3
|
+
import '@uibit/video';
|
|
4
|
+
|
|
5
|
+
declare module 'solid-js' {
|
|
6
|
+
namespace JSX {
|
|
7
|
+
interface IntrinsicElements {
|
|
8
|
+
'uibit-video': Partial<HTMLElementClass> & JSX.HTMLAttributes<HTMLElementClass> & {
|
|
9
|
+
poster?: string;
|
|
10
|
+
controls?: boolean;
|
|
11
|
+
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Video as HTMLElementClass } from '@uibit/video';
|
|
2
|
+
import '@uibit/video';
|
|
3
|
+
|
|
4
|
+
declare module '@stencil/core' {
|
|
5
|
+
export namespace JSX {
|
|
6
|
+
interface IntrinsicElements {
|
|
7
|
+
'uibit-video': HTMLElementClass & {
|
|
8
|
+
poster?: string;
|
|
9
|
+
controls?: boolean;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|