node-mac-recorder 2.16.5 β 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 +3 -1
- package/package.json +1 -1
- package/src/mac_recorder.mm +23 -31
- package/test-console-logs.js +81 -0
- package/test-macos14-forced.js +107 -0
|
@@ -48,7 +48,9 @@
|
|
|
48
48
|
"Bash(FORCE_AVFOUNDATION=1 node -e \"\nconsole.log(''π§ͺ Testing AVFoundation fallback path'');\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 (force mode)...'');\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(''β
AVFoundation test completed!'');\n } else {\n console.log(''β Recording failed'');\n }\n } catch (error) {\n console.log(''β Error:'', error.message);\n }\n}\n\ntestAVFoundationPath();\n\")",
|
|
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
|
-
"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\")"
|
|
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\")",
|
|
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\")"
|
|
52
54
|
],
|
|
53
55
|
"deny": []
|
|
54
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
|
|
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,37 +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) {
|
|
284
|
-
// macOS 14 - directly use AVFoundation for better compatibility
|
|
285
|
-
NSLog(@"π― macOS 14 detected - directly using AVFoundation for better compatibility");
|
|
286
|
-
// Skip ScreenCaptureKit completely and go directly to AVFoundation
|
|
287
|
-
} else if (isM13Plus) {
|
|
288
|
-
// macOS 13 - use AVFoundation (limited features)
|
|
289
|
-
NSLog(@"π― macOS 13 detected - directly using AVFoundation (limited features)");
|
|
290
|
-
// Skip ScreenCaptureKit completely and go directly to AVFoundation
|
|
291
283
|
} else {
|
|
292
|
-
|
|
293
|
-
|
|
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");
|
|
294
301
|
}
|
|
295
302
|
|
|
296
|
-
// AVFoundation fallback
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
NSLog(@"β Recording not available in Electron when ScreenCaptureKit fails");
|
|
300
|
-
return Napi::Boolean::New(env, false);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
// Try AVFoundation fallback (ScreenCaptureKit failed or macOS 13/14)
|
|
304
|
-
if (isM15Plus) {
|
|
305
|
-
NSLog(@"π ScreenCaptureKit failed on macOS 15+ - attempting AVFoundation fallback");
|
|
306
|
-
} else if (isM14Plus) {
|
|
307
|
-
NSLog(@"π₯ Using AVFoundation for macOS 14 compatibility (primary method)");
|
|
308
|
-
} else if (isM13Plus) {
|
|
309
|
-
NSLog(@"π₯ Using AVFoundation for macOS 13 compatibility (primary method, limited features)");
|
|
310
|
-
} else {
|
|
311
|
-
NSLog(@"β Unsupported macOS version for AVFoundation");
|
|
312
|
-
return Napi::Boolean::New(env, false);
|
|
313
|
-
}
|
|
303
|
+
// AVFoundation recording (either fallback from ScreenCaptureKit or direct)
|
|
304
|
+
useAVFoundation:
|
|
305
|
+
NSLog(@"π₯ Starting AVFoundation recording...");
|
|
314
306
|
|
|
315
307
|
@try {
|
|
316
308
|
NSLog(@"π§ Attempting AVFoundation recording...");
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
const MacRecorder = require('./index');
|
|
2
|
+
|
|
3
|
+
console.log('π Console Log Detection Test');
|
|
4
|
+
console.log('This test shows which recording method is being used');
|
|
5
|
+
console.log('========================================================');
|
|
6
|
+
|
|
7
|
+
async function testConsoleOutput() {
|
|
8
|
+
const recorder = new MacRecorder();
|
|
9
|
+
|
|
10
|
+
try {
|
|
11
|
+
console.log('π Starting recording test...');
|
|
12
|
+
console.log('Expected to see detailed native logs in Console.app or terminal');
|
|
13
|
+
console.log('');
|
|
14
|
+
|
|
15
|
+
const outputPath = './test-output/console-log-test.mov';
|
|
16
|
+
|
|
17
|
+
// Create test output directory
|
|
18
|
+
const fs = require('fs');
|
|
19
|
+
if (!fs.existsSync('./test-output')) {
|
|
20
|
+
fs.mkdirSync('./test-output');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
console.log('π¬ Calling startRecording...');
|
|
24
|
+
const result = await recorder.startRecording(outputPath, {
|
|
25
|
+
captureCursor: false,
|
|
26
|
+
includeMicrophone: false,
|
|
27
|
+
includeSystemAudio: false,
|
|
28
|
+
displayId: 1
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
if (result) {
|
|
32
|
+
console.log('β
Recording started successfully!');
|
|
33
|
+
console.log('π Result:', result);
|
|
34
|
+
|
|
35
|
+
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
36
|
+
|
|
37
|
+
console.log('π Stopping recording...');
|
|
38
|
+
await recorder.stopRecording();
|
|
39
|
+
console.log('β
Recording stopped');
|
|
40
|
+
|
|
41
|
+
// Check what method was used by looking at file size/existence
|
|
42
|
+
if (fs.existsSync(outputPath)) {
|
|
43
|
+
const stats = fs.statSync(outputPath);
|
|
44
|
+
console.log('π File created:', stats.size, 'bytes');
|
|
45
|
+
console.log('');
|
|
46
|
+
console.log('π SUCCESS: Recording works!');
|
|
47
|
+
}
|
|
48
|
+
} else {
|
|
49
|
+
console.log('β Recording failed');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
} catch (error) {
|
|
53
|
+
console.log('β JavaScript Error:', error.message);
|
|
54
|
+
console.log('β This is the error your app would see');
|
|
55
|
+
|
|
56
|
+
// Check if it's the old error message
|
|
57
|
+
if (error.message.includes('ScreenCaptureKit failed')) {
|
|
58
|
+
console.log('');
|
|
59
|
+
console.log('π¨ PROBLEM: Still seeing old ScreenCaptureKit error');
|
|
60
|
+
console.log(' This means the new logic is not being used');
|
|
61
|
+
console.log(' Possible causes:');
|
|
62
|
+
console.log(' 1. Module not rebuilt properly');
|
|
63
|
+
console.log(' 2. Cache issue');
|
|
64
|
+
console.log(' 3. Wrong macOS version detection');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
console.log('');
|
|
69
|
+
console.log('π If you see this test:');
|
|
70
|
+
console.log('β
Module loads correctly');
|
|
71
|
+
console.log('β
JavaScript layer works');
|
|
72
|
+
console.log('β Check Console.app for native logs');
|
|
73
|
+
console.log('');
|
|
74
|
+
console.log('π To see native logs:');
|
|
75
|
+
console.log(' 1. Open Console.app');
|
|
76
|
+
console.log(' 2. Filter by "node" process');
|
|
77
|
+
console.log(' 3. Look for "π― Smart Recording Engine Selection"');
|
|
78
|
+
console.log(' 4. Look for "macOS Version:" detection');
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
testConsoleOutput();
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// macOS 14 test simΓΌlasyonu - detaylΔ± debug bilgisiyle
|
|
2
|
+
const MacRecorder = require('./index');
|
|
3
|
+
|
|
4
|
+
console.log('π§ͺ macOS 14 Forced Test with Detailed Debugging');
|
|
5
|
+
console.log('====================================================');
|
|
6
|
+
console.log('');
|
|
7
|
+
console.log('This test simulates exactly what happens on macOS 14');
|
|
8
|
+
console.log('by forcing the AVFoundation path.');
|
|
9
|
+
console.log('');
|
|
10
|
+
|
|
11
|
+
// Force AVFoundation environment variable
|
|
12
|
+
process.env.FORCE_AVFOUNDATION = '1';
|
|
13
|
+
|
|
14
|
+
async function testMacOS14Scenario() {
|
|
15
|
+
const recorder = new MacRecorder();
|
|
16
|
+
|
|
17
|
+
console.log('π Test Configuration:');
|
|
18
|
+
console.log(' - FORCE_AVFOUNDATION = 1 (simulates macOS 14)');
|
|
19
|
+
console.log(' - Expected: Skip ScreenCaptureKit, use AVFoundation');
|
|
20
|
+
console.log(' - Should see: "π₯ Using AVFoundation" logs');
|
|
21
|
+
console.log('');
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
const outputPath = './test-output/macos14-forced.mov';
|
|
25
|
+
|
|
26
|
+
// Create directory
|
|
27
|
+
const fs = require('fs');
|
|
28
|
+
if (!fs.existsSync('./test-output')) {
|
|
29
|
+
fs.mkdirSync('./test-output');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
console.log('π¬ Starting recording (macOS 14 simulation)...');
|
|
33
|
+
console.log('Expected Console Logs:');
|
|
34
|
+
console.log(' π§ FORCE_AVFOUNDATION environment variable detected');
|
|
35
|
+
console.log(' π― macOS 14 detected - directly using AVFoundation');
|
|
36
|
+
console.log(' π₯ Using AVFoundation for macOS 14 compatibility');
|
|
37
|
+
console.log(' π¬ AVFoundation: Starting recording initialization');
|
|
38
|
+
console.log(' β
AVFoundation recording started successfully');
|
|
39
|
+
console.log('');
|
|
40
|
+
|
|
41
|
+
const result = await recorder.startRecording(outputPath, {
|
|
42
|
+
captureCursor: true,
|
|
43
|
+
includeMicrophone: false,
|
|
44
|
+
includeSystemAudio: true,
|
|
45
|
+
displayId: 1
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
if (result) {
|
|
49
|
+
console.log('π SUCCESS: macOS 14 path works!');
|
|
50
|
+
console.log('π Output file:', result);
|
|
51
|
+
console.log('β±οΈ Recording for 3 seconds...');
|
|
52
|
+
|
|
53
|
+
await new Promise(resolve => setTimeout(resolve, 3000));
|
|
54
|
+
|
|
55
|
+
console.log('π Stopping recording...');
|
|
56
|
+
await recorder.stopRecording();
|
|
57
|
+
|
|
58
|
+
// Verify file
|
|
59
|
+
if (fs.existsSync(outputPath)) {
|
|
60
|
+
const stats = fs.statSync(outputPath);
|
|
61
|
+
console.log('β
Recording file created successfully');
|
|
62
|
+
console.log(' File size:', Math.round(stats.size / 1024), 'KB');
|
|
63
|
+
console.log('');
|
|
64
|
+
console.log('π macOS 14 Recording Test: PASSED β
');
|
|
65
|
+
console.log('');
|
|
66
|
+
console.log('This means on real macOS 14 systems:');
|
|
67
|
+
console.log('β
Version detection will work');
|
|
68
|
+
console.log('β
AVFoundation will be used as primary method');
|
|
69
|
+
console.log('β
No ScreenCaptureKit errors will occur');
|
|
70
|
+
console.log('β
Recording will work with 15fps H.264 encoding');
|
|
71
|
+
} else {
|
|
72
|
+
console.log('β No output file created');
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
} else {
|
|
76
|
+
console.log('β Recording failed to start');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
} catch (error) {
|
|
80
|
+
console.log('β Error:', error.message);
|
|
81
|
+
|
|
82
|
+
// Check if user is getting old error
|
|
83
|
+
if (error.message.includes('ScreenCaptureKit failed')) {
|
|
84
|
+
console.log('');
|
|
85
|
+
console.log('π¨ CRITICAL: You are seeing the OLD error message!');
|
|
86
|
+
console.log('');
|
|
87
|
+
console.log('This means:');
|
|
88
|
+
console.log('β You are using an old version of node-mac-recorder');
|
|
89
|
+
console.log('β The new macOS 14/13 compatibility is not active');
|
|
90
|
+
console.log('');
|
|
91
|
+
console.log('π§ To fix this:');
|
|
92
|
+
console.log('1. Update to the latest version: npm update node-mac-recorder');
|
|
93
|
+
console.log('2. Or rebuild: npm run build');
|
|
94
|
+
console.log('3. Or reinstall: npm uninstall node-mac-recorder && npm install node-mac-recorder');
|
|
95
|
+
console.log('');
|
|
96
|
+
console.log('Expected NEW error message should be:');
|
|
97
|
+
console.log('"Recording failed to start. Check permissions, output path, and system compatibility."');
|
|
98
|
+
} else {
|
|
99
|
+
console.log('β
Error message is updated (good sign)');
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Reset environment
|
|
104
|
+
delete process.env.FORCE_AVFOUNDATION;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
testMacOS14Scenario();
|