0.0.6 • Published 5 years ago

elm-oembed v0.0.6

Weekly downloads
-
License
BSD-3-Clause
Repository
-
Last release
5 years ago

elm-oembed

Elm package npm

A Web Component and accompanying Elm package for rendering oembed content.

Width and height are sized dynamically based on the loaded content. Script tags are safely loaded within an iframe.

What is oembed

oembed is a protocol, with many providers implementing it. It allows you to turn a URL into embeddable content.

These examples will render a YouTube player, an embedded Tweet, a Giphy .gif of the desired dimensions, and an Elm code snippet in Ellie. Check out the examples folder to see it in action!

div []
    [ Oembed.viewOrDiscover Nothing "https://www.youtube.com/watch?v=43eM4kNbb6c"
    , Oembed.viewOrDiscover Nothing "https://twitter.com/dillontkearns/status/1105250778233491456"
    , Oembed.viewOrDiscover (Just { maxWidth = 250, maxHeight = 1000 }) "https://giphy.com/gifs/art-weird-ewan-26hiu3mZVquuykwhy"
    , Oembed.viewOrDiscover Nothing "https://ellie-app.com/4Xt4jdgtnZ2a1"
    ]

Setup

Just load the Web Component like so:

npm install --save-dev elm-oembed
import "elm-oembed";
0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago