@gjsify/video 0.1.15 → 0.2.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.
@@ -1,58 +1,81 @@
1
1
  import GObject from 'gi://GObject';
2
2
  import GLib from 'gi://GLib?version=2.0';
3
3
  import Gtk from 'gi://Gtk?version=4.0';
4
- import { HTMLVideoElement } from '@gjsify/dom-elements';
4
+ import type Gst from 'gi://Gst?version=1.0';
5
5
  import { BridgeEnvironment } from '@gjsify/bridge-types';
6
+ import { HTMLVideoElement } from '@gjsify/dom-elements';
6
7
  type VideoReadyCallback = (video: globalThis.HTMLVideoElement) => void;
7
8
  /**
8
- * A `Gtk.Box` subclass that hosts a `Gtk.Picture` for video rendering:
9
- * - Creates an `HTMLVideoElement` on construction
10
- * - Renders video via GStreamer `gtk4paintablesink` `Gdk.Paintable` `Gtk.Picture`
11
- * - Supports `video.srcObject = mediaStream` (from getUserMedia/WebRTC)
12
- * - Supports `video.src = "file:///..."` (URI playback via playbin)
13
- * - Fires `onReady()` callbacks with the HTMLVideoElement
14
- * - `installGlobals()` sets `globalThis.HTMLVideoElement`
9
+ * A `Gtk.Box` subclass that hosts a `Gtk.Picture` for video rendering.
10
+ *
11
+ * - Owns an `HTMLVideoElement` whose DOM API is wired to GStreamer
12
+ * - Renders video via `gtk4paintablesink` `Gdk.Paintable` → `Gtk.Picture`
13
+ * - Supports `video.srcObject = mediaStream` (getUserMedia / WebRTC)
14
+ * - Supports `video.src = 'file://…'` or HTTP URL (URI playback via playbin)
15
+ * - `onReady(cb)` fires with the HTMLVideoElement when the widget realizes
16
+ * - `showControls(true)` appends a play/pause + seek + time + volume bar
15
17
  *
16
- * Usage:
17
18
  * ```ts
18
19
  * const bridge = new VideoBridge();
19
- * bridge.installGlobals();
20
- * bridge.onReady((video) => {
21
- * video.srcObject = mediaStream; // from getUserMedia
22
- * });
20
+ * bridge.showControls(true);
21
+ * bridge.onReady((video) => { video.src = 'https://example.com/video.mp4'; });
23
22
  * window.set_child(bridge);
24
23
  * ```
25
24
  */
