node-mac-recorder 2.16.6 โ†’ 2.16.7

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.
@@ -49,7 +49,8 @@
49
49
  "Bash(FORCE_AVFOUNDATION=1 node -e \"\nconsole.log(''๐Ÿงช Testing AVFoundation fallback path (macOS 14 simulation)'');\nconst MacRecorder = require(''./index'');\nconst recorder = new MacRecorder();\n\nasync function testAVFoundationPath() {\n try {\n const outputPath = ''./test-output/force-avfoundation-test.mov'';\n console.log(''๐Ÿ“น Testing AVFoundation (simulating macOS 14)...'');\n \n const success = await recorder.startRecording(outputPath, {\n captureCursor: true,\n includeMicrophone: false,\n includeSystemAudio: true\n });\n \n if (success) {\n console.log(''โœ… Recording started with AVFoundation'');\n await new Promise(resolve => setTimeout(resolve, 3000));\n \n await recorder.stopRecording();\n console.log(''โœ… AVFoundation test completed successfully!'');\n console.log(''This is how it should work on macOS 14'');\n } else {\n console.log(''โŒ Recording failed to start'');\n }\n } catch (error) {\n console.log(''โŒ Error:'', error.message);\n }\n}\n\ntestAVFoundationPath();\n\")",
50
50
  "Bash(FORCE_AVFOUNDATION=1 node -e \"\nconsole.log(''๐Ÿงช Testing AVFoundation with detailed debugging'');\nconst MacRecorder = require(''./index'');\nconst recorder = new MacRecorder();\n\nasync function testWithDebugging() {\n try {\n const outputPath = ''./test-output/debug-test.mov'';\n console.log(''๐Ÿ“น Starting AVFoundation test with debugging...'');\n console.log(''Expected to see detailed AVFoundation logs in console'');\n \n const success = await recorder.startRecording(outputPath, {\n captureCursor: true,\n includeMicrophone: false,\n includeSystemAudio: true\n });\n \n if (success) {\n console.log(''โœ… Recording started'');\n await new Promise(resolve => setTimeout(resolve, 2000));\n \n await recorder.stopRecording();\n console.log(''โœ… Test completed'');\n } else {\n console.log(''โŒ Recording failed - check console logs for AVFoundation details'');\n }\n } catch (error) {\n console.log(''โŒ Error:'', error.message);\n }\n}\n\ntestWithDebugging();\n\")",
51
51
  "Bash(FORCE_AVFOUNDATION=1 node -e \"\nconsole.log(''๐Ÿงช Testing macOS 13/14 path (forced AVFoundation)'');\nconst MacRecorder = require(''./index'');\nconst recorder = new MacRecorder();\n\nasync function testMacOS1314Path() {\n try {\n const outputPath = ''./test-output/macos1314-test.mov'';\n console.log(''๐Ÿ“น Starting test for macOS 13/14 path...'');\n console.log(''This simulates the exact path macOS 13/14 users will take'');\n console.log('''');\n \n const success = await recorder.startRecording(outputPath, {\n captureCursor: true,\n includeMicrophone: false,\n includeSystemAudio: true\n });\n \n if (success) {\n console.log(''โœ… SUCCESS: Recording started on macOS 13/14 path!'');\n await new Promise(resolve => setTimeout(resolve, 3000));\n \n await recorder.stopRecording();\n console.log(''โœ… Recording completed successfully!'');\n console.log(''๐Ÿ“ Output:'', outputPath);\n } else {\n console.log(''โŒ Recording failed to start'');\n }\n } catch (error) {\n console.log(''โŒ Error:'', error.message);\n console.log(''This error would be what macOS 13/14 users see'');\n }\n}\n\ntestMacOS1314Path();\n\")",
