React wrapping #98
Replies: 2 comments 4 replies
-
|
@wetteyve I find the proposition interesting and it could benefit other developers. Does that mean it fits into React's lifecycle, or do you still need to use createPortal (or whatever it's called)? |
Beta Was this translation helpful? Give feedback.
-
|
The Problem You're Solving is Real Lifecycle Management: Ensuring the Video.js player is correctly initialized and destroyed to prevent memory leaks in a React app. Your React hook + component approach is the perfect solution for this. "The Wrapper Problem": How do you inject declarative React components into a UI that is managed by an external, imperative library? Your generic Video.js bridge component sounds like an elegant and powerful solution to this. It's the most exciting part of your proposal. The "Mix and Match" Benefit is Key On Contribution Strategy Framework-Specific vs. Agnostic Core: Most large, framework-agnostic libraries (like Video.js itself) prefer to keep their core repository free of framework-specific code. This keeps the core library lean and un-opinionated. The Ecosystem Approach: The standard and most effective approach is to release it as a separate, dedicated open-source project. Think of libraries like react-leaflet for Leaflet or react-chartjs-2 for Chart.js. My recommendation would be: Publish it as a standalone npm package (e.g., react-pillarbox-bridge, react-vjs-bridge as you mentioned, or similar). Create a dedicated GitHub repository for it. Once it's published, you can engage with the Pillarbox/Video.js maintainers to have it listed in their official documentation under a "Community Plugins" or "Ecosystem" section. This is the best of both worlds: you maintain control, and the core project can officially recommend your solution. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
React Wrapper & Bridge Component for Video.js Integration
Hi everyone,
we’ve built a (mostly) standalone React wrapper for Pillarbox that we think could be useful for other integrators as well. The wrapper includes:
ReactNode, which then gets rendered into the Video.js component.With this bridge, you can render React components directly inside Video.js components. This lets you:
We see this as a framework-specific approach (relevant only if you’re working with React), and we’re not sure if it makes sense to contribute directly to this repo. But if it’s aligned with the goals of the project, I’d be happy to share links, documentation, and even the plugin itself (
react-vjs-bridge).What do you think—would this be of interest to the community?
links:
Beta Was this translation helpful? Give feedback.
All reactions