Features
- Video Upload- Handles large video files through multipart upload. Uploads are split into smaller parts, improving stability on slow or unstable networks.
- Progress Tracking- Reports real-time progress as each part uploads. You get uploaded bytes, overall percentage, estimated speed, and expected completion time.
- Drag & Drop- Includes optional helpers for building a drag-and-drop upload zone. Works with standard DOM elements and requires minimal setup.
- Pause and Resume- Upload sessions can be paused at any time. The SDK keeps track of completed parts so the process can resume without starting over.
- Batch Upload- Accepts one or many files in a single call. Each upload runs independently, allowing you to manage or track them individually.
- Secure by Design- Uses short-lived tokens to authenticate requests. Upload endpoints never expose secret keys.
- Customizable- Ships with minimal UI helpers so you can apply your own styling or integrate it into an existing design system.
- Responsive- Supports desktop and mobile environments with no additional configuration.
- Universal Build- Distributed in CommonJS, ESM, and UMD formats. You can use it in modern bundlers, Node.js environments, or direct browser imports.
- TypeScript Support- Full TypeScript support with accurate type definitions for safer and cleaner integration.
Installation
This section provides the installation commands for adding the Vidinfra Uploader SDK to a project usingnpm, yarn, or pnpm. It’s the initial setup step required before using the uploader.
Quick Start
ES Modules (Modern Bundlers)
This section shows how to initialize the Vidinfra Uploader SDK inside a modern JavaScript project. It sets the upload endpoint, JWT token, target element, and metadata. It also listens for a successful upload and logs when the file is complete.UMD (Browser Script Tag)
This code block loads the Vidinfra Uploader in a browser using a script tag, applies the stylesheet, creates an uploader element, and initializes the uploader with the upload endpoint and token.Configuration
This section explains the available settings for the Vidinfra Uploader. It shows the required fields and the optional options you can use to control metadata, upload behavior, and UI targets.Supported File Formats
The Vidinfra Uploader accepts a wide range of video and audio formats. These formats are commonly used across recording tools, editing software, and streaming workflows, ensuring smooth uploads from most devices.Videos
| Format | MIME Type | Details |
|---|---|---|
| .mp4 | video/mp4 | Works on all devices; ideal for streaming and general uploads |
| .mkv | video/x-matroska | High-quality container; supports multiple audio tracks and subtitles |
| .mov | video/quicktime | Apple format; common in editing workflows and camera exports |
| .avi | video/x-msvideo | Older Windows format; used for legacy video sources |
Audio
| Format | MIME Type | Details |
|---|---|---|
| .mp3 | audio/mpeg | Most common compressed audio format; widely supported |
| .wav | audio/wav | Uncompressed, high-quality audio; used in production and editing |
| .aac | audio/aac | Efficient compressed audio; good quality at smaller file sizes |
| .m4a | audio/mp4 | MPEG-4 audio container; common for music and high-quality audio exports |
Theming
This code block shows how to customize the uploader’s colors and fonts. It lets you match the Vidinfra Uploader UI with your brand styling.Branding
This code block controls the “Powered by Vidinfra” footer. You can keep it visible or turn it off by setting branding to true or false. Configure the “Powered by VidInfra” footer:API Reference
Methods
This section lists the main methods of the Vidinfra Uploader. It explains how to control uploads, manage files, check the uploader state, update options, and remove the uploader when you’re done.Events
This section shows all events you can listen to in the Vidinfra Uploader. It covers file-added, upload progress, success, errors, completion, and pause/resume/cancel actions so you can react to each step of the upload flow.Response Structure
This section explains what data you get back after a successful upload. It returns the upload URL and the S3 details such as key, full file location, and video ID.Package Formats
This table shows all build formats included in the Vidinfra Uploader package. It explains which file to use for Node.js, modern bundlers, browsers, UMD script tags, development builds, and TypeScript types.| Format | File | Size | Usage |
|---|---|---|---|
| CommonJS | dist/index.cjs.js | 172KB | Node.js, older bundlers |
| ES Module | dist/index.esm.js | 171KB | Modern bundlers (Vite, Webpack 5) |
| ESM Browser | dist/index.browser.esm.js | 219KB | Browser with type="module" |
| UMD | dist/index.umd.js | 79KB | Browser <script> tag (minified) |
| UMD Dev | dist/index.umd.dev.js | 242KB | Browser with sourcemap |
| TypeScript | dist/index.d.ts | - | Type definitions |
CDN Links
This section shows two CDN options (unpkg and jsDelivr) for loading the Vidinfra Uploader directly in the browser using a <script> tag.
Framework Examples
This section lists example integrations for popular frameworks, showing how to use the Vidinfra Uploader in React, Vue, Svelte, Next.js, Laravel, and WordPress.React
React
This example shows how to set up the Vidinfra Uploader inside a React component. It initializes the uploader in useEffect, stores the instance, and destroys it when the component unmounts.
Vue 3
Vue 3
This example shows how to initialize the Vidinfra Uploader in a Vue 3 component. It creates the uploader in
onMounted and attaches it to a div in the template.Svelte
Svelte
This example shows how to set up the Vidinfra Uploader in a Svelte component. It loads the uploader inside
onMount and connects it to the uploader div.Next.js
Next.js
This example shows how to load the Vidinfra Uploader in a Next.js client component. It imports the uploader dynamically inside
useEffect and attaches it to the uploader div.Laravel
Laravel
This example shows how to use the Vidinfra Uploader in a Laravel project. The Blade file loads the script, and the JavaScript file initializes the uploader using values from environment variables.
Wordpress
Wordpress
This example shows how to use the Vidinfra Uploader in WordPress. It enqueues the uploader script and stylesheet, then initializes the uploader in a shortcode or template using values from WordPress settings.
Browser Support
The Vidinfra Uploader works on all major modern browsers. For the best performance, use the latest stable version of:- Chrome
- Firefox
- Safari
- Edge