@gjsify/video 0.4.42 → 0.4.44
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/README.md +54 -0
- package/package.json +7 -7
package/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# @gjsify/video
|
|
2
|
+
|
|
3
|
+
`HTMLVideoElement` implementation for GJS backed by a `VideoBridge` — a `Gtk.Picture` widget powered by GStreamer's `gtk4paintablesink`. Accepts a `MediaStream` from `getUserMedia` / WebRTC as `video.srcObject`, or a URI string via `video.src` (played through a `playbin` pipeline). Phase 1.
|
|
4
|
+
|
|
5
|
+
Part of the [gjsify](https://github.com/gjsify/gjsify) project — Node.js and Web APIs for GJS (GNOME JavaScript).
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
gjsify install @gjsify/video
|
|
11
|
+
|
|
12
|
+
# npm or yarn also work (e.g. adding it to an existing project):
|
|
13
|
+
npm install @gjsify/video
|
|
14
|
+
yarn add @gjsify/video
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Requires GStreamer 1.0 with `gtk4paintablesink` (`gstreamer1-plugins-good` + `gstreamer1-plugins-bad-free` on Fedora).
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { VideoBridge } from '@gjsify/video';
|
|
23
|
+
|
|
24
|
+
const bridge = new VideoBridge();
|
|
25
|
+
|
|
26
|
+
bridge.onReady(async (video) => {
|
|
27
|
+
// Play a local file via URI
|
|
28
|
+
video.src = 'file:///path/to/video.mp4';
|
|
29
|
+
await video.play();
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// Add to a GTK window as a standard widget
|
|
33
|
+
window.set_child(bridge);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Using a `MediaStream` (e.g. from `getUserMedia`):
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
import { VideoBridge } from '@gjsify/video';
|
|
40
|
+
|
|
41
|
+
const bridge = new VideoBridge();
|
|
42
|
+
|
|
43
|
+
bridge.onReady(async (video) => {
|
|
44
|
+
const stream = await navigator.mediaDevices.getUserMedia({ video: true });
|
|
45
|
+
video.srcObject = stream;
|
|
46
|
+
await video.play();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
window.set_child(bridge);
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## License
|
|
53
|
+
|
|
54
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/video",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.44",
|
|
4
4
|
"description": "VideoBridge — GTK container for HTMLVideoElement backed by GStreamer gtk4paintablesink",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
"@girs/gobject-2.0": "2.88.0-4.0.4",
|
|
37
37
|
"@girs/gst-1.0": "1.28.1-4.0.4",
|
|
38
38
|
"@girs/gtk-4.0": "4.23.0-4.0.4",
|
|
39
|
-
"@gjsify/bridge-types": "^0.4.
|
|
40
|
-
"@gjsify/dom-elements": "^0.4.
|
|
41
|
-
"@gjsify/dom-events": "^0.4.
|
|
42
|
-
"@gjsify/dom-exception": "^0.4.
|
|
43
|
-
"@gjsify/event-bridge": "^0.4.
|
|
39
|
+
"@gjsify/bridge-types": "^0.4.44",
|
|
40
|
+
"@gjsify/dom-elements": "^0.4.44",
|
|
41
|
+
"@gjsify/dom-events": "^0.4.44",
|
|
42
|
+
"@gjsify/dom-exception": "^0.4.44",
|
|
43
|
+
"@gjsify/event-bridge": "^0.4.44"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@gjsify/cli": "^0.4.
|
|
46
|
+
"@gjsify/cli": "^0.4.44",
|
|
47
47
|
"@types/node": "^25.9.1",
|
|
48
48
|
"typescript": "^6.0.3"
|
|
49
49
|
},
|