node-mac-recorder 2.19.3 โ†’ 2.19.5

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,15 +1,12 @@
1
1
  {
2
2
  "permissions": {
3
3
  "allow": [
4
- "Bash(FORCE_AVFOUNDATION=1 node test-cursor-simple.js)",
5
- "Bash(FORCE_AVFOUNDATION=1 timeout 10 node test-cursor-simple.js)",
6
- "Bash(jq:*)",
7
- "Bash(FORCE_AVFOUNDATION=1 timeout 15 node test-cursor-position.js)",
8
- "Bash(FORCE_AVFOUNDATION=1 timeout 8 node test-cursor-debug.js)",
9
- "Bash(FORCE_AVFOUNDATION=1 timeout 5 node test-cursor-debug.js)",
10
- "Bash(FORCE_AVFOUNDATION=1 timeout 8 node test-unified-cursor.js)",
11
- "Bash(FORCE_AVFOUNDATION=1 timeout 5 node test-unified-cursor.js)",
12
- "Bash(FORCE_AVFOUNDATION=1 timeout 8 node -e \"\nconst MacRecorder = require(''./index.js'');\nconst recorder = new MacRecorder();\n\nconsole.log(''๐Ÿงช Testing AVFoundation fallback...'');\n\nasync function testFallback() {\n try {\n const outputPath = ''./test-avfoundation-fallback.mov'';\n \n console.log(''Starting AVFoundation recording...'');\n await recorder.startRecording(outputPath, {\n captureCursor: true,\n includeMicrophone: false,\n includeSystemAudio: false\n });\n \n console.log(''โœ… AVFoundation recording started!'');\n \n setTimeout(async () => {\n try {\n console.log(''Stopping recording...'');\n await recorder.stopRecording();\n console.log(''โœ… AVFoundation recording stopped!'');\n process.exit(0);\n } catch (error) {\n console.error(''โŒ Stop failed:'', error.message);\n process.exit(1);\n }\n }, 3000);\n \n } catch (error) {\n console.error(''โŒ AVFoundation recording failed:'', error.message);\n process.exit(1);\n }\n}\n\ntestFallback();\n\")"
4
+ "Bash(npm test)",
5
+ "Bash(node:*)",
6
+ "Bash(npm install)",
7
+ "Bash(npm run clean:*)",
8
+ "Bash(npm run build:*)",
9
+ "Bash(npm run rebuild:*)"
13
10
  ],
14
11
  "deny": [],
15
12
  "ask": []
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # node-mac-recorder
2
2
 
3
+ *This package was developed for [https://creavit.studio](https://creavit.studio)*
4
+
3
5
  A powerful native macOS screen recording Node.js package with advanced window selection, multi-display support, and automatic overlay window exclusion. Built with ScreenCaptureKit for modern macOS with intelligent window filtering and Electron compatibility.
4
6
 
5
7
  ## Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-mac-recorder",
3
- "version": "2.19.3",
3
+ "version": "2.19.5",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -2,7 +2,7 @@
2
2
 
3
3
  // Pure ScreenCaptureKit implementation - NO AVFoundation
4
4
  static SCStream * API_AVAILABLE(macos(12.3)) g_stream = nil;
5
- static SCRecordingOutput * API_AVAILABLE(macos(15.0)) g_recordingOutput = nil;
5
+ static id g_recordingOutput API_AVAILABLE(macos(15.0)) = nil;
6
6
  static id<SCStreamDelegate> API_AVAILABLE(macos(12.3)) g_streamDelegate = nil;
7
7
  static BOOL g_isRecording = NO;
8
8
  static BOOL g_isCleaningUp = NO; // Prevent recursive cleanup
@@ -42,7 +42,8 @@ static NSString *g_outputPath = nil;
42
42
 
43
43
  + (BOOL)isScreenCaptureKitAvailable {
44
44
  if (@available(macOS 15.0, *)) {
45
- return [SCShareableContent class] != nil && [SCStream class] != nil && [SCRecordingOutput class] != nil;
45
+ Class recordingOutputClass = NSClassFromString(@"SCRecordingOutput");
46
+ return [SCShareableContent class] != nil && [SCStream class] != nil && recordingOutputClass != nil;
46
47
  }
47
48
  return NO;
48
49
  }
@@ -275,17 +276,23 @@ static NSString *g_outputPath = nil;
275
276
  }
276
277
 
277
278
  if (@available(macOS 15.0, *)) {
278
- // Create recording output configuration
279
- SCRecordingOutputConfiguration *recordingConfig = [[SCRecordingOutputConfiguration alloc] init];
280
- recordingConfig.outputURL = outputURL;
281
- recordingConfig.videoCodecType = AVVideoCodecTypeH264;
282
-
283
- // Audio configuration - using available properties
284
- // Note: Specific audio routing handled by ScreenCaptureKit automatically
285
-
286
- // Create recording output with correct initializer
287
- g_recordingOutput = [[SCRecordingOutput alloc] initWithConfiguration:recordingConfig
288
- delegate:nil];
279
+ // Create recording output configuration using runtime class lookup
280
+ Class recordingConfigClass = NSClassFromString(@"SCRecordingOutputConfiguration");
281
+ Class recordingOutputClass = NSClassFromString(@"SCRecordingOutput");
282
+
283
+ if (recordingConfigClass && recordingOutputClass) {
284
+ id recordingConfig = [[recordingConfigClass alloc] init];
285
+ [recordingConfig setValue:outputURL forKey:@"outputURL"];
286
+ // Use string constant for video codec
287
+ [recordingConfig setValue:@"avc1" forKey:@"videoCodecType"];
288
+
289
+ // Audio configuration - using available properties
290
+ // Note: Specific audio routing handled by ScreenCaptureKit automatically
291
+
292
+ // Create recording output with correct initializer
293
+ g_recordingOutput = [[recordingOutputClass alloc] initWithConfiguration:recordingConfig
294
+ delegate:nil];
295
+ }
289
296
  if (shouldCaptureMic && shouldCaptureSystemAudio) {
290
297
  NSLog(@"๐Ÿ”ง Created SCRecordingOutput with microphone and system audio");
291
298
  } else if (shouldCaptureMic) {
@@ -320,7 +327,9 @@ static NSString *g_outputPath = nil;
320
327
  BOOL outputAdded = NO;
321
328
 
322
329
  if (@available(macOS 15.0, *)) {
323
- outputAdded = [g_stream addRecordingOutput:g_recordingOutput error:&outputError];
330
+ if (g_recordingOutput && [g_stream respondsToSelector:@selector(addRecordingOutput:error:)]) {
331
+ outputAdded = [g_stream addRecordingOutput:g_recordingOutput error:&outputError];
332
+ }
324
333
  }
325
334
 
326
335
  if (!outputAdded || outputError) {
@@ -1 +0,0 @@
1
- [{"x":-2420,"y":919,"timestamp":80,"unixTimeMs":1758628587619,"cursorType":"text","type":"move","coordinateSystem":"video-relative-outside","recordingType":"display","videoInfo":{"width":2048,"height":1330,"offsetX":0,"offsetY":0},"displayInfo":{"displayId":1,"width":2048,"height":1330}}]