Skip to content

Commit a6c5c8f

Browse files
chore: format
1 parent 5f04397 commit a6c5c8f

File tree

5 files changed

+17
-15
lines changed

5 files changed

+17
-15
lines changed

mux-video/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
This example uses Mux Video, an API-first platform for video. The example features video uploading and playback in a Remix.js application.
44

55
This example is useful if you want to build a platform that supports user-uploaded videos. For example:
6+
67
- Enabling user profile videos
78
- Accepting videos for a video contest promotion
89
- Allowing customers to upload screencasts that help with troubleshooting a bug
@@ -66,6 +67,5 @@ When creating uploads, this demo sets `cors_origin: "*"` in the [`app/routes/_in
6667

6768
### Consider webhooks
6869

69-
In this example, we poll the Mux API to see if our asset is ready. In production, you'll likely have a database where you can store the `upload.id` and `asset.id`, and you can use [Mux Webhooks](https://docs.mux.com/guides/listen-for-webhooks) to get notified when your upload is complete, and when your asset is ready.
7070
In this example, we poll the Mux API to see if our asset is ready. In production, you'll likely have a database where you can store the `upload.id` and `asset.id`, and you can use [Mux Webhooks](https://docs.mux.com/guides/listen-for-webhooks) to get notified when your upload is complete, and when your asset is ready.
71-
71+
In this example, we poll the Mux API to see if our asset is ready. In production, you'll likely have a database where you can store the `upload.id` and `asset.id`, and you can use [Mux Webhooks](https://docs.mux.com/guides/listen-for-webhooks) to get notified when your upload is complete, and when your asset is ready.

mux-video/app/routes/_index.tsx

+1-4
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,7 @@ export default function UploadPage() {
6060
you might have other fields here, like name and description,
6161
that you'll save in your CMS alongside the uploadId and assetId
6262
*/}
63-
<button
64-
type="submit"
65-
disabled={!isUploadSuccess}
66-
>
63+
<button type="submit" disabled={!isUploadSuccess}>
6764
{isUploadSuccess ? "Watch video" : "Waiting for upload..."}
6865
</button>
6966
{message ? <p>{message}</p> : null}

mux-video/app/routes/mux.webhook.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const action = async ({ request }: ActionFunctionArgs) => {
1919
const event = mux.webhooks.unwrap(
2020
body,
2121
request.headers,
22-
process.env.MUX_WEBHOOK_SIGNING_SECRET
22+
process.env.MUX_WEBHOOK_SIGNING_SECRET,
2323
);
2424

2525
// you can also unwrap the payload yourself:
@@ -39,5 +39,5 @@ export const action = async ({ request }: ActionFunctionArgs) => {
3939
break;
4040
}
4141

42-
return json({ message: "ok" })
42+
return json({ message: "ok" });
4343
};

mux-video/app/routes/playback.$playbackId.tsx

+7-4
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,14 @@ export default function Page() {
3737
const { playbackId } = useParams();
3838
return (
3939
<>
40-
<p>
41-
This video is ready for playback and sharing
42-
</p>
40+
<p>This video is ready for playback and sharing</p>
4341
<MuxPlayer
44-
style={{ width: '100%', height: 'auto', aspectRatio: '16/9', marginBottom: '2rem' }}
42+
style={{
43+
width: "100%",
44+
height: "auto",
45+
aspectRatio: "16/9",
46+
marginBottom: "2rem",
47+
}}
4548
playbackId={playbackId}
4649
metadata={{ player_name: "remix/examples/mux-video" }}
4750
accentColor="rgb(37 99 235)"

mux-video/app/routes/status.$assetId.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { LoaderFunctionArgs} from "@remix-run/node";
1+
import type { LoaderFunctionArgs } from "@remix-run/node";
22
import { json, redirect } from "@remix-run/node";
33
import { useFetcher, useLoaderData, useParams, Link } from "@remix-run/react";
44
import { useEffect } from "react";
@@ -64,11 +64,13 @@ export default function UploadStatus() {
6464
<p>
6565
Asset is in an unexpected state: <code>{status}</code>.
6666
</p>
67-
{Array.isArray(errors) ? <ul>
67+
{Array.isArray(errors) ? (
68+
<ul>
6869
{errors.map((error, key) => (
6970
<li key={key}>{JSON.stringify(error)}</li>
7071
))}
71-
</ul> : null}
72+
</ul>
73+
) : null}
7274
<p>
7375
This is awkward. Let&apos;s <Link to="/">refresh</Link> and try again.
7476
</p>

0 commit comments

Comments
 (0)