Replies: 4 comments 8 replies
-
I love the idea of having something like this in nextjs. I believe the best case is where this |
Beta Was this translation helpful? Give feedback.
-
Having this work with VideoJS (and companies who use it like Brightcove) would be great. |
Beta Was this translation helpful? Give feedback.
-
I have src file coming from existing s3 endpoints as either m3u8 file > .ts or existing endpoints serving mp4, mov, etc. I'm getting all sorts of console errors. 500 errors when fetching /video api. And sporadic My question is: if the video files are already hosted, why do we need to upload again? Is there a way around this to handle multple file types (i.e., m3u8, mov, mp4) just using the existing endpoint urls? |
Beta Was this translation helpful? Give feedback.
-
Adding some notes here about 1 year later. The next-video project is going well and steadily growing in weekly downloads. The major focuses right now are player flexibility, player file size, and alternative metadata stores. We're playing a bit of whac-a-mole with the install wizard as Next.js makes updates, for example the move from webpack to turbopack as the default bundler, which is where some of our auto-processing logic lives. It's not a big problem exactly, but I think it points to some of the value of building video support into Next.js similar to next/image. That said, if this is ultimately a |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
This RFC aims to address comments like #20323.
Non-Goals
<Audio />
- Audio is more than just “video minus the visual-part”. It brings its own unique uses and issues. It’s not prioritized in this initial shape, but could be a fast follow.Background
<video>
is harder than it looks.<video>
has many of the same performance and layout-related issues as<img>
, and then many other problems because video is interactive and file sizes are much bigger.Open source players like react-player and video.js can solve many of the client-side related issues with video, but they can’t solve server-side aspects. They also can’t bring any of the magic that a JS meta-framework like Next.js can when combining client and server, much like with next/image.
Proposal
There are three parts to this
next/video
proposal:<Video />
component1.
<Video />
The
<Video />
component will by default include a best-in-class video player, solving the many cross-browser<video>
issues and bringing a default UI that is accessible, responsive, and aesthetically pleasing.Much like
next/image
it will add build-time features like a blurred, fast-loading placeholder (or ”poster”) and smart sizing based on the video source file’s aspect ratio.It will provide a clear path towards customization, from building a custom UI to integrating third-party software like analytics providers.
2. The video source file optimization workflow
/videos
Any video source file added to a new directory named
/videos
will be automatically uploaded via awatch
script, or manually via a CLI command, to a configured third-party service for hosting, optimization, and delivery.[video-file-name].json
A new file named
[video-file-name].json
(e.g.myVideo.mp4.json
) will be created in the/videos
directory for mapping the original video file name to the third-party-hosted version, and for storing metadata about the video, for example processing status and aspect ratio./videos/.gitignore
The original video source file will be ignored in the repo via a local
.gitignore
file, addressing the git repo video storage problems. If storing the video source files in the repo is also desired for any reason, LFS can be enabled and the.gitignore
removed.import myVideo from '/videos/myVideo.mp4'
A module import of
import myVideo from '/videos/myVideo.mp4'
will return the.json
file object, including third-party ID mapping and metadata. This will be possible via a Webpack plugin and extension tonext.config.js
. The<Video />
component will use the object to retrieve metadata and a URL to the optimized version of the video, or fall back to the local video source during development if the optimized version is still processing.Custom processing handlers
The optimization workflow is customizable, allowing developers and other video service providers to integrate their own video processing into this workflow.
3. Proposed features
Third-party service provided features
These features would be expected of the configured video service, but may behave differently or be optional depending on the specific service.
<Video />
featuresWorkflow features
/videos
directoryProof of concept
A prototype of this proposal can be found at github.com/muxinc/next-video. Please try it out and give feedback!
The proof of concept is built using Mux as the video infrastructure. The v1.0 of this feature would include additional services as options.
Beta Was this translation helpful? Give feedback.
All reactions