From 38358eed053fe82556744cf691aee1b9a505041d Mon Sep 17 00:00:00 2001 From: olivierapivideo Date: Fri, 10 Nov 2023 13:00:13 +0000 Subject: [PATCH] Add documentation CI --- .../sdks/vod/apivideo-typescript-uploader.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/templates/documentation/sdks/vod/apivideo-typescript-uploader.md b/templates/documentation/sdks/vod/apivideo-typescript-uploader.md index 64386a02..7f138607 100644 --- a/templates/documentation/sdks/vod/apivideo-typescript-uploader.md +++ b/templates/documentation/sdks/vod/apivideo-typescript-uploader.md @@ -5,6 +5,7 @@ meta: --- # api.video TypeScript video uploader +{% include "_partials/view-on-github-button.md" link: "https://github.com/apivideo/api.video-typescript-uploader" %} [api.video](https://api.video/) is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app. @@ -198,6 +199,11 @@ An onProgress event contains the following attributes: - currentChunk (number): index of the chunk being uploaded - currentChunkUploadedBytes (number): number of bytes uploaded for the current chunk +#### `cancel()` + +The cancel() method cancels the upload. It takes no parameter. + + **Example** ```javascript @@ -325,6 +331,7 @@ The onProgress() method let you defined an upload progress listener. It takes a An onProgress event contains the following attributes: - uploadedBytes (number): total number of bytes uploaded for this upload - totalBytes (number): total size of the file +- part (number): index of the part being uploaded **Example** @@ -334,9 +341,14 @@ An onProgress event contains the following attributes: uploader.onProgress((event) => { console.log(`total number of bytes uploaded for this upload: ${event.uploadedBytes}.`); console.log(`total size of the file: ${event.totalBytes}.`); + console.log(`current part: ${event.part}.`); }); ``` +#### `cancel()` + +The cancel() method cancels the upload. It takes no parameter. + #### `onPlayable()` The onPlayable() method let you defined a listener that will be called when the video is playable. It takes a callback function with one parameter: the `video` object returned by the API. @@ -354,4 +366,9 @@ The onPlayable() method let you defined a listener that will be called when the document.getElementById('player-container').innerHTML = v.assets.iframe; }); -``` \ No newline at end of file +``` + + +## Static wrapper + +For situations where managing object instances is impractical, consider using the [UploaderStaticWrapper](https://github.com/apivideo/api.video-typescript-uploader/blob/main/doc/UploaderStaticWrapper.md) class, which offers static method equivalents for all functionalities. \ No newline at end of file