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.
- package/.claude/settings.local.json +2 -1
- package/package.json +1 -1
- package/src/mac_recorder.mm +22 -33
|
@@ -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
package/src/mac_recorder.mm
CHANGED
|
@@ -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
|
-
//
|
|
209
|
-
// macOS 14/13
|
|
210
|
-
if (
|
|
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
|
-
|
|
295
|
-
|
|
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
|
|
303
|
+
// AVFoundation recording (either fallback from ScreenCaptureKit or direct)
|
|
299
304
|
useAVFoundation:
|
|
300
|
-
|
|
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...");
|