Skip to content

Commit

Permalink
feat(lib): add native API for progressive upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultBee committed Mar 28, 2024
1 parent 61824ee commit 6a03ec0
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/NativeApiVideoUploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,27 @@ export interface Spec extends TurboModule {
videoId?: string
) => Promise<String>;
upload: (videoId: string, filepath: string) => Promise<String>;

// Progressive upload
/**
* Create a new session for progressive upload.
* @param sessionId - The session id. Must be unique.
*/
createProgressiveUploadSession: (sessionId: string, videoId: string) => void;
/**
* Create a new session for progressive upload with upload token.
* @param sessionId - The session id. Must be unique.
*/
createProgressiveUploadWithUploadTokenSession: (
sessionId: string,
token: string,
videoId?: string
) => void;

uploadPart: (sessionId: string, filepath: string) => Promise<String>;
uploadLastPart: (sessionId: string, filepath: string) => Promise<String>;

disposeProgressiveUploadSession: (sessionId: string) => void;
}

export default TurboModuleRegistry.getEnforcing<Spec>('ApiVideoUploader');

0 comments on commit 6a03ec0

Please sign in to comment.