node-mac-recorder 2.12.1 → 2.12.2
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/package.json +1 -1
- package/src/mac_recorder.mm +11 -1
- package/src/screen_capture_kit.mm +23 -1
package/package.json
CHANGED
package/src/mac_recorder.mm
CHANGED
|
@@ -161,8 +161,11 @@ Napi::Value StartRecording(const Napi::CallbackInfo& info) {
|
|
|
161
161
|
|
|
162
162
|
@try {
|
|
163
163
|
// Try ScreenCaptureKit first (macOS 12.3+)
|
|
164
|
+
NSLog(@"🔍 System Version Check - macOS availability for ScreenCaptureKit");
|
|
164
165
|
if (@available(macOS 12.3, *)) {
|
|
166
|
+
NSLog(@"✅ macOS 12.3+ detected - ScreenCaptureKit should be available");
|
|
165
167
|
if ([ScreenCaptureKitRecorder isScreenCaptureKitAvailable]) {
|
|
168
|
+
NSLog(@"✅ ScreenCaptureKit availability check passed");
|
|
166
169
|
NSLog(@"🎯 Using ScreenCaptureKit - overlay windows will be automatically excluded");
|
|
167
170
|
|
|
168
171
|
// Create configuration for ScreenCaptureKit
|
|
@@ -193,9 +196,16 @@ Napi::Value StartRecording(const Napi::CallbackInfo& info) {
|
|
|
193
196
|
g_isRecording = true;
|
|
194
197
|
return Napi::Boolean::New(env, true);
|
|
195
198
|
} else {
|
|
196
|
-
NSLog(@"
|
|
199
|
+
NSLog(@"❌ ScreenCaptureKit failed to start");
|
|
200
|
+
NSLog(@"❌ Error: %@", sckError ? sckError.localizedDescription : @"Unknown error");
|
|
201
|
+
NSLog(@"⚠️ Falling back to AVFoundation");
|
|
197
202
|
}
|
|
203
|
+
} else {
|
|
204
|
+
NSLog(@"❌ ScreenCaptureKit availability check failed");
|
|
205
|
+
NSLog(@"⚠️ Falling back to AVFoundation");
|
|
198
206
|
}
|
|
207
|
+
} else {
|
|
208
|
+
NSLog(@"❌ macOS version too old for ScreenCaptureKit (< 12.3)");
|
|
199
209
|
}
|
|
200
210
|
|
|
201
211
|
// Fallback: Use AVFoundation (older macOS or ScreenCaptureKit failure)
|
|
@@ -19,8 +19,30 @@ static BOOL g_isRecording = NO;
|
|
|
19
19
|
|
|
20
20
|
+ (BOOL)isScreenCaptureKitAvailable {
|
|
21
21
|
if (@available(macOS 12.3, *)) {
|
|
22
|
-
|
|
22
|
+
NSLog(@"🔍 ScreenCaptureKit availability check - macOS 12.3+ confirmed");
|
|
23
|
+
|
|
24
|
+
// Try to access ScreenCaptureKit classes to verify they're actually available
|
|
25
|
+
@try {
|
|
26
|
+
Class scStreamClass = NSClassFromString(@"SCStream");
|
|
27
|
+
Class scContentFilterClass = NSClassFromString(@"SCContentFilter");
|
|
28
|
+
Class scShareableContentClass = NSClassFromString(@"SCShareableContent");
|
|
29
|
+
|
|
30
|
+
if (scStreamClass && scContentFilterClass && scShareableContentClass) {
|
|
31
|
+
NSLog(@"✅ ScreenCaptureKit classes are available");
|
|
32
|
+
return YES;
|
|
33
|
+
} else {
|
|
34
|
+
NSLog(@"❌ ScreenCaptureKit classes not found");
|
|
35
|
+
NSLog(@" SCStream: %@", scStreamClass ? @"✅" : @"❌");
|
|
36
|
+
NSLog(@" SCContentFilter: %@", scContentFilterClass ? @"✅" : @"❌");
|
|
37
|
+
NSLog(@" SCShareableContent: %@", scShareableContentClass ? @"✅" : @"❌");
|
|
38
|
+
return NO;
|
|
39
|
+
}
|
|
40
|
+
} @catch (NSException *exception) {
|
|
41
|
+
NSLog(@"❌ Exception checking ScreenCaptureKit classes: %@", exception.reason);
|
|
42
|
+
return NO;
|
|
43
|
+
}
|
|
23
44
|
}
|
|
45
|
+
NSLog(@"❌ macOS version < 12.3 - ScreenCaptureKit not available");
|
|
24
46
|
return NO;
|
|
25
47
|
}
|
|
26
48
|
|