FRAMEWORKS
Next.js video
Complete video infrastructure for a Next.js app. Install the packages and you get uploads, adaptive playback, live streams, DRM, analytics and AI features, without building your own encoding, storage and delivery.
Free plan: 10 videos, 100K streaming minutes, 300 minutes of subtitles and moderation. No credit card.
TRUSTED BY PRODUCT TEAMS SHIPPING VIDEO AT SCALE






What you get
What you get from FastPix for Next.js video
Four things you don't have to build or run yourself.
One video API
Upload, storage, delivery, the player, analytics and AI all come from the same API. No Vite plugin, nothing added to your build.
Built-in encoding
FastPix turns each upload into several quality levels and packages them for streaming. No FFmpeg, no queue workers.
Analytics already on
The player sends view data on its own. Add a title and a viewer ID and you can see who watched what.
Secure video streaming and DRM
Sign a token on your server and pass it to the player. Widevine, PlayReady and FairPlay are all supported.
Functionality
Every Next.js video capability, from upload to AI
Pick a group, then a capability. Each one tells you whether the code goes in a route handler, a server component or a client component.
Video upload API
A route handler creates the signed URL. The browser then uploads the file straight to FastPix in chunks, so nothing crosses your Vercel function and no body-size limit applies. Create the URL in the handler, never during page render, or Next.js prerenders one URL into the HTML for every visitor.
Next.js video player
The player is a web component. It registers itself against customElements, a browser-only API, and Next.js server-renders client components for the initial HTML. So "use client" alone is not enough: import it inside useEffect or the build throws on window.
Video engagement analytics
The player sends view data on its own. There is no second SDK to add and no Next.js code to write. This is the only thing on this page that works without you writing anything.
Server-side AI processing
Every AI feature runs on the video after it is uploaded. You ask for it from a route handler and the result arrives on a webhook. None of it is component code, so it is identical whether you use the App Router or the Pages Router.
Setup
Install and configure the Next.js video packages
Install the Next.js video packages
The uploader and the player run in the browser. The Node SDK runs in your route handlers, where it creates upload URLs, signs playback tokens and asks for AI features.
Configure the Next.js video packages
There's no API key. You get two values, an Access Token ID and a Secret Key, and they work as a username and password. Both stay in your route handlers.
Get your access tokenA Next.js project with all of it wired
The route handler, the upload page, the webhook and the client player component, in one project you can clone and run. Everything in one place instead of four doc pages.
Behind the scenes
What happens after your Next.js app uploads a file
Here's what happens between the file leaving the browser and the video reaching a viewer. None of it is code you write, and none of it runs in your app.
Your Next.js app only touches the two ends. A server call hands over a signed URL and the player takes the playback ID. In between, a video.media.ready webhook tells your server the video is ready.
FAQ
Next.js video questions, answered
Where should I store video files in a Next.js app?
Not in public/. Files there are served by your app and committed to your repo, so a 200 MB video bloats every deploy and every viewer downloads the same single file at the same bitrate. Put video on storage built for it and reference it by ID. Next.js's own video guide says the same thing, and the reason is that public/ has no byte-range handling, no set of quality levels and no CDN behaviour you control.
Why does my Next.js video take so long to start playing?
Usually because the browser is downloading a single large MP4 before it can show anything. An adaptive stream splits the video into segments and lets the player start on the lowest quality level, so playback begins after one small segment rather than after a whole file. The other half is what paints first: set a poster image so the page has something to show while the manifest loads.
How do I upload video in a Next.js app?
Don't post the file through a route handler. Create a signed upload URL there, then let the uploader send the file straight to storage in chunks. It resumes after a dropped connection, and no serverless body limit or function timeout applies, because the bytes never reach your function.
How do I add a background video without hurting LCP?
Give the element a poster so the first paint is an image rather than a decoded video frame, and muted alongside autoplay because browsers block autoplay with sound. Load the player after mount so its JavaScript stays out of the initial bundle.
Go deeper
More on Next.js video players and uploads
Uploading large video files efficiently using chunking
The protocol detail behind chunk sizing and retry behaviour.
Read moreHow to allow users to upload large videos with pause and resume
The behaviour the uploader gives you, explained.
Read moreGuide to video playback in JavaScript
What the browser is doing underneath any player you pick.
Read moreABR vs MBR: adaptive and multi-bitrate streaming
Why one upload becomes several quality levels.
Read moreGuide to lazy loading HTML videos for your website
Stops a page of video elements blocking your first paint.
Read moreCreating a fully customizable video player interface
Restyling controls without rebuilding the player.
Read moreHow to protect video content with signed URLs
The access model behind private playback.
Read moreWebhooks for video: live events and UGC pipelines
The events that matter, and verifying a signature properly.
Read moreHow to set up monitoring for video player errors
Catching playback failures before support tickets do.
Read more