Overview of stream.new
mainstream.new is an open-source example application designed to demonstrate how to record and upload videos using Mux. It is built using Next.js and integrates several key technologies:
Mux Integration
- Direct Uploads: Uses the Mux API to allow clients to upload video files directly to create Mux Assets.
- Webhook Signature Verification: Ensures incoming webhooks from Mux are authentic.
- HLS.js: Handles HLS video playback.
- Mux Data: Tracks video quality metrics.
Next.js Implementation
- SWR: Manages data fetching with dynamic
refreshIntervalpolling. - API Routes: Located in
/pages/api, these handle authenticated requests to the Mux API. - Dynamic Routing: Utilizes
getStaticPathswithfallback: trueand dynamic API routes.