node-mac-recorder 2.16.10 โ 2.16.12
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 +1 -1
- package/CLAUDE.md +51 -3
- package/package.json +1 -1
- package/src/avfoundation_recorder.mm +85 -55
- package/src/mac_recorder.mm +49 -57
- package/bring-to-front-test.js +0 -159
- package/capture-test.js +0 -87
- package/cursor-test.js +0 -22
- package/debug-test.js +0 -95
- package/default-auto-front-test.js +0 -86
- package/final-multi-display-test.js +0 -74
- package/list-test.js +0 -46
- package/quick-cursor-test.js +0 -20
- package/quick-screen-test.js +0 -34
- package/quick-test.js +0 -35
- package/system-sound-test.js +0 -46
- package/test-audio-controls.js +0 -104
- package/test-both.js +0 -46
- package/test-console-logs.js +0 -81
- package/test-coordinate-debug.js +0 -25
- package/test-cursor-visible.js +0 -41
- package/test-electron-detection.js +0 -44
- package/test-final-coordinate-fix.js +0 -38
- package/test-hybrid.js +0 -53
- package/test-macos14-forced.js +0 -107
- package/test-macos14.js +0 -56
- package/test-multi-display-overlay.js +0 -185
- package/test-multi-screen-selection.js +0 -171
- package/test-multidisplay-fix.js +0 -120
- package/test-native-cursor.js +0 -31
- package/test-overlay-tracking.js +0 -175
- package/test-primary-live.js +0 -17
- package/test-primary-window-debug.js +0 -33
- package/test-quick.js +0 -55
- package/test-real-screen-ids.js +0 -32
- package/test-screencapture-only.js +0 -50
- package/test-screencapture-pure.js +0 -69
- package/test-screencapture.js +0 -52
- package/test-system-audio.js +0 -104
- package/test-window-selector-fix.js +0 -88
- package/window-selector-test.js +0 -160
package/test-primary-live.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const MacRecorder = require('./index');
|
|
2
|
-
const WindowSelector = MacRecorder.WindowSelector;
|
|
3
|
-
|
|
4
|
-
console.log('๐ฅ LIVE Primary Display Test - Move cursor NOW!');
|
|
5
|
-
console.log(' - Quickly move to primary display windows');
|
|
6
|
-
console.log(' - Look for [PRIMARY] tags in logs');
|
|
7
|
-
|
|
8
|
-
const selector = new WindowSelector();
|
|
9
|
-
|
|
10
|
-
selector.startSelection().then(() => {
|
|
11
|
-
// Auto-stop after 8 seconds
|
|
12
|
-
setTimeout(() => {
|
|
13
|
-
selector.stopSelection().then(() => {
|
|
14
|
-
process.exit(0);
|
|
15
|
-
});
|
|
16
|
-
}, 8000);
|
|
17
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
const MacRecorder = require('./index');
|
|
2
|
-
const WindowSelector = MacRecorder.WindowSelector;
|
|
3
|
-
|
|
4
|
-
async function testPrimaryWindowDebug() {
|
|
5
|
-
console.log('๐ Testing PRIMARY display window debugging...');
|
|
6
|
-
|
|
7
|
-
const recorder = new MacRecorder();
|
|
8
|
-
const displays = await recorder.getDisplays();
|
|
9
|
-
|
|
10
|
-
const primary = displays.find(d => d.isPrimary);
|
|
11
|
-
console.log(`Primary display: ${primary.name} at (${primary.x}, ${primary.y}) ${primary.width}x${primary.height}`);
|
|
12
|
-
|
|
13
|
-
const selector = new WindowSelector();
|
|
14
|
-
|
|
15
|
-
try {
|
|
16
|
-
console.log('๐ Starting window selection...');
|
|
17
|
-
console.log('๐ IMPORTANT: Move cursor to a window ON THE PRIMARY DISPLAY');
|
|
18
|
-
console.log(' - Look for windows at coordinates like (0, 50) or (100, 100)');
|
|
19
|
-
console.log(' - Should see GlobalOffset: (3440, 56) for primary display');
|
|
20
|
-
|
|
21
|
-
await selector.startSelection();
|
|
22
|
-
|
|
23
|
-
// Let it run for 15 seconds to catch primary display windows
|
|
24
|
-
await new Promise(resolve => setTimeout(resolve, 15000));
|
|
25
|
-
|
|
26
|
-
await selector.stopSelection();
|
|
27
|
-
|
|
28
|
-
} catch (error) {
|
|
29
|
-
console.log(`โ Test failed: ${error.message}`);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
testPrimaryWindowDebug();
|
package/test-quick.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
const MacRecorder = require('./index');
|
|
2
|
-
|
|
3
|
-
// Test video creation in Node.js
|
|
4
|
-
// process.env.ELECTRON_RUN_AS_NODE = '1';
|
|
5
|
-
|
|
6
|
-
console.log('๐ฏ Quick ScreenCaptureKit Test');
|
|
7
|
-
|
|
8
|
-
async function quickTest() {
|
|
9
|
-
const recorder = new MacRecorder();
|
|
10
|
-
|
|
11
|
-
try {
|
|
12
|
-
const outputPath = './test-output/quick-test.mov';
|
|
13
|
-
|
|
14
|
-
console.log('๐น Starting recording...');
|
|
15
|
-
const result = await recorder.startRecording(outputPath, {
|
|
16
|
-
captureCursor: true,
|
|
17
|
-
includeMicrophone: false,
|
|
18
|
-
includeSystemAudio: false
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
if (result) {
|
|
22
|
-
console.log('โ
Recording started successfully');
|
|
23
|
-
|
|
24
|
-
// Record for only 3 seconds
|
|
25
|
-
console.log('โฑ๏ธ Recording for 3 seconds...');
|
|
26
|
-
await new Promise(resolve => setTimeout(resolve, 3000));
|
|
27
|
-
|
|
28
|
-
console.log('๐ Stopping recording...');
|
|
29
|
-
await recorder.stopRecording();
|
|
30
|
-
|
|
31
|
-
// Check if file exists and has content
|
|
32
|
-
const fs = require('fs');
|
|
33
|
-
setTimeout(() => {
|
|
34
|
-
if (fs.existsSync(outputPath)) {
|
|
35
|
-
const stats = fs.statSync(outputPath);
|
|
36
|
-
console.log(`โ
Video file: ${outputPath} (${stats.size} bytes)`);
|
|
37
|
-
|
|
38
|
-
if (stats.size > 1000) {
|
|
39
|
-
console.log('๐ SUCCESS! ScreenCaptureKit is working!');
|
|
40
|
-
} else {
|
|
41
|
-
console.log('โ ๏ธ File too small');
|
|
42
|
-
}
|
|
43
|
-
} else {
|
|
44
|
-
console.log('โ No output file');
|
|
45
|
-
}
|
|
46
|
-
}, 2000);
|
|
47
|
-
} else {
|
|
48
|
-
console.log('โ Failed to start recording');
|
|
49
|
-
}
|
|
50
|
-
} catch (error) {
|
|
51
|
-
console.log('โ Error:', error.message);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
quickTest().catch(console.error);
|
package/test-real-screen-ids.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const WindowSelector = require('./window-selector');
|
|
4
|
-
|
|
5
|
-
async function testRealScreenIDs() {
|
|
6
|
-
console.log('Testing real screen ID generation...\n');
|
|
7
|
-
|
|
8
|
-
const selector = new WindowSelector();
|
|
9
|
-
|
|
10
|
-
// Start screen selection to generate screen info
|
|
11
|
-
console.log('Starting screen selection (will timeout in 3 seconds)...');
|
|
12
|
-
|
|
13
|
-
const startPromise = selector.startScreenSelection();
|
|
14
|
-
|
|
15
|
-
// Wait a bit for screen info to be generated
|
|
16
|
-
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
17
|
-
|
|
18
|
-
// Try to get selected screen info (should be null since nothing selected)
|
|
19
|
-
const selectedInfo = selector.getSelectedScreen();
|
|
20
|
-
console.log('Selected screen info (should be null):', selectedInfo);
|
|
21
|
-
|
|
22
|
-
// Clean up
|
|
23
|
-
try {
|
|
24
|
-
await selector.stopScreenSelection();
|
|
25
|
-
} catch (e) {
|
|
26
|
-
// Ignore
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
console.log('\nTest completed. Check logs above for screen creation details.');
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
testRealScreenIDs().catch(console.error);
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
const MacRecorder = require('./index');
|
|
2
|
-
|
|
3
|
-
console.log('๐ฏ Testing PURE ScreenCaptureKit (No AVFoundation)');
|
|
4
|
-
|
|
5
|
-
async function testScreenCaptureKitOnly() {
|
|
6
|
-
const recorder = new MacRecorder();
|
|
7
|
-
|
|
8
|
-
try {
|
|
9
|
-
const outputPath = './test-output/screencapturekit-only-test.mov';
|
|
10
|
-
|
|
11
|
-
console.log('๐น Starting ScreenCaptureKit-only recording...');
|
|
12
|
-
const success = await recorder.startRecording(outputPath, {
|
|
13
|
-
captureCursor: true,
|
|
14
|
-
includeMicrophone: false,
|
|
15
|
-
includeSystemAudio: false
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
if (success) {
|
|
19
|
-
console.log('โ
Recording started successfully');
|
|
20
|
-
|
|
21
|
-
// Record for 5 seconds
|
|
22
|
-
console.log('โฑ๏ธ Recording for 5 seconds...');
|
|
23
|
-
await new Promise(resolve => setTimeout(resolve, 5000));
|
|
24
|
-
|
|
25
|
-
console.log('๐ Stopping recording...');
|
|
26
|
-
await recorder.stopRecording();
|
|
27
|
-
|
|
28
|
-
// Check if file exists and has content
|
|
29
|
-
const fs = require('fs');
|
|
30
|
-
if (fs.existsSync(outputPath)) {
|
|
31
|
-
const stats = fs.statSync(outputPath);
|
|
32
|
-
console.log(`โ
Video file created: ${outputPath} (${stats.size} bytes)`);
|
|
33
|
-
|
|
34
|
-
if (stats.size > 1000) {
|
|
35
|
-
console.log('โ
ScreenCaptureKit-only recording successful');
|
|
36
|
-
} else {
|
|
37
|
-
console.log('โ ๏ธ File size is very small');
|
|
38
|
-
}
|
|
39
|
-
} else {
|
|
40
|
-
console.log('โ Video file not found');
|
|
41
|
-
}
|
|
42
|
-
} else {
|
|
43
|
-
console.log('โ Failed to start recording');
|
|
44
|
-
}
|
|
45
|
-
} catch (error) {
|
|
46
|
-
console.log('โ Error during test:', error.message);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
testScreenCaptureKitOnly().catch(console.error);
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
const MacRecorder = require('./index');
|
|
2
|
-
|
|
3
|
-
// Simulate Electron environment
|
|
4
|
-
process.env.ELECTRON_RUN_AS_NODE = '1';
|
|
5
|
-
|
|
6
|
-
console.log('๐ฏ Testing PURE ScreenCaptureKit (Ultra-Safe for Electron)');
|
|
7
|
-
|
|
8
|
-
async function testPureScreenCaptureKit() {
|
|
9
|
-
const recorder = new MacRecorder();
|
|
10
|
-
|
|
11
|
-
try {
|
|
12
|
-
const outputPath = './test-output/screencapturekit-pure-test.mov';
|
|
13
|
-
|
|
14
|
-
console.log('๐น Starting PURE ScreenCaptureKit recording...');
|
|
15
|
-
const result = await recorder.startRecording(outputPath, {
|
|
16
|
-
captureCursor: true,
|
|
17
|
-
includeMicrophone: false,
|
|
18
|
-
includeSystemAudio: false
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
if (result) {
|
|
22
|
-
console.log('โ
Recording started successfully');
|
|
23
|
-
|
|
24
|
-
// Record for 10 seconds to get more frames
|
|
25
|
-
console.log('โฑ๏ธ Recording for 10 seconds...');
|
|
26
|
-
await new Promise(resolve => setTimeout(resolve, 10000));
|
|
27
|
-
|
|
28
|
-
console.log('๐ Stopping recording...');
|
|
29
|
-
await recorder.stopRecording();
|
|
30
|
-
|
|
31
|
-
// Check if file exists and has content
|
|
32
|
-
const fs = require('fs');
|
|
33
|
-
if (fs.existsSync(outputPath)) {
|
|
34
|
-
const stats = fs.statSync(outputPath);
|
|
35
|
-
console.log(`โ
Video file created: ${outputPath} (${stats.size} bytes)`);
|
|
36
|
-
|
|
37
|
-
if (stats.size > 10000) {
|
|
38
|
-
console.log('โ
PURE ScreenCaptureKit successful - Real video!');
|
|
39
|
-
|
|
40
|
-
// Try to get more info about the video
|
|
41
|
-
setTimeout(() => {
|
|
42
|
-
const { spawn } = require('child_process');
|
|
43
|
-
const ffprobe = spawn('ffprobe', ['-v', 'quiet', '-print_format', 'json', '-show_format', '-show_streams', outputPath]);
|
|
44
|
-
let output = '';
|
|
45
|
-
ffprobe.stdout.on('data', (data) => output += data);
|
|
46
|
-
ffprobe.on('close', () => {
|
|
47
|
-
try {
|
|
48
|
-
const info = JSON.parse(output);
|
|
49
|
-
console.log(`๐๏ธ Video info: ${info.format.duration}s, ${info.streams[0].nb_frames} frames`);
|
|
50
|
-
} catch (e) {
|
|
51
|
-
console.log('๐ Video analysis failed, but file exists');
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}, 1000);
|
|
55
|
-
} else {
|
|
56
|
-
console.log('โ ๏ธ File size is very small - may not have content');
|
|
57
|
-
}
|
|
58
|
-
} else {
|
|
59
|
-
console.log('โ Video file not found');
|
|
60
|
-
}
|
|
61
|
-
} else {
|
|
62
|
-
console.log('โ Failed to start recording');
|
|
63
|
-
}
|
|
64
|
-
} catch (error) {
|
|
65
|
-
console.log('โ Error during test:', error.message);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
testPureScreenCaptureKit().catch(console.error);
|
package/test-screencapture.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
const MacRecorder = require('./index');
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
|
|
4
|
-
async function testScreenCaptureKit() {
|
|
5
|
-
const recorder = new MacRecorder();
|
|
6
|
-
|
|
7
|
-
console.log('๐ Testing ScreenCaptureKit Integration');
|
|
8
|
-
|
|
9
|
-
try {
|
|
10
|
-
// Check if we can start recording
|
|
11
|
-
const outputPath = './test-output/screencapturekit-test.mov';
|
|
12
|
-
|
|
13
|
-
console.log('๐น Starting recording with ScreenCaptureKit...');
|
|
14
|
-
const success = await recorder.startRecording(outputPath, {
|
|
15
|
-
captureCursor: true,
|
|
16
|
-
includeMicrophone: false,
|
|
17
|
-
includeSystemAudio: false
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
if (success) {
|
|
21
|
-
console.log('โ
Recording started successfully');
|
|
22
|
-
|
|
23
|
-
// Record for 5 seconds
|
|
24
|
-
console.log('โฑ๏ธ Recording for 5 seconds...');
|
|
25
|
-
await new Promise(resolve => setTimeout(resolve, 5000));
|
|
26
|
-
|
|
27
|
-
console.log('๐ Stopping recording...');
|
|
28
|
-
await recorder.stopRecording();
|
|
29
|
-
|
|
30
|
-
// Check if file exists and has content
|
|
31
|
-
if (fs.existsSync(outputPath)) {
|
|
32
|
-
const stats = fs.statSync(outputPath);
|
|
33
|
-
console.log(`โ
Video file created: ${outputPath} (${stats.size} bytes)`);
|
|
34
|
-
|
|
35
|
-
if (stats.size > 1000) {
|
|
36
|
-
console.log('โ
File size looks good - recording likely successful');
|
|
37
|
-
} else {
|
|
38
|
-
console.log('โ ๏ธ File size is very small - recording may have failed');
|
|
39
|
-
}
|
|
40
|
-
} else {
|
|
41
|
-
console.log('โ Video file not found');
|
|
42
|
-
}
|
|
43
|
-
} else {
|
|
44
|
-
console.log('โ Failed to start recording');
|
|
45
|
-
}
|
|
46
|
-
} catch (error) {
|
|
47
|
-
console.log('โ Error during test:', error.message);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Run test
|
|
52
|
-
testScreenCaptureKit().catch(console.error);
|
package/test-system-audio.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
const MacRecorder = require('./index');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
async function testSystemAudio() {
|
|
5
|
-
const recorder = new MacRecorder();
|
|
6
|
-
|
|
7
|
-
console.log('๐ต Sistem Sesi Yakalama Testi Baลlฤฑyor...\n');
|
|
8
|
-
|
|
9
|
-
try {
|
|
10
|
-
// รnce izinleri kontrol et
|
|
11
|
-
const permissions = await recorder.checkPermissions();
|
|
12
|
-
console.log('๐ ฤฐzinler:', permissions);
|
|
13
|
-
|
|
14
|
-
if (!permissions.screenRecording) {
|
|
15
|
-
console.log('โ Ekran kayฤฑt izni gerekli. System Preferences > Security & Privacy > Screen Recording');
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Mevcut ses cihazlarฤฑnฤฑ listele
|
|
20
|
-
console.log('\n๐ค Mevcut Ses Cihazlarฤฑ:');
|
|
21
|
-
const audioDevices = await recorder.getAudioDevices();
|
|
22
|
-
audioDevices.forEach((device, index) => {
|
|
23
|
-
console.log(`${index + 1}. ${device.name}`);
|
|
24
|
-
if (device.id) console.log(` ID: ${device.id}`);
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
// Sistem sesi cihazฤฑ ara
|
|
28
|
-
const systemAudioDevice = audioDevices.find(device =>
|
|
29
|
-
device.name.toLowerCase().includes('blackhole') ||
|
|
30
|
-
device.name.toLowerCase().includes('soundflower') ||
|
|
31
|
-
device.name.toLowerCase().includes('loopback') ||
|
|
32
|
-
device.name.toLowerCase().includes('aggregate') ||
|
|
33
|
-
device.name.toLowerCase().includes('imobie')
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
console.log('\n=== Test 1: Sistem Sesi KAPALI ===');
|
|
37
|
-
const outputPath1 = path.join(__dirname, 'test-output', 'no-system-audio.mov');
|
|
38
|
-
|
|
39
|
-
await recorder.startRecording(outputPath1, {
|
|
40
|
-
includeSystemAudio: false, // Sistem sesi kapalฤฑ
|
|
41
|
-
includeMicrophone: false,
|
|
42
|
-
captureCursor: true,
|
|
43
|
-
captureArea: { x: 0, y: 0, width: 400, height: 300 } // Kรผรงรผk alan
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
console.log('๐ด 5 saniye kayฤฑt yapฤฑlฤฑyor (sistem sesi KAPALI)...');
|
|
47
|
-
console.log('๐ก ลimdi mรผzik รงal veya YouTube video aรง - ses KAYIT EDฤฐLMEMELฤฐ');
|
|
48
|
-
|
|
49
|
-
await new Promise(resolve => setTimeout(resolve, 5000));
|
|
50
|
-
await recorder.stopRecording();
|
|
51
|
-
console.log(`โ
Kayฤฑt tamamlandฤฑ: ${outputPath1}`);
|
|
52
|
-
|
|
53
|
-
// 2 saniye bekle
|
|
54
|
-
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
55
|
-
|
|
56
|
-
console.log('\n=== Test 2: Sistem Sesi AรIK ===');
|
|
57
|
-
const outputPath2 = path.join(__dirname, 'test-output', 'with-system-audio.mov');
|
|
58
|
-
|
|
59
|
-
const options2 = {
|
|
60
|
-
includeSystemAudio: true, // Sistem sesi aรงฤฑk
|
|
61
|
-
includeMicrophone: false,
|
|
62
|
-
captureCursor: true,
|
|
63
|
-
captureArea: { x: 0, y: 0, width: 400, height: 300 }
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
// Eฤer sistem sesi cihazฤฑ varsa onu kullan
|
|
67
|
-
if (systemAudioDevice) {
|
|
68
|
-
options2.systemAudioDeviceId = systemAudioDevice.id;
|
|
69
|
-
console.log(`๐ฏ Kullanฤฑlan sistem sesi cihazฤฑ: ${systemAudioDevice.name}`);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
await recorder.startRecording(outputPath2, options2);
|
|
73
|
-
|
|
74
|
-
console.log('๐ด 5 saniye kayฤฑt yapฤฑlฤฑyor (sistem sesi AรIK)...');
|
|
75
|
-
console.log('๐ต ลimdi mรผzik รงal veya YouTube video aรง - ses KAYIT EDฤฐLMELฤฐ');
|
|
76
|
-
|
|
77
|
-
await new Promise(resolve => setTimeout(resolve, 5000));
|
|
78
|
-
await recorder.stopRecording();
|
|
79
|
-
console.log(`โ
Kayฤฑt tamamlandฤฑ: ${outputPath2}`);
|
|
80
|
-
|
|
81
|
-
console.log('\n=== ๐ TEST TAMAMLANDI ===');
|
|
82
|
-
console.log('๐ Kayฤฑtlarฤฑ karลฤฑlaลtฤฑr:');
|
|
83
|
-
console.log(`1. ${outputPath1} (sistem sesi YOK)`);
|
|
84
|
-
console.log(`2. ${outputPath2} (sistem sesi VAR)`);
|
|
85
|
-
|
|
86
|
-
if (!systemAudioDevice) {
|
|
87
|
-
console.log('\nโ ๏ธ Sistem sesi cihazฤฑ bulunamadฤฑ!');
|
|
88
|
-
console.log('๐ก Daha iyi sistem sesi yakalama iรงin ลunlarฤฑ yรผkle:');
|
|
89
|
-
console.log(' โข BlackHole: https://github.com/ExistentialAudio/BlackHole');
|
|
90
|
-
console.log(' โข Soundflower: https://github.com/mattingalls/Soundflower');
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
console.log('\n๐ Kayฤฑtlarฤฑ test etmek iรงin:');
|
|
94
|
-
console.log('1. Dosyalarฤฑ QuickTime Player ile aรง');
|
|
95
|
-
console.log('2. ฤฐlk kayฤฑtta ses olmamalฤฑ');
|
|
96
|
-
console.log('3. ฤฐkinci kayฤฑtta sistem sesi olmalฤฑ');
|
|
97
|
-
|
|
98
|
-
} catch (error) {
|
|
99
|
-
console.error('โ Test hatasฤฑ:', error.message);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// Testi รงalฤฑลtฤฑr
|
|
104
|
-
testSystemAudio();
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
const MacRecorder = require('./index');
|
|
2
|
-
const WindowSelector = MacRecorder.WindowSelector;
|
|
3
|
-
|
|
4
|
-
async function testWindowSelector() {
|
|
5
|
-
console.log('๐ช Testing FIXED window selector multi-display...');
|
|
6
|
-
|
|
7
|
-
const recorder = new MacRecorder();
|
|
8
|
-
const displays = await recorder.getDisplays();
|
|
9
|
-
|
|
10
|
-
console.log('๐ Display setup:');
|
|
11
|
-
displays.forEach((display, index) => {
|
|
12
|
-
console.log(` ${display.name}: ${display.resolution} at (${display.x}, ${display.y}) ${display.isPrimary ? '[PRIMARY]' : ''}`);
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const selector = new WindowSelector();
|
|
16
|
-
|
|
17
|
-
try {
|
|
18
|
-
console.log('\n๐ Starting window selection...');
|
|
19
|
-
console.log(' - Test windows on BOTH displays');
|
|
20
|
-
console.log(' - Check if buttons appear correctly positioned');
|
|
21
|
-
console.log(' - Primary display should now work correctly');
|
|
22
|
-
|
|
23
|
-
await selector.startSelection();
|
|
24
|
-
|
|
25
|
-
// Let it run for 20 seconds for thorough testing
|
|
26
|
-
await new Promise(resolve => setTimeout(resolve, 20000));
|
|
27
|
-
|
|
28
|
-
console.log('๐ Stopping window selection...');
|
|
29
|
-
await selector.stopSelection();
|
|
30
|
-
|
|
31
|
-
console.log('โ
Window selector test completed!');
|
|
32
|
-
|
|
33
|
-
} catch (error) {
|
|
34
|
-
console.log(`โ Window selector test failed: ${error.message}`);
|
|
35
|
-
console.log(error.stack);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
async function testSecondaryDisplayRecording() {
|
|
40
|
-
console.log('\n๐ฅ Testing secondary display recording...');
|
|
41
|
-
|
|
42
|
-
const recorder = new MacRecorder();
|
|
43
|
-
const displays = await recorder.getDisplays();
|
|
44
|
-
|
|
45
|
-
const secondaryDisplay = displays.find(d => !d.isPrimary);
|
|
46
|
-
if (!secondaryDisplay) {
|
|
47
|
-
console.log('โ ๏ธ No secondary display found');
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
console.log(`๐ฅ๏ธ Testing recording on ${secondaryDisplay.name} (ID: ${secondaryDisplay.id})`);
|
|
52
|
-
|
|
53
|
-
try {
|
|
54
|
-
const outputPath = `./test-output/secondary-display-fix-test.mov`;
|
|
55
|
-
|
|
56
|
-
await recorder.startRecording(outputPath, {
|
|
57
|
-
displayId: secondaryDisplay.id,
|
|
58
|
-
captureCursor: true,
|
|
59
|
-
includeMicrophone: false,
|
|
60
|
-
includeSystemAudio: false
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
console.log('โ
Recording started on secondary display');
|
|
64
|
-
|
|
65
|
-
// Record for 3 seconds
|
|
66
|
-
await new Promise(resolve => setTimeout(resolve, 3000));
|
|
67
|
-
|
|
68
|
-
await recorder.stopRecording();
|
|
69
|
-
console.log('โ
Recording completed on secondary display');
|
|
70
|
-
|
|
71
|
-
} catch (error) {
|
|
72
|
-
console.log(`โ Secondary display recording failed: ${error.message}`);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
async function runTests() {
|
|
77
|
-
try {
|
|
78
|
-
await testWindowSelector();
|
|
79
|
-
await testSecondaryDisplayRecording();
|
|
80
|
-
|
|
81
|
-
console.log('\n๐ All tests completed!');
|
|
82
|
-
|
|
83
|
-
} catch (error) {
|
|
84
|
-
console.log(`โ Test suite failed: ${error.message}`);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
runTests();
|
package/window-selector-test.js
DELETED
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const WindowSelector = require('./window-selector');
|
|
4
|
-
const readline = require('readline');
|
|
5
|
-
|
|
6
|
-
async function main() {
|
|
7
|
-
console.log('๐ Window Selector Test');
|
|
8
|
-
console.log('=======================\n');
|
|
9
|
-
|
|
10
|
-
const selector = new WindowSelector();
|
|
11
|
-
|
|
12
|
-
try {
|
|
13
|
-
// Permissions kontrolรผ
|
|
14
|
-
console.log('1๏ธโฃ Checking permissions...');
|
|
15
|
-
const permissions = await selector.checkPermissions();
|
|
16
|
-
console.log('Permissions:', permissions);
|
|
17
|
-
|
|
18
|
-
if (!permissions.screenRecording || !permissions.accessibility) {
|
|
19
|
-
console.warn('โ ๏ธ Warning: Some permissions missing. Go to System Preferences > Security & Privacy');
|
|
20
|
-
console.warn(' - Privacy > Screen Recording: Enable for Terminal/Node');
|
|
21
|
-
console.warn(' - Privacy > Accessibility: Enable for Terminal/Node');
|
|
22
|
-
console.log();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Event listener'larฤฑ ayarla
|
|
26
|
-
selector.on('selectionStarted', () => {
|
|
27
|
-
console.log('โ
Window selection started');
|
|
28
|
-
console.log('๐ฑ๏ธ Move your cursor over windows to highlight them');
|
|
29
|
-
console.log('๐ฏ Click "Select Window" button to choose a window');
|
|
30
|
-
console.log('โ Press Ctrl+C to cancel\n');
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
selector.on('windowEntered', (window) => {
|
|
34
|
-
console.log(`๐ Entered window: "${window.title}" - ${window.appName}`);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
selector.on('windowLeft', (window) => {
|
|
38
|
-
console.log(`๐ช Left window: "${window.title}" - ${window.appName}`);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
selector.on('windowSelected', (windowInfo) => {
|
|
42
|
-
console.log('\n๐ Window Selected!');
|
|
43
|
-
console.log('==================');
|
|
44
|
-
console.log(`Title: "${windowInfo.title}"`);
|
|
45
|
-
console.log(`Application: ${windowInfo.appName}`);
|
|
46
|
-
console.log(`Position: (${windowInfo.x}, ${windowInfo.y})`);
|
|
47
|
-
console.log(`Size: ${windowInfo.width} x ${windowInfo.height}`);
|
|
48
|
-
console.log(`Screen ID: ${windowInfo.screenId}`);
|
|
49
|
-
console.log(`Screen Position: (${windowInfo.screenX}, ${windowInfo.screenY})`);
|
|
50
|
-
console.log(`Screen Size: ${windowInfo.screenWidth} x ${windowInfo.screenHeight}`);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
selector.on('selectionStopped', () => {
|
|
54
|
-
console.log('๐ Window selection stopped');
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
selector.on('error', (error) => {
|
|
58
|
-
console.error('โ Error:', error.message);
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
// Ctrl+C handler
|
|
62
|
-
process.on('SIGINT', async () => {
|
|
63
|
-
console.log('\n\n๐ Stopping window selection...');
|
|
64
|
-
await selector.cleanup();
|
|
65
|
-
process.exit(0);
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
console.log('2๏ธโฃ Testing window selection...\n');
|
|
69
|
-
|
|
70
|
-
// Seรงim baลlat
|
|
71
|
-
const selectedWindow = await selector.selectWindow();
|
|
72
|
-
|
|
73
|
-
if (selectedWindow) {
|
|
74
|
-
console.log('\nโจ Final result:');
|
|
75
|
-
console.log(JSON.stringify(selectedWindow, null, 2));
|
|
76
|
-
|
|
77
|
-
// Ek bilgiler
|
|
78
|
-
console.log('\n๐ Additional Analysis:');
|
|
79
|
-
console.log(`Window area: ${selectedWindow.width * selectedWindow.height} pixels`);
|
|
80
|
-
console.log(`Aspect ratio: ${(selectedWindow.width / selectedWindow.height).toFixed(2)}`);
|
|
81
|
-
|
|
82
|
-
// Window bounds relative to screen
|
|
83
|
-
const relativeX = selectedWindow.x - selectedWindow.screenX;
|
|
84
|
-
const relativeY = selectedWindow.y - selectedWindow.screenY;
|
|
85
|
-
console.log(`Relative position on screen: (${relativeX}, ${relativeY})`);
|
|
86
|
-
|
|
87
|
-
if (relativeX < 0 || relativeY < 0 ||
|
|
88
|
-
relativeX + selectedWindow.width > selectedWindow.screenWidth ||
|
|
89
|
-
relativeY + selectedWindow.height > selectedWindow.screenHeight) {
|
|
90
|
-
console.log('โ ๏ธ Window extends beyond screen boundaries (multi-monitor setup)');
|
|
91
|
-
} else {
|
|
92
|
-
console.log('โ
Window is fully contained within its screen');
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
} catch (error) {
|
|
97
|
-
console.error('โ Test failed:', error.message);
|
|
98
|
-
console.error(error.stack);
|
|
99
|
-
} finally {
|
|
100
|
-
await selector.cleanup();
|
|
101
|
-
console.log('\n๐งน Cleanup completed');
|
|
102
|
-
process.exit(0);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// Alternative test function for programmatic testing
|
|
107
|
-
async function testWindowSelectorAPI() {
|
|
108
|
-
console.log('๐งช API Test Mode');
|
|
109
|
-
console.log('===============\n');
|
|
110
|
-
|
|
111
|
-
const selector = new WindowSelector();
|
|
112
|
-
|
|
113
|
-
try {
|
|
114
|
-
// Test 1: Status before selection
|
|
115
|
-
console.log('Test 1: Initial status');
|
|
116
|
-
const initialStatus = selector.getStatus();
|
|
117
|
-
console.log('Initial status:', initialStatus);
|
|
118
|
-
console.assert(!initialStatus.isSelecting, 'Should not be selecting initially');
|
|
119
|
-
console.assert(!initialStatus.hasSelectedWindow, 'Should not have selected window initially');
|
|
120
|
-
console.log('โ
Initial status test passed\n');
|
|
121
|
-
|
|
122
|
-
// Test 2: Start selection
|
|
123
|
-
console.log('Test 2: Start selection');
|
|
124
|
-
await selector.startSelection();
|
|
125
|
-
const selectingStatus = selector.getStatus();
|
|
126
|
-
console.log('Selecting status:', selectingStatus);
|
|
127
|
-
console.assert(selectingStatus.isSelecting, 'Should be selecting after start');
|
|
128
|
-
console.log('โ
Start selection test passed\n');
|
|
129
|
-
|
|
130
|
-
// Wait a bit to let user move cursor
|
|
131
|
-
console.log('Move your cursor over different windows for 3 seconds...');
|
|
132
|
-
await new Promise(resolve => setTimeout(resolve, 3000));
|
|
133
|
-
|
|
134
|
-
// Test 3: Stop selection
|
|
135
|
-
console.log('Test 3: Stop selection');
|
|
136
|
-
await selector.stopSelection();
|
|
137
|
-
const stoppedStatus = selector.getStatus();
|
|
138
|
-
console.log('Stopped status:', stoppedStatus);
|
|
139
|
-
console.assert(!stoppedStatus.isSelecting, 'Should not be selecting after stop');
|
|
140
|
-
console.log('โ
Stop selection test passed\n');
|
|
141
|
-
|
|
142
|
-
console.log('๐ All API tests passed!');
|
|
143
|
-
|
|
144
|
-
} catch (error) {
|
|
145
|
-
console.error('โ API test failed:', error.message);
|
|
146
|
-
throw error;
|
|
147
|
-
} finally {
|
|
148
|
-
await selector.cleanup();
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// Parse command line arguments
|
|
153
|
-
const args = process.argv.slice(2);
|
|
154
|
-
const testMode = args.includes('--api-test') ? 'api' : 'interactive';
|
|
155
|
-
|
|
156
|
-
if (testMode === 'api') {
|
|
157
|
-
testWindowSelectorAPI().catch(console.error);
|
|
158
|
-
} else {
|
|
159
|
-
main().catch(console.error);
|
|
160
|
-
}
|