FRAMEWORKS

React Router video

Complete video infrastructure for a React Router or Remix 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.

Node 18+ · RR v7 / Remix v2runtime
@fastpix/fastpix-nodeserver SDK
MITlicense

TRUSTED BY PRODUCT TEAMS SHIPPING VIDEO AT SCALE

Customer logoCustomer logoCustomer logoCustomer logoCustomer logoCustomer logo

What you get

What you get from FastPix for React Router 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 React Router video capability, from upload to AI

Pick a group, then a capability. Each one tells you whether the code goes in a resource route, a loader, or the route component itself.

Video upload API

A resource route, a route module with no default export, creates the signed URL from its action. The browser then uploads straight to FastPix in chunks, which is also the answer to the large-file question that has sat unanswered in the Remix repo since 2024.

Where it runs · Resource route creates, browser sends
1// app/routes/api.upload-url.ts
2export async function action() {
3 const upload = await fastpix.inputVideo.upload(
4 { corsOrigin: "*" },
5 { headers: { "X-Client-Type": "web-browser" } },
6 );
7 return Response.json({ url: upload.data.url });
8}

Setup

Install and configure the React Router video packages

Install the React Router video packages

The uploader and the player run in the browser. The Node SDK runs in your resource routes, where it creates upload URLs, signs playback tokens and asks for AI features.

npm
1# Browser and server, one install
2npm install @fastpix/fastpix-node @fastpix/fp-react-uploader @fastpix/fp-player
3
4// app/routes/upload.tsx: stylesheets are imported per route,
5// not globally the way Next.js does it.
6import "@fastpix/fp-react-uploader/styles.css";
7
8// Remix v2? Import from @remix-run/node and @remix-run/react
9// instead, and use file conventions rather than routes.ts.

Configure the React Router 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. The .server suffix is what keeps them out of the browser build.

Get your access token
.env + fastpix.server.ts
1// .env: do not prefix these with VITE_.
2// React Router builds with Vite, which inlines every
3// VITE_* variable into the client bundle.
4FASTPIX_USERNAME=your-access-token-id
5FASTPIX_PASSWORD=your-secret-key
6
7// app/fastpix.server.ts
8export const fastpix = new Fastpix({
9 security: {
10 username: process.env.FASTPIX_USERNAME, // Access Token ID
11 password: process.env.FASTPIX_PASSWORD, // Secret Key
12 },
13});

A React Router project with all of it wired

The resource route, its registration in routes.ts, the upload page, the webhook and the player route, in one project you can clone and run. Everything in one place instead of four doc pages.

· React Router v7· Remix v2 path· Resource routes
· Resumable upload· HLS playback

Behind the scenes

What happens after your React Router 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.

480p
1080p
Encoding renditions
4K

Native uploader

Chunked and resumable, from the browser to a signed URL.

Import from a URL

Or pass a public video URL and FastPix pulls it in.

FastPix

Ingest, encode, package

No FFmpeg, no build step, nothing in your output directory.

Chunked, resumable ingest
Transcode to a ladder
Store and version
Package HLS renditions
Thumbnails and captions
Encrypt for DRM

video.media.ready

The webhook that tells your server the video is ready.

Adaptive playback

One playback ID into the player, on-demand or live.

1
2
3

Upload

From your React Router app

Process

FastPix handles this

Play

Webhook + playback ID

Your React Router 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

React Router video questions, answered

  • How do I upload a large video file in React Router v7?

    Create a signed upload URL in a resource route action and let the browser upload to it directly. The file never passes through your app, so request size limits and timeouts do not apply at any file size.

  • Is this for Remix or React Router?

    Both. Remix v2 was upstreamed into React Router and is in maintenance mode, so create-remix now points at create-react-router. On an existing Remix codebase the code is identical apart from importing from @remix-run/* and registering routes by filename.

  • Why does my new upload route 404?

    Framework Mode registers routes explicitly rather than discovering them by filename, so creating app/routes/api.upload-url.ts puts a file on disk and nothing else. Add it to app/routes.ts and restart the dev server, since the config is read at startup.

  • How do I render the video player from a React Router route?

    Fetch the playback ID in a loader and pass it to a player component. Import the player inside useEffect, because React Router server-renders your routes and the player registers against customElements. Safari plays HLS natively and other browsers do not, which a player component handles for you.