Support custom iframe provider by EmbedProvider
Related Problem:
Currently, Vidstack player only supports built-in iframe providers like YouTube, Vimeo etc. There's no way to add custom iframe video providers by extending the EmbedProvider class, which limits the extensibility of the player.
Describe:
Add support for custom iframe providers by allowing users to extend the EmbedProvider class. This would work similar to how the built-in YouTube provider is implemented.
This would enable users to:
- Add support for any iframe-based video platform
- Define custom URL patterns and embed URL formats
- Implement custom logic for extracting video IDs
- Register custom providers with the player
Alternatives:
-
Use
<iframe>element directly - This works but loses the benefits of Vidstack's provider system like unified API and events. -
Fork and modify the core player - Not sustainable as it requires maintaining a separate codebase.
Anything Else?
This would greatly enhance Vidstack's extensibility and make it more appealing for projects that need to support custom video platforms.
Technical Notes:
- Should follow similar patterns as existing providers (YouTube, Vimeo)
- Need to consider security implications of custom iframe sources
- Should document the provider interface thoroughly
I agere it would be useful to extend with custom embed provider, e.g. implement any other supported OEmbed provider like Synthesia (but not limited to OEmbed supported providers): https://github.com/vidstack/player/issues/1598