@@ -3,6 +3,7 @@ import { PromiseQueue } from "./promise-queue";
3
3
4
4
export interface ProgressiveUploadCommonOptions {
5
5
preventEmptyParts ?: boolean ;
6
+ videoName ?: string
6
7
}
7
8
8
9
export interface ProgressiveUploaderOptionsWithUploadToken extends ProgressiveUploadCommonOptions , CommonOptions , WithUploadToken { }
@@ -25,10 +26,12 @@ export class ProgressiveUploader extends AbstractUploader<ProgressiveProgressEve
25
26
private currentPartBlobsSize = 0 ;
26
27
private queue = new PromiseQueue ( ) ;
27
28
private preventEmptyParts : boolean ;
29
+ private fileName : string ;
28
30
29
31
constructor ( options : ProgressiveUploaderOptionsWithAccessToken | ProgressiveUploaderOptionsWithUploadToken | ProgressiveUploaderOptionsWithApiKey ) {
30
32
super ( options ) ;
31
33
this . preventEmptyParts = options . preventEmptyParts || false ;
34
+ this . fileName = options . videoName || 'file' ;
32
35
}
33
36
34
37
public uploadPart ( file : Blob ) : Promise < void > {
@@ -71,7 +74,7 @@ export class ProgressiveUploader extends AbstractUploader<ProgressiveProgressEve
71
74
private async upload ( file : Blob , isLast : boolean = false ) : Promise < VideoUploadResponse > {
72
75
const fileSize = file . size ;
73
76
return this . xhrWithRetrier ( {
74
- body : this . createFormData ( file , "file" ) ,
77
+ body : this . createFormData ( file , this . fileName ) ,
75
78
parts : {
76
79
currentPart : this . currentPartNum ,
77
80
totalParts : isLast ? this . currentPartNum : '*'
0 commit comments