@0biwank/screen-capture 1.0.1

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Kunal Dubey
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,84 @@
1
+ # @0biwank/screen-capture
2
+
3
+ Native screen capture addon for Node.js with HLS muxing support for macOS.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @0biwank/screen-capture
9
+ ```
10
+
11
+ ## Platform Support
12
+
13
+ - **macOS only** (darwin)
14
+
15
+ ## Usage
16
+
17
+ ```javascript
18
+ const screenCapture = require('@0biwank/screen-capture');
19
+
20
+ // List available display sources
21
+ const displays = screenCapture.listDisplaySources();
22
+ console.log('Available displays:', displays);
23
+
24
+ // List available window sources
25
+ const windows = screenCapture.listWindowSources();
26
+ console.log('Available windows:', windows);
27
+
28
+ // Select a source (display or window)
29
+ const sourceId = displays[0].id; // or windows[0].id
30
+ screenCapture.selectSource(sourceId);
31
+
32
+ // Start capturing
33
+ screenCapture.startCapture();
34
+
35
+ // Process media stream (with HLS muxing)
36
+ screenCapture.processMediaStream();
37
+
38
+ // Stop capturing
39
+ screenCapture.stopCapture();
40
+ ```
41
+
42
+ ## API
43
+
44
+ ### `listDisplaySources()`
45
+ Returns an array of available display sources.
46
+
47
+ **Returns:** `Array<{id: string, name: string}>`
48
+
49
+ ### `listWindowSources()`
50
+ Returns an array of available window sources.
51
+
52
+ **Returns:** `Array<{id: string, name: string}>`
53
+
54
+ ### `selectSource(sourceId)`
55
+ Selects a source (display or window) for capture.
56
+
57
+ **Parameters:**
58
+ - `sourceId` (string): The ID of the source to capture
59
+
60
+ **Returns:** `boolean`
61
+
62
+ ### `startCapture()`
63
+ Starts the screen capture.
64
+
65
+ **Returns:** `boolean`
66
+
67
+ ### `processMediaStream()`
68
+ Processes the captured media stream with HLS muxing.
69
+
70
+ **Returns:** `boolean`
71
+
72
+ ### `stopCapture()`
73
+ Stops the screen capture.
74
+
75
+ **Returns:** `boolean`
76
+
77
+ ## Requirements
78
+
79
+ - Node.js >= 14.0.0
80
+ - macOS (darwin)
81
+
82
+ ## License
83
+
84
+ MIT
package/index.js ADDED
@@ -0,0 +1,16 @@
1
+ const processor = require('./build/Release/media_processor');
2
+
3
+ module.exports = {
4
+ /** @returns {boolean} */
5
+ processMediaStream: processor.processMediaStream,
6
+ /** @returns {boolean} */
7
+ startCapture: processor.startCapture,
8
+ /** @returns {boolean} */
9
+ stopCapture: processor.stopCapture,
10
+ /** @returns {boolean} */
11
+ selectSource: processor.selectSource,
12
+ /** @returns {Array} */
13
+ listWindowSources: processor.listWindowSources,
14
+ /** @returns {Array} */
15
+ listDisplaySources: processor.listDisplaySources
16
+ };
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@0biwank/screen-capture",
3
+ "version": "1.0.1",
4
+ "description": "Native screen capture addon for Node.js with HLS muxing support",
5
+ "main": "index.js",
6
+ "gypfile": true,
7
+ "scripts": {
8
+ "build": "node-gyp configure build",
9
+ "rebuild": "node-gyp rebuild",
10
+ "test": "node test.js"
11
+ },
12
+ "keywords": [
13
+ "screen-capture",
14
+ "desktop-capture",
15
+ "native-addon",
16
+ "napi",
17
+ "video-encoding",
18
+ "hls"
19
+ ],
20
+ "author": "Kunal Dubey",
21
+ "license": "MIT",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/xakep8/screenCaptureNAPI"
25
+ },
26
+ "homepage": "https://github.com/xakep8/screenCaptureNAPI#readme",
27
+ "bugs": {
28
+ "url": "https://github.com/xakep8/screenCaptureNAPI/issues"
29
+ },
30
+ "os": [
31
+ "darwin"
32
+ ],
33
+ "files": [
34
+ "index.js",
35
+ "build/Release/*.node",
36
+ "README.md",
37
+ "LICENSE"
38
+ ],
39
+ "dependencies": {
40
+ "node-addon-api": "^8.5.0"
41
+ },
42
+ "devDependencies": {
43
+ "node-gyp": "^11.4.2"
44
+ },
45
+ "engines": {
46
+ "node": ">=14.0.0"
47
+ }
48
+ }