diff --git a/Package.resolved b/Package.resolved index 4bbef0a..3684df1 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,7 +6,7 @@ "location" : "https://github.com/wulkano/Aperture", "state" : { "branch" : "george/rewrite-in-screen-capture-kit", - "revision" : "ac1febd90238b0bbd1989beac2d7db3a4ca20f41" + "revision" : "d89d3e4b827b1e284388788976be79e3ee3cb798" } }, { diff --git a/Sources/ApertureNode/ApertureNode.swift b/Sources/ApertureNode/ApertureNode.swift index 76fb4aa..c450d02 100644 --- a/Sources/ApertureNode/ApertureNode.swift +++ b/Sources/ApertureNode/ApertureNode.swift @@ -18,7 +18,7 @@ import AVFoundation @NodeActor @NodeMethod - func startRecording(_ targetString: NodeString, _ options: NodeObject) async throws { + func start(_ targetString: NodeString, _ options: NodeObject) async throws { let target: Aperture.Target switch try targetString.string() { @@ -34,13 +34,13 @@ import AVFoundation throw try NodeError(code: nil, message: "Invalid value provided for target. screen, window, audioOnly or externalDevice expected.") } - try await self.recorder.startRecording(target: target, options: options.asOptions()) + try await self.recorder.start(target: target, options: options.asOptions()) } @NodeActor @NodeMethod - func stopRecording() async throws { - try await self.recorder.stopRecording() + func stop() async throws { + try await self.recorder.stop() } @NodeActor @@ -280,8 +280,8 @@ extension Aperture.Devices.Window: @retroactive NodeValueConvertible { "id": String(self.id), "title": self.title, "frame": self.frame.nodeValue(), - "applicationName": self.applicationName, - "applicationBundleIdentifier": self.applicationBundleIdentifier, + "appName": self.appName, + "appBundleIdentifier": self.appBundleIdentifier, "isActive": self.isActive, "isOnScreen": self.isOnScreen, "layer": self.layer diff --git a/index.d.ts b/index.d.ts index c54b93d..79df197 100644 --- a/index.d.ts +++ b/index.d.ts @@ -18,8 +18,8 @@ export type Screen = { export type Window = { id: string; title?: string; - applicationName?: string; - applicationBundleIdentifier?: string; + appName?: string; + appBundleIdentifier?: string; isActive: boolean; isOnScreen: boolean; layer: number; diff --git a/index.js b/index.js index 3527c69..ed8f6b9 100644 --- a/index.js +++ b/index.js @@ -46,7 +46,7 @@ export class Recorder { losslessAudio, systemAudio, }) { - return this._startRecording('audio', { + return this._startRecording('audioOnly', { audioDeviceId, losslessAudio, systemAudio, @@ -95,7 +95,7 @@ export class Recorder { finalOptions.microphoneDeviceID = recorderOptions.audioDeviceId; } - await this.recorder.startRecording(targetType === 'audio' ? 'audioOnly' : targetType, finalOptions); + await this.recorder.start(targetType, finalOptions); } throwIfNotStarted() { @@ -121,7 +121,7 @@ export class Recorder { async stopRecording() { this.throwIfNotStarted(); - await this.recorder.stopRecording(); + await this.recorder.stop(); delete this.recorder; delete this.isFileReady; diff --git a/utils.js b/utils.js index 539e5c8..ddb5576 100644 --- a/utils.js +++ b/utils.js @@ -55,7 +55,7 @@ export function normalizeOptions(targetType, { recordSystemAudio: systemAudio, }; - if (videoCodec && targetType !== 'audio') { + if (videoCodec && targetType !== 'audioOnly') { const codecMap = new Map([ ['h264', ['mp4', 'mov', 'm4v']], ['hevc', ['mp4', 'mov', 'm4v']], @@ -81,7 +81,7 @@ export function normalizeOptions(targetType, { } const temporaryPath = temporaryFile({ - extension: targetType === 'audio' ? 'm4a' : extension, + extension: targetType === 'audioOnly' ? 'm4a' : extension, }); recorderOptions.destination = fileUrl(temporaryPath);