26
25
  export declare const VideoBridge: {
27
26
  new (params?: Partial<Gtk.Box.ConstructorProps>): {
27
+ _overlay: Gtk.Overlay;
28
28
  _picture: Gtk.Picture;
29
29
  _video: HTMLVideoElement;
30
- _pipeline: any | null;
31
- _readyCallbacks: VideoReadyCallback[];
32
- _resizeCallbacks: ((w: number, h: number) => void)[];
33
30
  _environment: BridgeEnvironment;
34
31
  _timeOrigin: number;
32
+ _pipeline: Gst.Pipeline | null;
33
+ _pipelineBus: Gst.Bus | null;
34
+ _pipelineBusHandlers: number[];
35
+ _readyCallbacks: VideoReadyCallback[];
36
+ _resizeCallbacks: ((w: number, h: number) => void)[];
35
37
  _ready: boolean;
36
- /** The HTMLVideoElement backing this bridge. */
38
+ _controls: {
39
+ bar: Gtk.Box;
40
+ playBtn: Gtk.Button;
41
+ seekAdj: Gtk.Adjustment;
42
+ seekScale: Gtk.Scale;
43
+ timeLabel: Gtk.Label;
44
+ volumeBtn: Gtk.VolumeButton;
45
+ lastSeekValue: number;
46
+ lastTimeText: string;
47
+ } | null;
48
+ _positionTimerId: number | null;
49
+ _updatingFromTimer: boolean;
50
+ _hideTimerId: number | null;
37
51
  get element(): HTMLVideoElement;
38
- /** Alias for element — matches browser naming. */
39
52
  get videoElement(): HTMLVideoElement;
40
- /** The isolated browser environment for this bridge. */
41
53
  get environment(): BridgeEnvironment;
42
- /**
43
- * Register a callback to be invoked once the video element is ready.
44
- * If already ready, the callback fires synchronously.
45
- */
46
54
  onReady(cb: VideoReadyCallback): void;
47
- /** Register a callback invoked whenever the widget is resized. */
48
55
  onResize(cb: (width: number, height: number) => void): void;
49
- /** Sets browser globals for video support. */
50
56
  installGlobals(): void;
51
- /** @internal Handle srcObject change (MediaStream) */
57
+ /**
58
+ * Show or hide the built-in play/pause + seek + time + volume control bar.
59
+ * Controls auto-hide after 2 seconds of mouse inactivity.
60
+ */
61
+ showControls(show?: boolean): void;
62
+ _setupAutoHideMotion(controlBar: Gtk.Box): void;
63
+ _revealControls(): void;
64
+ _buildControlBar(): NonNullable<{
65
+ bar: Gtk.Box;
66
+ playBtn: Gtk.Button;
67
+ seekAdj: Gtk.Adjustment;
68
+ seekScale: Gtk.Scale;
69
+ timeLabel: Gtk.Label;
70
+ volumeBtn: Gtk.VolumeButton;
71
+ lastSeekValue: number;
72
+ lastTimeText: string;
73
+ } | null>;
74
+ _startPositionTimer(): void;
75
+ _stopPositionTimer(): void;
52
76
  _onSrcObjectChange(): void;
53
- /** @internal Handle src change (URI) */
54
77
  _onSrcChange(): void;
55
- /** @internal Tear down the GStreamer pipeline */
78
+ _attachPipeline(pipeline: Gst.Pipeline, paintable: Parameters<Gtk.Picture["set_paintable"]>[0]): void;
56
79
  _destroyPipeline(): void;
57
80
  get baseline_child(): number;
58
81
  set baseline_child(val: number);
@@ -79,10 +102,10 @@ export declare const VideoBridge: {
79
102
  get_baseline_position(): Gtk.BaselinePosition;
80
103
  get_homogeneous(): boolean;
81
104
  get_spacing(): number;
82
- insert_child_after(child: Gtk.Widget, sibling?: Gtk.Widget | null): void;
105
+ insert_child_after(child: Gtk.Widget, sibling: (Gtk.Widget | null)): void;
83
106
  prepend(child: Gtk.Widget): void;
84
107
  remove(child: Gtk.Widget): void;
85
- reorder_child_after(child: Gtk.Widget, sibling?: Gtk.Widget | null): void;
108
+ reorder_child_after(child: Gtk.Widget, sibling: (Gtk.Widget | null)): void;
86
109
  set_baseline_child(child: number): void;
87
110
  set_baseline_position(position: Gtk.BaselinePosition): void;
88
111
  set_homogeneous(homogeneous: boolean): void;
@@ -94,35 +117,35 @@ export declare const VideoBridge: {
94
117
  get orientation(): Gtk.Orientation;
95
118
  set orientation(val: Gtk.Orientation);
96
119
  announce(message: string, priority: Gtk.AccessibleAnnouncementPriority): void;
97
- get_accessible_id(): string | null;
98
- get_accessible_parent(): Gtk.Accessible | null;
120
+ get_accessible_id(): (string | null);
121
+ get_accessible_parent(): (Gtk.Accessible | null);
99
122
  get_accessible_role(): Gtk.AccessibleRole;
100
123
  get_at_context(): Gtk.ATContext;
101
124
  get_bounds(): [boolean, number, number, number, number];
102
- get_first_accessible_child(): Gtk.Accessible | null;
103
- get_next_accessible_sibling(): Gtk.Accessible | null;
125
+ get_first_accessible_child(): (Gtk.Accessible | null);
126
+ get_next_accessible_sibling(): (Gtk.Accessible | null);
104
127
  get_platform_state(state: Gtk.AccessiblePlatformState): boolean;
105
128
  reset_property(property: Gtk.AccessibleProperty): void;
106
129
  reset_relation(relation: Gtk.AccessibleRelation): void;
107
130
  reset_state(state: Gtk.AccessibleState): void;
108
- set_accessible_parent(parent?: Gtk.Accessible | null, next_sibling?: Gtk.Accessible | null): void;
109
- update_next_accessible_sibling(new_sibling?: Gtk.Accessible | null): void;
131
+ set_accessible_parent(parent: (Gtk.Accessible | null), next_sibling: (Gtk.Accessible | null)): void;
132
+ update_next_accessible_sibling(new_sibling: (Gtk.Accessible | null)): void;
110
133
  update_platform_state(state: Gtk.AccessiblePlatformState): void;
111
134
  update_property(properties: Gtk.AccessibleProperty[], values: (GObject.Value | any)[]): void;
112
135
  update_relation(relations: Gtk.AccessibleRelation[], values: (GObject.Value | any)[]): void;
113
136
  update_state(states: Gtk.AccessibleState[], values: (GObject.Value | any)[]): void;
114
- vfunc_get_accessible_id(): string | null;
115
- vfunc_get_accessible_parent(): Gtk.Accessible | null;
116
- vfunc_get_at_context(): Gtk.ATContext | null;
137
+ vfunc_get_accessible_id(): (string | null);
138
+ vfunc_get_accessible_parent(): (Gtk.Accessible | null);
139
+ vfunc_get_at_context(): (Gtk.ATContext | null);
117
140
  vfunc_get_bounds(): [boolean, number, number, number, number];
118
- vfunc_get_first_accessible_child(): Gtk.Accessible | null;
119
- vfunc_get_next_accessible_sibling(): Gtk.Accessible | null;
141
+ vfunc_get_first_accessible_child(): (Gtk.Accessible | null);
142
+ vfunc_get_next_accessible_sibling(): (Gtk.Accessible | null);
120
143
  vfunc_get_platform_state(state: Gtk.AccessiblePlatformState): boolean;
121
- get_buildable_id(): string | null;
122
- vfunc_add_child(builder: Gtk.Builder, child: GObject.Object, type?: string | null): void;
123
- vfunc_custom_finished(builder: Gtk.Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
124
- vfunc_custom_tag_end(builder: Gtk.Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
125
- vfunc_custom_tag_start(builder: Gtk.Builder, child: GObject.Object | null, tagname: string): [boolean, Gtk.BuildableParser, any];
144
+ get_buildable_id(): (string | null);
145
+ vfunc_add_child(builder: Gtk.Builder, child: GObject.Object, type: (string | null)): void;
146
+ vfunc_custom_finished(builder: Gtk.Builder, child: (GObject.Object | null), tagname: string, data: (any | null)): void;
147
+ vfunc_custom_tag_end(builder: Gtk.Builder, child: (GObject.Object | null), tagname: string, data: (any | null)): void;
148
+ vfunc_custom_tag_start(builder: Gtk.Builder, child: (GObject.Object | null), tagname: string): [boolean, Gtk.BuildableParser, any];
126
149
  vfunc_get_id(): string;
127
150
  vfunc_get_internal_child<T = GObject.Object>(builder: Gtk.Builder, childname: string): T;
128
151
  vfunc_parser_finished(builder: Gtk.Builder): void;
@@ -130,42 +153,6 @@ export declare const VideoBridge: {
130
153
  vfunc_set_id(id: string): void;
131
154
  get_orientation(): Gtk.Orientation;
132
155
  set_orientation(orientation: Gtk.Orientation): void;
133
- bind_property(source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags): GObject.Binding;
134
- bind_property_full(source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags, transform_to?: GObject.BindingTransformFunc | null, transform_from?: GObject.BindingTransformFunc | null, notify?: GLib.DestroyNotify | null): GObject.Binding;
135
- bind_property_full(...args: never[]): any;
136
- force_floating(): void;
137
- freeze_notify(): void;
138
- get_data(key: string): any | null;
139
- get_property(property_name: string, value: GObject.Value | any): any;
140
- get_qdata(quark: GLib.Quark): any | null;
141
- getv(names: string[], values: (GObject.Value | any)[]): void;
142
- is_floating(): boolean;
143
- notify(property_name: string): void;
144
- notify_by_pspec(pspec: GObject.ParamSpec): void;
145
- ref(): GObject.Object;
146
- ref_sink(): GObject.Object;
147
- run_dispose(): void;
148
- set_data(key: string, data?: any | null): void;
149
- set_property(property_name: string, value: GObject.Value | any): void;
150
- steal_data(key: string): any | null;
151
- steal_qdata(quark: GLib.Quark): any | null;
152
- thaw_notify(): void;
153
- unref(): void;
154
- watch_closure(closure: GObject.Closure): void;
155
- vfunc_constructed(): void;
156
- vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
157
- vfunc_dispose(): void;
158
- vfunc_finalize(): void;
159
- vfunc_get_property(property_id: number, value: unknown, pspec: GObject.ParamSpec): void;
160
- vfunc_notify(pspec: GObject.ParamSpec): void;
161
- vfunc_set_property(property_id: number, value: unknown, pspec: GObject.ParamSpec): void;
162
- disconnect(id: number): void;
163
- set(properties: {
164
- [key: string]: any;
165
- }): void;
166
- block_signal_handler(id: number): void;
167
- unblock_signal_handler(id: number): void;
168
- stop_emission_by_name(detailedName: string): void;
169
156
  get can_focus(): boolean;
170
157
  set can_focus(val: boolean);
171
158
  get canFocus(): boolean;
@@ -180,8 +167,8 @@ export declare const VideoBridge: {
180
167
  set cssClasses(val: string[]);
181
168
  get css_name(): string;
182
169
  get cssName(): string;
183
- get cursor(): import("@girs/gdk-4.0").default.Cursor;
184
- set cursor(val: import("@girs/gdk-4.0").default.Cursor);
170
+ get cursor(): (import("@girs/gdk-4.0").default.Cursor | null);
171
+ set cursor(val: (import("@girs/gdk-4.0").default.Cursor | null));
185
172
  get focus_on_click(): boolean;
186
173
  set focus_on_click(val: boolean);
187
174
  get focusOnClick(): boolean;
@@ -208,10 +195,10 @@ export declare const VideoBridge: {
208
195
  set hexpand_set(val: boolean);
209
196
  get hexpandSet(): boolean;
210
197
  set hexpandSet(val: boolean);
211
- get layout_manager(): Gtk.LayoutManager;
212
- set layout_manager(val: Gtk.LayoutManager);
213
- get layoutManager(): Gtk.LayoutManager;
214
- set layoutManager(val: Gtk.LayoutManager);
198
+ get layout_manager(): (Gtk.LayoutManager | null);
199
+ set layout_manager(val: (Gtk.LayoutManager | null));
200
+ get layoutManager(): (Gtk.LayoutManager | null);
201
+ set layoutManager(val: (Gtk.LayoutManager | null));
215
202
  get limit_events(): boolean;
216
203
  set limit_events(val: boolean);
217
204
  get limitEvents(): boolean;
@@ -238,24 +225,24 @@ export declare const VideoBridge: {
238
225
  set opacity(val: number);
239
226
  get overflow(): Gtk.Overflow;
240
227
  set overflow(val: Gtk.Overflow);
241
- get parent(): Gtk.Widget;
228
+ get parent(): (Gtk.Widget | null);
242
229
  get receives_default(): boolean;
243
230
  set receives_default(val: boolean);
244
231
  get receivesDefault(): boolean;
245
232
  set receivesDefault(val: boolean);
246
- get root(): Gtk.Root;
233
+ get root(): (Gtk.Root | null);
247
234
  get scale_factor(): number;
248
235
  get scaleFactor(): number;
249
236
  get sensitive(): boolean;
250
237
  set sensitive(val: boolean);
251
- get tooltip_markup(): string;
252
- set tooltip_markup(val: string);
253
- get tooltipMarkup(): string;
254
- set tooltipMarkup(val: string);
255
- get tooltip_text(): string;
256
- set tooltip_text(val: string);
257
- get tooltipText(): string;
258
- set tooltipText(val: string);
238
+ get tooltip_markup(): (string | null);
239
+ set tooltip_markup(val: (string | null));
240
+ get tooltipMarkup(): (string | null);
241
+ set tooltipMarkup(val: (string | null));
242
+ get tooltip_text(): (string | null);
243
+ set tooltip_text(val: (string | null));
244
+ get tooltipText(): (string | null);
245
+ set tooltipText(val: (string | null));
259
246
  get valign(): Gtk.Align;
260
247
  set valign(val: Gtk.Align);
261
248
  get vexpand(): boolean;
@@ -286,7 +273,7 @@ export declare const VideoBridge: {
286
273
  vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Gtk.Tooltip): boolean;
287
274
  vfunc_realize(): void;
288
275
  vfunc_root(): void;
289
- vfunc_set_focus_child(child?: Gtk.Widget | null): void;
276
+ vfunc_set_focus_child(child: (Gtk.Widget | null)): void;
290
277
  vfunc_show(): void;
291
278
  vfunc_size_allocate(width: number, height: number, baseline: number): void;
292
279
  vfunc_snapshot(snapshot: Gtk.Snapshot): void;
@@ -297,13 +284,13 @@ export declare const VideoBridge: {
297
284
  vfunc_unroot(): void;
298
285
  action_set_enabled(action_name: string, enabled: boolean): void;
299
286
  activate(): boolean;
300
- activate_action(name: string, args?: GLib.Variant | null): boolean;
287
+ activate_action(name: string, args: (GLib.Variant | null)): boolean;
301
288
  activate_default(): void;
302
289
  add_controller(controller: Gtk.EventController): void;
303
290
  add_css_class(css_class: string): void;
304
291
  add_mnemonic_label(label: Gtk.Widget): void;
305
292
  add_tick_callback(callback: Gtk.TickCallback): number;
306
- allocate(width: number, height: number, baseline: number, transform?: import("@girs/gsk-4.0").default.Transform | null): void;
293
+ allocate(width: number, height: number, baseline: number, transform: (import("@girs/gsk-4.0").default.Transform | null)): void;
307
294
  child_focus(direction: Gtk.DirectionType): boolean;
308
295
  compute_bounds(target: Gtk.Widget): [boolean, import("@girs/graphene-1.0").default.Rect];
309
296
  compute_expand(orientation: Gtk.Orientation): boolean;
@@ -311,7 +298,7 @@ export declare const VideoBridge: {
311
298
  compute_transform(target: Gtk.Widget): [boolean, import("@girs/graphene-1.0").default.Matrix];
312
299
  contains(x: number, y: number): boolean;
313
300
  create_pango_context(): import("@girs/pango-1.0").default.Context;
314
- create_pango_layout(text?: string | null): import("@girs/pango-1.0").default.Layout;
301
+ create_pango_layout(text: (string | null)): import("@girs/pango-1.0").default.Layout;
315
302
  dispose_template(widget_type: GObject.GType): void;
316
303
  drag_check_threshold(start_x: number, start_y: number, current_x: number, current_y: number): boolean;
317
304
  error_bell(): void;
@@ -319,7 +306,7 @@ export declare const VideoBridge: {
319
306
  get_allocated_height(): number;
320
307
  get_allocated_width(): number;
321
308
  get_allocation(): Gtk.Allocation;
322
- get_ancestor(widget_type: GObject.GType): Gtk.Widget | null;
309
+ get_ancestor(widget_type: GObject.GType): (Gtk.Widget | null);
323
310
  get_baseline(): number;
324
311
  get_can_focus(): boolean;
325
312
  get_can_target(): boolean;
@@ -328,23 +315,23 @@ export declare const VideoBridge: {
328
315
  get_color(): import("@girs/gdk-4.0").default.RGBA;
329
316
  get_css_classes(): string[];
330
317
  get_css_name(): string;
331
- get_cursor(): import("@girs/gdk-4.0").default.Cursor | null;
318
+ get_cursor(): (import("@girs/gdk-4.0").default.Cursor | null);
332
319
  get_direction(): Gtk.TextDirection;
333
320
  get_display(): import("@girs/gdk-4.0").default.Display;
334
- get_first_child(): Gtk.Widget | null;
335
- get_focus_child(): Gtk.Widget | null;
321
+ get_first_child(): (Gtk.Widget | null);
322
+ get_focus_child(): (Gtk.Widget | null);
336
323
  get_focus_on_click(): boolean;
337
324
  get_focusable(): boolean;
338
- get_font_map(): import("@girs/pango-1.0").default.FontMap | null;
339
- get_font_options(): import("@girs/gjs/cairo").default.FontOptions | null;
340
- get_frame_clock(): import("@girs/gdk-4.0").default.FrameClock | null;
325
+ get_font_map(): (import("@girs/pango-1.0").default.FontMap | null);
326
+ get_font_options(): (import("@girs/gjs/cairo").default.FontOptions | null);
327
+ get_frame_clock(): (import("@girs/gdk-4.0").default.FrameClock | null);
341
328
  get_halign(): Gtk.Align;
342
329
  get_has_tooltip(): boolean;
343
330
  get_height(): number;
344
331
  get_hexpand(): boolean;
345
332
  get_hexpand_set(): boolean;
346
- get_last_child(): Gtk.Widget | null;
347
- get_layout_manager(): Gtk.LayoutManager | null;
333
+ get_last_child(): (Gtk.Widget | null);
334
+ get_layout_manager(): (Gtk.LayoutManager | null);
348
335
  get_limit_events(): boolean;
349
336
  get_mapped(): boolean;
350
337
  get_margin_bottom(): number;
@@ -352,19 +339,19 @@ export declare const VideoBridge: {
352
339
  get_margin_start(): number;
353
340
  get_margin_top(): number;
354
341
  get_name(): string;
355
- get_native(): Gtk.Native | null;
356
- get_next_sibling(): Gtk.Widget | null;
342
+ get_native(): (Gtk.Native | null);
343
+ get_next_sibling(): (Gtk.Widget | null);
357
344
  get_opacity(): number;
358
345
  get_overflow(): Gtk.Overflow;
359
346
  get_pango_context(): import("@girs/pango-1.0").default.Context;
360
- get_parent(): Gtk.Widget | null;
347
+ get_parent(): (Gtk.Widget | null);
361
348
  get_preferred_size(): [Gtk.Requisition | null, Gtk.Requisition | null];
362
- get_prev_sibling(): Gtk.Widget | null;
349
+ get_prev_sibling(): (Gtk.Widget | null);
363
350
  get_primary_clipboard(): import("@girs/gdk-4.0").default.Clipboard;
364
351
  get_realized(): boolean;
365
352
  get_receives_default(): boolean;
366
353
  get_request_mode(): Gtk.SizeRequestMode;
367
- get_root(): Gtk.Root | null;
354
+ get_root(): (Gtk.Root | null);
368
355
  get_scale_factor(): number;
369
356
  get_sensitive(): boolean;
370
357
  get_settings(): Gtk.Settings;
@@ -373,8 +360,8 @@ export declare const VideoBridge: {
373
360
  get_state_flags(): Gtk.StateFlags;
374
361
  get_style_context(): Gtk.StyleContext;
375
362
  get_template_child<T = GObject.Object>(widget_type: GObject.GType, name: string): T;
376
- get_tooltip_markup(): string | null;
377
- get_tooltip_text(): string | null;
363
+ get_tooltip_markup(): (string | null);
364
+ get_tooltip_text(): (string | null);
378
365
  get_valign(): Gtk.Align;
379
366
  get_vexpand(): boolean;
380
367
  get_vexpand_set(): boolean;
@@ -386,9 +373,9 @@ export declare const VideoBridge: {
386
373
  hide(): void;
387
374
  in_destruction(): boolean;
388
375
  init_template(): void;
389
- insert_action_group(name: string, group?: import("@girs/gio-2.0").default.ActionGroup | null): void;
390
- insert_after(parent: Gtk.Widget, previous_sibling?: Gtk.Widget | null): void;
391
- insert_before(parent: Gtk.Widget, next_sibling?: Gtk.Widget | null): void;
376
+ insert_action_group(name: string, group: (import("@girs/gio-2.0").default.ActionGroup | null)): void;
377
+ insert_after(parent: Gtk.Widget, previous_sibling: (Gtk.Widget | null)): void;
378
+ insert_before(parent: Gtk.Widget, next_sibling: (Gtk.Widget | null)): void;
392
379
  is_ancestor(ancestor: Gtk.Widget): boolean;
393
380
  is_drawable(): boolean;
394
381
  is_focus(): boolean;
@@ -401,7 +388,7 @@ export declare const VideoBridge: {
401
388
  mnemonic_activate(group_cycling: boolean): boolean;
402
389
  observe_children(): import("@girs/gio-2.0").default.ListModel;
403
390
  observe_controllers(): import("@girs/gio-2.0").default.ListModel;
404
- pick(x: number, y: number, flags: Gtk.PickFlags): Gtk.Widget | null;
391
+ pick(x: number, y: number, flags: Gtk.PickFlags): (Gtk.Widget | null);
405
392
  queue_allocate(): void;
406
393
  queue_draw(): void;
407
394
  queue_resize(): void;
@@ -414,19 +401,19 @@ export declare const VideoBridge: {
414
401
  set_can_target(can_target: boolean): void;
415
402
  set_child_visible(child_visible: boolean): void;
416
403
  set_css_classes(classes: string[]): void;
417
- set_cursor(cursor?: import("@girs/gdk-4.0").default.Cursor | null): void;
418
- set_cursor_from_name(name?: string | null): void;
404
+ set_cursor(cursor: (import("@girs/gdk-4.0").default.Cursor | null)): void;
405
+ set_cursor_from_name(name: (string | null)): void;
419
406
  set_direction(dir: Gtk.TextDirection): void;
420
- set_focus_child(child?: Gtk.Widget | null): void;
407
+ set_focus_child(child: (Gtk.Widget | null)): void;
421
408
  set_focus_on_click(focus_on_click: boolean): void;
422
409
  set_focusable(focusable: boolean): void;
423
- set_font_map(font_map?: import("@girs/pango-1.0").default.FontMap | null): void;
424
- set_font_options(options?: import("@girs/gjs/cairo").default.FontOptions | null): void;
410
+ set_font_map(font_map: (import("@girs/pango-1.0").default.FontMap | null)): void;
411
+ set_font_options(options: (import("@girs/gjs/cairo").default.FontOptions | null)): void;
425
412
  set_halign(align: Gtk.Align): void;
426
413
  set_has_tooltip(has_tooltip: boolean): void;
427
414
  set_hexpand(expand: boolean): void;
428
415
  set_hexpand_set(set: boolean): void;
429
- set_layout_manager(layout_manager?: Gtk.LayoutManager | null): void;
416
+ set_layout_manager(layout_manager: (Gtk.LayoutManager | null)): void;
430
417
  set_limit_events(limit_events: boolean): void;
431
418
  set_margin_bottom(margin: number): void;
432
419
  set_margin_end(margin: number): void;
@@ -440,8 +427,8 @@ export declare const VideoBridge: {
440
427
  set_sensitive(sensitive: boolean): void;
441
428
  set_size_request(width: number, height: number): void;
442
429
  set_state_flags(flags: Gtk.StateFlags, clear: boolean): void;
443
- set_tooltip_markup(markup?: string | null): void;
444
- set_tooltip_text(text?: string | null): void;
430
+ set_tooltip_markup(markup: (string | null)): void;
431
+ set_tooltip_text(text: (string | null)): void;
445
432
  set_valign(align: Gtk.Align): void;
446
433
  set_vexpand(expand: boolean): void;
447
434
  set_vexpand_set(set: boolean): void;
@@ -457,6 +444,41 @@ export declare const VideoBridge: {
457
444
  unrealize(): void;
458
445
  unset_state_flags(flags: Gtk.StateFlags): void;
459
446
  [Symbol.iterator]: () => IterableIterator<Gtk.Widget>;
447
+ vfunc_constructed(): void;
448
+ vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
449
+ vfunc_dispose(): void;
450
+ vfunc_finalize(): void;
451
+ vfunc_get_property(property_id: number, value: unknown, pspec: GObject.ParamSpec): void;
452
+ vfunc_notify(pspec: GObject.ParamSpec): void;
453
+ vfunc_set_property(property_id: number, value: unknown, pspec: GObject.ParamSpec): void;
454
+ bind_property(source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags): GObject.Binding;
455
+ bind_property_full(source_property: string, target: GObject.Object, target_property: string, flags: GObject.BindingFlags, transform_to: (GObject.Closure | null), transform_from: (GObject.Closure | null)): GObject.Binding;
456
+ force_floating(): void;
457
+ freeze_notify(): void;
458
+ get_data(key: string): (any | null);
459
+ get_property(property_name: string, value: (GObject.Value | any)): any;
460
+ get_qdata(quark: GLib.Quark): (any | null);
461
+ getv(names: string[], values: (GObject.Value | any)[]): void;
462
+ is_floating(): boolean;
463
+ notify(property_name: string): void;
464
+ notify_by_pspec(pspec: GObject.ParamSpec): void;
465
+ ref(): GObject.Object;
466
+ ref_sink(): GObject.Object;
467
+ run_dispose(): void;
468
+ set_data(key: string, data: (any | null)): void;
469
+ set_property(property_name: string, value: (GObject.Value | any)): void;
470
+ steal_data(key: string): (any | null);
471
+ steal_qdata(quark: GLib.Quark): (any | null);
472
+ thaw_notify(): void;
473
+ unref(): void;
474
+ watch_closure(closure: GObject.Closure): void;
475
+ disconnect(id: number): void;
476
+ set(properties: {
477
+ [key: string]: any;
478
+ }): void;
479
+ block_signal_handler(id: number): void;
480
+ unblock_signal_handler(id: number): void;
481
+ stop_emission_by_name(detailedName: string): void;
460
482
  };
461
483
  $gtype: GObject.GType<Gtk.Box>;
462
484
  "new"(orientation: Gtk.Orientation, spacing: number): Gtk.Box;
@@ -464,12 +486,12 @@ export declare const VideoBridge: {
464
486
  set_default_direction(dir: Gtk.TextDirection): void;
465
487
  add_shortcut(shortcut: Gtk.Shortcut): void;
466
488
  bind_template_callback_full(callback_name: string, callback_symbol: GObject.Callback): void;
467
- bind_template_child_full(name: string, internal_child: boolean, struct_offset: bigint | number): void;
489
+ bind_template_child_full(name: string, internal_child: boolean, struct_offset: (bigint | number)): void;
468
490
  get_accessible_role(): Gtk.AccessibleRole;
469
491
  get_activate_signal(): number;
470
492
  get_css_name(): string;
471
493
  get_layout_manager_type(): GObject.GType;
472
- install_action(action_name: string, parameter_type: string | null, activate: Gtk.WidgetActionActivateFunc): void;
494
+ install_action(action_name: string, parameter_type: (string | null), activate: Gtk.WidgetActionActivateFunc): void;
473
495
  install_property_action(action_name: string, property_name: string): void;
474
496
  query_action(index_: number): [boolean, GObject.GType, string, GLib.VariantType | null, string];
475
497
  set_accessible_role(accessible_role: Gtk.AccessibleRole): void;
@@ -477,11 +499,11 @@ export declare const VideoBridge: {
477
499
  set_activate_signal_from_name(signal_name: string): void;
478
500
  set_css_name(name: string): void;
479
501
  set_layout_manager_type(type: GObject.GType): void;
480
- set_template(template_bytes: GLib.Bytes | Uint8Array): void;
502
+ set_template(template_bytes: (GLib.Bytes | Uint8Array)): void;
481
503
  set_template_from_resource(resource_name: string): void;
482
504
  set_template_scope(scope: Gtk.BuilderScope): void;
483
505
  newv(object_type: GObject.GType, parameters: GObject.Parameter[]): GObject.Object;
484
- compat_control(what: bigint | number, data?: any | null): number;
506
+ compat_control(what: (bigint | number), data: (any | null)): number;
485
507
  interface_find_property(g_iface: GObject.TypeInterface, property_name: string): GObject.ParamSpec;
486
508
  interface_install_property(g_iface: GObject.TypeInterface, pspec: GObject.ParamSpec): void;
487
509
  interface_list_properties(g_iface: GObject.TypeInterface): GObject.ParamSpec[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/video",
3
- "version": "0.1.15",
3
+ "version": "0.2.0",
4
4
  "description": "VideoBridge — GTK container for HTMLVideoElement backed by GStreamer gtk4paintablesink",
5
5
  "type": "module",
6
6
  "module": "lib/esm/index.js",
@@ -26,20 +26,21 @@
26
26
  "bridge"
27
27
  ],
28
28
  "dependencies": {
29
- "@girs/gdk-4.0": "^4.0.0-4.0.0-rc.3",
30
- "@girs/gjs": "^4.0.0-rc.3",
31
- "@girs/glib-2.0": "^2.88.0-4.0.0-rc.3",
32
- "@girs/gobject-2.0": "^2.88.0-4.0.0-rc.3",
33
- "@girs/gst-1.0": "^1.28.1-4.0.0-rc.3",
34
- "@girs/gtk-4.0": "^4.23.0-4.0.0-rc.3",
35
- "@gjsify/bridge-types": "^0.1.15",
36
- "@gjsify/dom-elements": "^0.1.15",
37
- "@gjsify/dom-events": "^0.1.15",
38
- "@gjsify/event-bridge": "^0.1.15"
29
+ "@girs/gdk-4.0": "^4.0.0-4.0.0-rc.9",
30
+ "@girs/gjs": "^4.0.0-rc.9",
31
+ "@girs/glib-2.0": "^2.88.0-4.0.0-rc.9",
32
+ "@girs/gobject-2.0": "^2.88.0-4.0.0-rc.9",
33
+ "@girs/gst-1.0": "^1.28.1-4.0.0-rc.9",
34
+ "@girs/gtk-4.0": "^4.23.0-4.0.0-rc.9",
35
+ "@gjsify/bridge-types": "^0.2.0",
36
+ "@gjsify/dom-elements": "^0.2.0",
37
+ "@gjsify/dom-events": "^0.2.0",
38
+ "@gjsify/dom-exception": "^0.2.0",
39
+ "@gjsify/event-bridge": "^0.2.0"
39
40
  },
40
41
  "devDependencies": {
41
- "@gjsify/cli": "^0.1.15",
42
+ "@gjsify/cli": "^0.2.0",
42
43
  "@types/node": "^25.6.0",
43
- "typescript": "^6.0.2"
44
+ "typescript": "^6.0.3"
44
45
  }
45
46
  }
package/src/gst-init.ts CHANGED
@@ -7,6 +7,7 @@
7
7
  // This module is GJS-only — the Node alias layer routes it to @gjsify/empty.
8
8
 
9
9
  import Gst from 'gi://Gst?version=1.0';
10
+ import { DOMException } from '@gjsify/dom-exception';
10
11
 
11
12
  let initialized = false;
12
13
 
@@ -31,11 +32,7 @@ export function ensurePaintableSinkAvailable(): void {
31
32
  }
32
33
 
33
34
  function throwNotSupported(message: string): never {
34
- const DOMExceptionCtor: typeof DOMException | undefined = (globalThis as any).DOMException;
35
- if (DOMExceptionCtor) {
36
- throw new DOMExceptionCtor(message, 'NotSupportedError');
37
- }
38
- throw new Error(message);
35
+ throw new DOMException(message, 'NotSupportedError');
39
36
  }
40
37
 
41
38
  export { Gst };
package/src/index.ts CHANGED
@@ -4,12 +4,5 @@
4
4
  export { VideoBridge } from './video-bridge.js';
5
5
  export { buildMediaStreamPipeline, buildUriPipeline, createPaintableSink } from './pipeline-builder.js';
6
6
 
7
- // Side-effect: register so that document.createElement('video') works
8
- // (already built into @gjsify/dom-elements, but register the global constructor)
9
- import { HTMLVideoElement } from '@gjsify/dom-elements';
10
-
11
- Object.defineProperty(globalThis, 'HTMLVideoElement', {
12
- value: HTMLVideoElement,
13
- writable: true,
14
- configurable: true,
15
- });
7
+ // Re-export HTMLVideoElement from dom-elements for consumers who need the type.
8
+ export { HTMLVideoElement } from '@gjsify/dom-elements';