Skip to content

Commit cca3499

Browse files
committed
feat: throw Error on mergeSmallPartsBeforeUpload = false && current part < 5MB
1 parent fbeaaf8 commit cca3499

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/progressive-video-uploader.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ export class ProgressiveUploader extends AbstractUploader<ProgressiveProgressEve
4343
if ((this.preventEmptyParts && (this.currentPartBlobsSize - file.size >= MIN_CHUNK_SIZE))
4444
|| (!this.preventEmptyParts && (this.currentPartBlobsSize >= MIN_CHUNK_SIZE))
4545
|| (!this.mergeSmallPartsBeforeUpload)) {
46+
47+
if (!this.mergeSmallPartsBeforeUpload && this.currentPartBlobsSize < MIN_CHUNK_SIZE) {
48+
throw new Error(`Each part must have a minimal size of 5MB. The current part has a size of ${this.currentPartBlobsSize / 1024 / 1024}MB.`)
49+
}
4650
let toSend: any[];
4751
if(this.preventEmptyParts) {
4852
toSend = this.currentPartBlobs.slice(0, -1);

0 commit comments

Comments
 (0)