52
- "Bash(FORCE_AVFOUNDATION=1 node -e \"\nconsole.log(''๐Ÿงช Testing macOS 14 Direct AVFoundation Path'');\nconst MacRecorder = require(''./index'');\nconst recorder = new MacRecorder();\n\nasync function testDirectAVFoundation() {\n try {\n const outputPath = ''./test-output/direct-avfoundation-test.mov'';\n console.log(''๐Ÿ“น Testing direct AVFoundation path (macOS 14 simulation)...'');\n console.log(''Expected logs:'');\n console.log('' ๐ŸŽฏ macOS 14 detected - directly using AVFoundation'');\n console.log('' โญ๏ธ Skipping ScreenCaptureKit completely, jumping to AVFoundation'');\n console.log('' ๐ŸŽฌ AVFoundation: Starting recording initialization'');\n console.log('''');\n \n const success = await recorder.startRecording(outputPath, {\n captureCursor: true,\n includeMicrophone: false,\n includeSystemAudio: true\n });\n \n if (success) {\n console.log(''โœ… SUCCESS: Direct AVFoundation path works!'');\n await new Promise(resolve => setTimeout(resolve, 3000));\n \n await recorder.stopRecording();\n console.log(''โœ… Recording completed successfully!'');\n console.log('''');\n console.log(''๐ŸŽ‰ This is exactly how macOS 14 will work:'');\n console.log(''โœ… No ScreenCaptureKit attempts'');\n console.log(''โœ… Direct AVFoundation usage'');\n console.log(''โœ… No permission errors'');\n } else {\n console.log(''โŒ Recording failed'');\n }\n } catch (error) {\n console.log(''โŒ Error:'', error.message);\n }\n}\n\ntestDirectAVFoundation();\n\")"
52
+ "Bash(FORCE_AVFOUNDATION=1 node -e \"\nconsole.log(''๐Ÿงช Testing macOS 14 Direct AVFoundation Path'');\nconst MacRecorder = require(''./index'');\nconst recorder = new MacRecorder();\n\nasync function testDirectAVFoundation() {\n try {\n const outputPath = ''./test-output/direct-avfoundation-test.mov'';\n console.log(''๐Ÿ“น Testing direct AVFoundation path (macOS 14 simulation)...'');\n console.log(''Expected logs:'');\n console.log('' ๐ŸŽฏ macOS 14 detected - directly using AVFoundation'');\n console.log('' โญ๏ธ Skipping ScreenCaptureKit completely, jumping to AVFoundation'');\n console.log('' ๐ŸŽฌ AVFoundation: Starting recording initialization'');\n console.log('''');\n \n const success = await recorder.startRecording(outputPath, {\n captureCursor: true,\n includeMicrophone: false,\n includeSystemAudio: true\n });\n \n if (success) {\n console.log(''โœ… SUCCESS: Direct AVFoundation path works!'');\n await new Promise(resolve => setTimeout(resolve, 3000));\n \n await recorder.stopRecording();\n console.log(''โœ… Recording completed successfully!'');\n console.log('''');\n console.log(''๐ŸŽ‰ This is exactly how macOS 14 will work:'');\n console.log(''โœ… No ScreenCaptureKit attempts'');\n console.log(''โœ… Direct AVFoundation usage'');\n console.log(''โœ… No permission errors'');\n } else {\n console.log(''โŒ Recording failed'');\n }\n } catch (error) {\n console.log(''โŒ Error:'', error.message);\n }\n}\n\ntestDirectAVFoundation();\n\")",
53
+ "Bash(FORCE_AVFOUNDATION=1 node -e \"\nconsole.log(''๐Ÿ”ฅ FINAL TEST: macOS 14 Direct AVFoundation (NO ScreenCaptureKit)'');\nconst MacRecorder = require(''./index'');\nconst recorder = new MacRecorder();\n\nasync function finalTest() {\n try {\n const outputPath = ''./test-output/final-macos14-test.mov'';\n \n const success = await recorder.startRecording(outputPath, {\n captureCursor: true,\n includeMicrophone: false,\n includeSystemAudio: true\n });\n \n if (success) {\n console.log(''๐ŸŽ‰ SUCCESS: macOS 14 AVFoundation works!'');\n await new Promise(resolve => setTimeout(resolve, 2000));\n await recorder.stopRecording();\n console.log(''โœ… Test completed - macOS 14 is FIXED!'');\n } else {\n console.log(''โŒ Still failed'');\n }\n } catch (error) {\n console.log(''โŒ Error:'', error.message);\n }\n}\n\nfinalTest();\n\")"
53
54
  ],
54
55
  "deny": []
55
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-mac-recorder",
3
- "version": "2.16.6",
3
+ "version": "2.16.7",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -205,9 +205,9 @@ Napi::Value StartRecording(const Napi::CallbackInfo& info) {
205
205
  NSLog(@"๐Ÿ”ง FORCE_AVFOUNDATION environment variable detected - skipping ScreenCaptureKit");
206
206
  }
207
207
 
