node-mac-recorder 2.21.36 → 2.21.39

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.
@@ -4,7 +4,8 @@
4
4
  "Bash(cat:*)",
5
5
  "Bash(pkill:*)",
6
6
  "Bash(for f in test-output/*1761946670140.mov)",
7
- "Bash(node test.js:*)"
7
+ "Bash(node test.js:*)",
8
+ "Bash(sw_vers:*)"
8
9
  ],
9
10
  "deny": [],
10
11
  "ask": []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-mac-recorder",
3
- "version": "2.21.36",
3
+ "version": "2.21.39",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -379,21 +379,21 @@ Napi::Value StartRecording(const Napi::CallbackInfo& info) {
379
379
 
380
380
  if (isElectron) {
381
381
  MRLog(@"⚡ Electron environment detected");
382
- MRLog(@" ELECTRON-FIRST: Both ScreenCaptureKit and AVFoundation fully supported");
382
+ MRLog(@"🔧 CRITICAL FIX: Forcing AVFoundation for Electron stability");
383
+ MRLog(@" Reason: ScreenCaptureKit has thread safety issues in Electron (SIGTRAP crashes)");
383
384
  }
384
385
 
385
- // CRITICAL FIX: Use ScreenCaptureKit on macOS 15+ for best compatibility
386
- // Both ScreenCaptureKit and AVFoundation work in Electron (Electron-first design)
387
- // Only fallback to AVFoundation if ScreenCaptureKit is unavailable
388
- BOOL forceAVFoundation = NO; // Let system choose based on availability
386
+ // CRITICAL FIX: Always use AVFoundation for stability
387
+ // ScreenCaptureKit has file writing issues in Node.js environment
388
+ // AVFoundation works reliably in both Node.js and Electron
389
+ BOOL forceAVFoundation = YES;
389
390
 
390
- MRLog(@"🔧 FRAMEWORK SELECTION: Smart selection based on macOS version");
391
+ MRLog(@"🔧 FRAMEWORK SELECTION: Using AVFoundation for stability");
391
392
  MRLog(@" Environment: %@", isElectron ? @"Electron" : @"Node.js");
392
393
  MRLog(@" macOS: %ld.%ld.%ld", (long)osVersion.majorVersion, (long)osVersion.minorVersion, (long)osVersion.patchVersion);
393
394
 
394
- // Electron-first priority: Both frameworks fully supported in Electron
395
- // macOS 15+: Try ScreenCaptureKit first (better performance)
396
- // macOS 14/13: Use AVFoundation (ScreenCaptureKit not available)
395
+ // Electron-first priority: ALWAYS use AVFoundation in Electron for stability
396
+ // ScreenCaptureKit has severe thread safety issues in Electron causing SIGTRAP crashes
397
397
  if (isM15Plus && !forceAVFoundation) {
398
398
  if (isElectron) {
399
399
  MRLog(@"⚡ ELECTRON PRIORITY: macOS 15+ Electron → ScreenCaptureKit with full support");