Unverified Commit 94e20be2 authored by Shu Uesugi's avatar Shu Uesugi Committed by GitHub

With mux video readme updates (#13253)

* Add demo and note to with-mux-video

* Update README.md
parent 32dece14
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
This example uses Mux Video, an API-first platform for video. The example features video uploading and playback in a Next.js application. This example uses Mux Video, an API-first platform for video. The example features video uploading and playback in a Next.js application.
## Demo
### [https://with-mux-video.now.sh/](https://with-mux-video.now.sh/)
## Deploy your own ## Deploy your own
Deploy the example using [Vercel](https://vercel.com/home): Deploy the example using [Vercel](https://vercel.com/home):
...@@ -18,6 +22,16 @@ npm init next-app --example with-mux-video with-mux-video-app ...@@ -18,6 +22,16 @@ npm init next-app --example with-mux-video with-mux-video-app
yarn create next-app --example with-mux-video with-mux-video-app yarn create next-app --example with-mux-video with-mux-video-app
``` ```
## Note
**Important:** When creating uploads, this demo sets `cors_origin: "*"` in the [`pages/api/upload.js`](pages/api/upload.js) file. For extra security, you should update this value to be something like `cors_origin: 'https://your-app.com'`, to restrict uploads to only be allowed from your application.
This example uses:
- [SWR](https://swr.now.sh/) — dynamically changing the `refreshInterval` depending on if the client should be polling for updates or not
- [`/pages/api`](pages/api) routes — a couple endpoints for making authenticated requests to the Mux API.
- Dynamic routes using [`getStaticPaths` and `fallback: true`](https://nextjs.org/docs/basic-features/data-fetching#getstaticpaths-static-generation), as well as dynamic API routes.
## Configuration ## Configuration
### Step 1. Create an account in Mux ### Step 1. Create an account in Mux
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment