Skip to content

Commit

Permalink
Fix some errors and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
karaggeorge committed Nov 22, 2024
1 parent a6b14d7 commit 9799d31
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class Recorder {

throwIfNotStarted() {
if (this.recorder === undefined) {
throw new Error('Call `.startRecording()` first');
throw new Error('Recording not started yet');
}
}

Expand Down
17 changes: 17 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,23 @@ A computer with Intel 6th generation processor or newer is strongly recommended

The [`proRes422` and `proRes4444`](https://documentation.apple.com/en/finalcutpro/professionalformatsandworkflows/index.html#chapter=10%26section=2%26tasks=true) codecs are uncompressed data. They will create huge files.

##### extension

Type: `string`\
Default:

- `'m4a'` for [audio](#recorderstartrecordingaudiooptions) recordings
- `'mov'` for `proRes422` and `proRes4444` video codecs
- `'mp4'` otherwise

Values:

- `'m4a'` is the only valid option for [audio](#recorderstartrecordingaudiooptions) recordings
- `'mov'` is the only valid option for `proRes422` and `proRes4444` video codecs
- `'mp4' | 'm4v' | 'mov'` for all other video codecs

The extension of the output file

#### recorder

#### recorder.startRecordingScreen(options)
Expand Down
4 changes: 4 additions & 0 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ export function normalizeOptions(targetType, {
recorderOptions.videoCodec = videoCodec;
}

if (targetType === 'audioOnly' && extension !== 'm4a') {
throw new Error('Audio recordings only supports the m4a extension');
}

const temporaryPath = temporaryFile({
extension: targetType === 'audioOnly' ? 'm4a' : extension,
});
Expand Down

0 comments on commit 9799d31

Please sign in to comment.