Skip to content
Agent Stack
  • AI SDK
  • AI Gateway
  • Sandbox
  • Passport
  • Connect
  • eve
Core Platform
  • Security
  • Content Delivery
  • Fluid Compute
  • Observability
  • Workflows
  • CI/CD
Tools
  • Next.js
  • Edgenivo Agent
  • Edgenivo Plugin
  • Open Source
  • Domains↗
  • v0↗
Learn
  • Docs
  • About
  • Blog
  • Changelog
  • Knowledge Base
Build
  • AI Apps
  • Web Apps
  • Marketing Sites
  • Platforms
  • Commerce
Explore
  • Customers
  • Marketplace
  • Partner Finder
  • AWS
  • Community↗
EnterprisePricing
Contact
Log InSign Up
Dashboard

Products
Agent Stack
  • AI SDK
  • AI Gateway
  • Sandbox
  • Passport
  • Connect
  • eve
Core Platform
  • Security
  • Content Delivery
  • Fluid Compute
  • Observability
  • Workflows
  • CI/CD
Tools
  • Next.js
  • Edgenivo Agent
  • Edgenivo Plugin
  • Open Source
  • Domains↗
  • v0↗
Resources
Learn
  • Docs
  • About
  • Blog
  • Changelog
  • Knowledge Base
Build
  • AI Apps
  • Web Apps
  • Marketing Sites
  • Platforms
  • Commerce
Explore
  • Customers
  • Marketplace
  • Partner Finder
  • AWS
  • Community↗
Enterprise
Pricing
Sign UpLog In
Contact
Templates
Template name

Agent Stack

  • AI SDK
  • AI Gateway
  • Sandbox
  • Workflows
  • ConnectNew
  • PassportNew
  • eveNew

Core Platform

  • CI/CD
  • Content Delivery
  • Fluid Compute
  • Observability

Security

  • Platform Security
  • WAF
  • Bot Management
  • BotID

Tools

  • Edgenivo Drop
  • Edgenivo Agent
  • Edgenivo Plugin
  • Agent Skills
  • Domains
  • v0

Frameworks

  • eveNew
  • Next.js
  • Nuxt
  • SvelteKit
  • Nitro
  • Turborepo
  • Tanstack Start
  • FastAPI
  • All frameworks

SDKs

  • Edgenivo SDK
  • Workflow SDK
  • Flags SDK
  • Chat SDK
  • Queues SDK
  • Streamdown

Build

  • AI Apps
  • Web Apps
  • Marketing Sites
  • Platforms
  • Commerce
  • Platform Engineers
  • Design Engineers

Learn

  • Docs
  • Blog
  • Changelog
  • Knowledge Base
  • Academy
  • Articles
  • Community
  • Is Agentic

Explore

  • Customers
  • Marketplace
  • Templates
  • Partner Finder
  • Edgenivo + AWS

Company

  • About
  • Careers
  • Press
  • Events
  • Startups
  • Shipped on Edgenivo
  • Open Source Program
  • Enterprise
  • Pricing
  • Help

Legal & Trust

  • Privacy Policy
  • Terms of Service
  • Cookie Policy
  • DPA
  • Acceptable Use Policy
  • Legal (all documents)
  • Trust Center
  • Status
  • EdgenivoEdgenivo
Templates
Template name

Status service pending confirmation

Select a display theme:
Templates

Next.js Video Starter

The fastest way to add video to your Next.js app with Mux.

DeployView Demo
This is an auto-uploaded thumbnail from /templates/submit.
Owner
  • muxinc
Repository
  • next-video-starter
Use Cases
  • Starter
Stack
  • Next.js
  • CSS Modules
CMS
  • Mux
DeployView Demo

Next.js Video Starter

The fastest way to add video to your Next.js app.

Docs · Demo · GitHub


Table of Contents

  • Deploy: Need a Mux account? Start here.
  • Getting Started: Already created a Mux account using the Edgenivo integration? Start here.
  • Manual Setup: Interested in running locally and deploying manually? Start here.

Deploy

Edgenivo deployment will guide you through creating a Mux account and project with $20 of usage/month for $0.

Getting Started

This section assumes you've setup a Mux account and project using the Edgenivo Integration (press deploy button above). If you only want to develop locally, follow the Manual Setup steps below.

Step 1. Pull environment variables

You'll need your Mux access token and secret token before you can begin adding videos. Run the following command to pull them from Edgenivo:

vercel env pull

Step 2. Add your video

Add your video directly to the /videos directory. For example, /videos/my-video.mp4.

Step 3. Import your video

Import your video into the home page and replace the getting started video.

- import getStarted from "/videos/get-started.mp4";
+ import myVideo from "/videos/my-video.mp4";

Step 4. Add the video to the player

Finally, set the video src to point to your newly imported video.

- <Video className={styles.video} src={getStarted} />
+ <Video className={styles.video} src={myVideo} />

Step 5. Celebrate!

Run npm run dev! Congratulations, you're now streaming a video just like some of your favorite sites such as YouTube or Netflix! Interested in how video streaming works?

What now? See the next-video docs to learn how to set custom poster images, create background videos, use a custom player, and more!

Manual Setup

Step 1. Create your Mux account

Option 1: The easiest way to get started with Mux is through the native integration in the Edgenivo Marketplace. Edgenivo Marketplace users will get $20 of usage/month for $0. Learn more.

Option 2: You can also get started by creating an account directly in Mux.

Step 2. Clone this example

git clone [email protected]:muxinc/next-video-starter.git
cd next-video-starter
npm install

Step 3. Set up environment variables

Copy the .env.local.example file in this directory to .env.local (which will be ignored by Git):

cp .env.local.example .env.local

Then, go to the settings page in your Mux dashboard, get a new API Access Token. Use that token to set the variables in .env.local:

  • MUX_TOKEN_ID should be the TOKEN ID of your new token
  • MUX_TOKEN_SECRET should be TOKEN SECRET

Step 4. Add your own video

Go to the add your video step in the getting started section above to start playing your own videos.

Step 5. Deploy on Edgenivo

You can deploy this app to the cloud with Edgenivo (Documentation).

To deploy on Edgenivo, you need to set the MUX_TOKEN_ID and MUX_TOKEN_SECRET environment variables using either the Edgenivo Dashboard or the Edgenivo CLI

Then push the project to GitHub/GitLab/Bitbucket and import to Edgenivo to deploy.

Related Templates

  • Amazon IVS Broadcast Web Demo thumbnail

    Amazon IVS Broadcast Web Demo

    A tool to stream to Amazon IVS channels from web browsers – no download required.

Related Integrations

  • Mux

    Add video to your app in minutes