208
- // Use ScreenCaptureKit only on macOS 15+ for maximum stability
209
- // macOS 14/13 should skip ScreenCaptureKit completely and use AVFoundation
210
- if (@available(macOS 12.3, *) && isM15Plus && !forceAVFoundation) {
208
+ // ONLY use ScreenCaptureKit on macOS 15+
209
+ // macOS 14/13 ALWAYS use AVFoundation - NO ScreenCaptureKit attempts
210
+ if (isM15Plus && !forceAVFoundation && !isElectron) {
211
211
  NSLog(@"โœ… macOS 15+ detected - ScreenCaptureKit available with full compatibility");
212
212
 
213
213
  // Try ScreenCaptureKit with extensive safety measures
@@ -280,40 +280,29 @@ Napi::Value StartRecording(const Napi::CallbackInfo& info) {
280
280
  NSLog(@"โŒ Exception during ScreenCaptureKit availability check: %@", availabilityException.reason);
281
281
  return Napi::Boolean::New(env, false);
282
282
  }
283
- } else if (isM14Plus && !isElectron) {
284
- // macOS 14 - directly use AVFoundation, skip all ScreenCaptureKit logic
285
- NSLog(@"๐ŸŽฏ macOS 14 detected - directly using AVFoundation for better compatibility");
286
- NSLog(@"โญ๏ธ Skipping ScreenCaptureKit completely, jumping to AVFoundation");
287
- goto useAVFoundation;
288
- } else if (isM13Plus && !isElectron) {
289
- // macOS 13 - directly use AVFoundation, skip all ScreenCaptureKit logic
290
- NSLog(@"๐ŸŽฏ macOS 13 detected - directly using AVFoundation (limited features)");
291
- NSLog(@"โญ๏ธ Skipping ScreenCaptureKit completely, jumping to AVFoundation");
292
- goto useAVFoundation;
293
283
  } else {
294
- NSLog(@"โŒ macOS version too old (< 13.0) or Electron environment - Recording not supported");
295
- return Napi::Boolean::New(env, false);
284
+ // macOS 14/13 or not macOS 15+ - ALWAYS use AVFoundation
285
+ if (isElectron) {
286
+ NSLog(@"โŒ Electron environment - Recording not supported");
287
+ return Napi::Boolean::New(env, false);
288
+ }
289
+
290
+ if (isM14Plus) {
291
+ NSLog(@"๐ŸŽฏ macOS 14 detected - using AVFoundation (primary method)");
292
+ } else if (isM13Plus) {
293
+ NSLog(@"๐ŸŽฏ macOS 13 detected - using AVFoundation (limited features)");
294
+ } else {
295
+ NSLog(@"โŒ macOS version too old (< 13.0) - Not supported");
296
+ return Napi::Boolean::New(env, false);
297
+ }
298
+
299
+ // DIRECT AVFoundation - NO fallback logic
300
+ NSLog(@"โญ๏ธ Using AVFoundation directly - no ScreenCaptureKit attempts");
296
301
  }
297
302
 
298
- // AVFoundation fallback logic
303
+ // AVFoundation recording (either fallback from ScreenCaptureKit or direct)
299
304
  useAVFoundation:
300
- if (isElectron) {
301
- NSLog(@"โŒ ScreenCaptureKit failed in Electron - AVFoundation disabled for stability");
302
- NSLog(@"โŒ Recording not available in Electron when ScreenCaptureKit fails");
303
- return Napi::Boolean::New(env, false);
304
- }
305
-
306
- // Try AVFoundation fallback (ScreenCaptureKit failed or macOS 13/14)
307
- if (isM15Plus) {
308
- NSLog(@"๐Ÿ”„ ScreenCaptureKit failed on macOS 15+ - attempting AVFoundation fallback");
309
- } else if (isM14Plus) {
310
- NSLog(@"๐ŸŽฅ Using AVFoundation for macOS 14 compatibility (primary method)");
311
- } else if (isM13Plus) {
312
- NSLog(@"๐ŸŽฅ Using AVFoundation for macOS 13 compatibility (primary method, limited features)");
313
- } else {
314
- NSLog(@"โŒ Unsupported macOS version for AVFoundation");
315
- return Napi::Boolean::New(env, false);
316
- }
305
+ NSLog(@"๐ŸŽฅ Starting AVFoundation recording...");
317
306
 
318
307
  @try {
319
308
  NSLog(@"๐Ÿ”ง Attempting AVFoundation recording...");