player icon indicating copy to clipboard operation
player copied to clipboard

Support custom iframe provider by EmbedProvider

Open JimmyLv opened this issue 1 year ago • 1 comments

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:

  1. Use <iframe> element directly - This works but loses the benefits of Vidstack's provider system like unified API and events.

  2. 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

JimmyLv avatar Dec 08 '24 13:12 JimmyLv

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

bjarnef avatar Mar 30 '25 15:03 bjarnef