node-mac-recorder 2.16.4 β 2.16.6
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 +11 -8
- package/test-console-logs.js +81 -0
- package/test-macos14-forced.js +107 -0
|
@@ -48,7 +48,8 @@
|
|
|
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\")"
|
|
52
53
|
],
|
|
53
54
|
"deny": []
|
|
54
55
|
}
|
package/package.json
CHANGED
package/src/mac_recorder.mm
CHANGED
|
@@ -206,7 +206,7 @@ Napi::Value StartRecording(const Napi::CallbackInfo& info) {
|
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
// Use ScreenCaptureKit only on macOS 15+ for maximum stability
|
|
209
|
-
// macOS 14 should use AVFoundation
|
|
209
|
+
// macOS 14/13 should skip ScreenCaptureKit completely and use AVFoundation
|
|
210
210
|
if (@available(macOS 12.3, *) && isM15Plus && !forceAVFoundation) {
|
|
211
211
|
NSLog(@"β
macOS 15+ detected - ScreenCaptureKit available with full compatibility");
|
|
212
212
|
|
|
@@ -280,20 +280,23 @@ 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
|
|
283
|
+
} else if (isM14Plus && !isElectron) {
|
|
284
|
+
// macOS 14 - directly use AVFoundation, skip all ScreenCaptureKit logic
|
|
285
285
|
NSLog(@"π― macOS 14 detected - directly using AVFoundation for better compatibility");
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
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
|
|
289
290
|
NSLog(@"π― macOS 13 detected - directly using AVFoundation (limited features)");
|
|
290
|
-
|
|
291
|
+
NSLog(@"βοΈ Skipping ScreenCaptureKit completely, jumping to AVFoundation");
|
|
292
|
+
goto useAVFoundation;
|
|
291
293
|
} else {
|
|
292
|
-
NSLog(@"β macOS version too old (< 13.0) - Recording not supported");
|
|
294
|
+
NSLog(@"β macOS version too old (< 13.0) or Electron environment - Recording not supported");
|
|
293
295
|
return Napi::Boolean::New(env, false);
|
|
294
296
|
}
|
|
295
297
|
|
|
296
298
|
// AVFoundation fallback logic
|
|
299
|
+
useAVFoundation:
|
|
297
300
|
if (isElectron) {
|
|
298
301
|
NSLog(@"β ScreenCaptureKit failed in Electron - AVFoundation disabled for stability");
|
|
299
302
|
NSLog(@"β Recording not available in Electron when ScreenCaptureKit fails");
|
|
@@ -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();
|