Page Builder: Component to load embedded resources (oEmbed)
leandrocp opened this issue · 5 comments
leandrocp commented
Add a new component embed/1
into https://github.com/BeaconCMS/beacon/blob/main/lib/beacon_web/components/components.ex that takes an URL, unfurl such resource, and render the html
property.
For example, given that someone adds the following snippet into a page template:
<BeaconWeb.Components.embed url="https://www.youtube.com/watch?v=giYbq4HmfGA">
The resulting markup should look like:
<iframe width=\"200\" height=\"113\" src=\"https://www.youtube.com/embed/giYbq4HmfGA?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen title=\"ElixirConf 2023 - José Valim - The foundations of the Elixir type system\"></iframe>
Using a library like https://hex.pm/packages/oembed helps to parse the many available providers.
leandrocp commented
APB9785 commented
That's right, I have not yet started on this.
edborsa commented
Oh, cool!
I'll tackle this next then ;)
bcardarella commented
Correct PR #391