Skip to content

Commit

Permalink
make s3 optional so that it does not need to be definitely assigned i…
Browse files Browse the repository at this point in the history
…n constructor
  • Loading branch information
becky-gilbert committed Jun 4, 2024
1 parent 1f44080 commit 391e315
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/record/src/recorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getFilename } from "./utils";
export default class Recorder {
private blobs: Blob[] = [];
private localDownload: boolean = false;
private s3: lookitS3;
private s3?: lookitS3;
private filename: string;

/**
Expand Down Expand Up @@ -65,7 +65,7 @@ export default class Recorder {
this.recorder.addEventListener("dataavailable", this.handleDataAvailable);
this.recorder.addEventListener("stop", this.handleStop);
if (!this.localDownload) {
await this.s3.createUpload();
await this.s3?.createUpload();
}
this.recorder.start();
}
Expand All @@ -88,7 +88,7 @@ export default class Recorder {
if (this.localDownload) {
await this.download();
} else {
await this.s3.completeUpload();
await this.s3?.completeUpload();
}
}

Expand All @@ -100,7 +100,7 @@ export default class Recorder {
private handleDataAvailable(event: BlobEvent) {
this.blobs.push(event.data);
if (!this.localDownload) {
this.s3.onDataAvailable(event.data);
this.s3?.onDataAvailable(event.data);
}
}

Expand Down

0 comments on commit 391e315

Please sign in to comment.