beacon icon indicating copy to clipboard operation
beacon copied to clipboard

Page Builder: Component to load embedded resources (oEmbed)

Open leandrocp opened this issue 2 years ago • 5 comments

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>

See https://oembed.com/

Using a library like https://hex.pm/packages/oembed helps to parse the many available providers.

leandrocp avatar Sep 13 '23 15:09 leandrocp

Hey! I created a PR for this issue: https://github.com/BeaconCMS/beacon/pull/389

edborsa avatar Dec 30 '23 20:12 edborsa

Hi @edborsa I guess you meant that PR #389 is to solve the issue #357? :)

A PR for this issue is also very welcome. AFAIK @APB9785 haven't started working on this one yet.

leandrocp avatar Jan 09 '24 18:01 leandrocp

That's right, I have not yet started on this.

APB9785 avatar Jan 09 '24 19:01 APB9785

Oh, cool! I'll tackle this next then ;)

edborsa avatar Jan 10 '24 23:01 edborsa

Correct PR #391

bcardarella avatar May 02 '24 14:05 bcardarella