-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add BackgroundVideo component (#207)
* feat: add background-video component based on @mux/mux-video * fix: improve styles * feat: support `thumbnailTime` import param
- Loading branch information
Showing
22 changed files
with
432 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"root": true, | ||
"extends": "next/core-web-vitals" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Metadata } from 'next'; | ||
import BackgroundVideo from 'next-video/background-video'; | ||
import getStarted from '/videos/country-clouds.mp4?thumbnailTime=0'; | ||
|
||
export const metadata: Metadata = { | ||
title: 'next-video - Background Video', | ||
}; | ||
|
||
export default function Page() { | ||
return ( | ||
<> | ||
<main> | ||
<BackgroundVideo src={getStarted}> | ||
<h1>next-video</h1> | ||
<p> | ||
A React component for adding video to your Next.js application. | ||
It extends both the video element and your Next app with features | ||
for automatic video optimization. | ||
</p> | ||
</BackgroundVideo> | ||
</main> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"status":"ready","originalFilePath":"videos/country-clouds.mp4","provider":"mux","providerMetadata":{"mux":{"uploadId":"RPMSA1MrehzNmKTNbL5m2dikLE9oolO1niXcyOKAdjg","assetId":"CX00rjcZ3NUrbpVcNrofK3uSOjWFroZAS3Xq9E16yH02o","playbackId":"m00b01mJ2BQP4GMYXKoOmgRdnHELCPpYFtIO52h01l9ozY"}},"createdAt":1710978290774,"updatedAt":1710978359041,"size":33682771,"sources":[{"src":"https://stream.mux.com/m00b01mJ2BQP4GMYXKoOmgRdnHELCPpYFtIO52h01l9ozY.m3u8","type":"application/x-mpegURL"}],"poster":"https://image.mux.com/m00b01mJ2BQP4GMYXKoOmgRdnHELCPpYFtIO52h01l9ozY/thumbnail.webp","blurDataURL":"data:image/webp;base64,UklGRmwAAABXRUJQVlA4IGAAAAAQAgCdASoQAAgAAQAcJbACdLoAAwi2bUSAAP74Qu6oOFirJlY8OZVMZBXX2e9f/SRsDS2UEX0Lxo/JvCWyFRzjaBYzny/6POMaoi3hj6+5/8zllIyezfJeEHJ/ROthhAA="} |
2 changes: 1 addition & 1 deletion
2
examples/default-provider/videos/storage.googleapis.com_muxdemofiles_mux.mp4.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"status":"ready","originalFilePath":"https://storage.googleapis.com/muxdemofiles/mux.mp4","provider":"mux","providerMetadata":{"mux":{"assetId":"BBwp02fpGtb01Dde7QfOBcBQB9grcJGHsPd4SRJm7QiM4","playbackId":"ULNuP2eL02DNRfoD2PGVOgH02018I2pmycmoN8CRlRvtKI"}},"createdAt":1710427473574,"updatedAt":1710427475772,"sources":[{"src":"https://stream.mux.com/ULNuP2eL02DNRfoD2PGVOgH02018I2pmycmoN8CRlRvtKI.m3u8","type":"application/x-mpegURL"}],"poster":"https://image.mux.com/ULNuP2eL02DNRfoD2PGVOgH02018I2pmycmoN8CRlRvtKI/thumbnail.webp","blurDataURL":"data:image/webp;base64,UklGRlAAAABXRUJQVlA4IEQAAACwAQCdASoQAAkAAQAcJZwAAueBHFYwAP7+sPJ01xp5AM+XuhDsRQ67ZYXXhHDkrqsIkUGjQSCMuENc5y3Qg0o9pZgAAA=="} | ||
{"status":"ready","originalFilePath":"https://storage.googleapis.com/muxdemofiles/mux.mp4","provider":"mux","providerMetadata":{"mux":{"assetId":"EploFGgmKULMpiyDFwsy5c6lmGcg8dkObaVvnPMcdkQ","playbackId":"jxEf6XiJs6JY017pSzpv8Hd6tTbdAOecHTq4FiFAn564"}},"createdAt":1710979438730,"updatedAt":1710979441038,"sources":[{"src":"https://stream.mux.com/.m3u8","type":"application/x-mpegURL"}],"poster":"https://image.mux.com//thumbnail.webp","blurDataURL":"data:image/webp;base64,UklGRlAAAABXRUJQVlA4IEQAAACwAQCdASoQAAkAAQAcJZwAAueBHFYwAP7+sPJ01xp5AM+XuhDsRQ67ZYXXhHDkrqsIkUGjQSCMuENc5y3Qg0o9pZgAAA=="} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.