Create an embedded Youtube video using the Iframe Player Api
Internal.Youtube.Youtube
The type of an Youtube image
Internal.Attribute.Attribute
The type of a Youtube Attribute
fromUrl : Url -> Maybe Youtube
Attempt to create a new Youtube
from an (Youtube) Url containing the v= param. https://www.youtube.com/watch?v=0D7GrGrN1bg
import Url
Url.fromString "https://www.youtube.com/watch?v=0D7GrGrN1bg"
|> Maybe.andThen fromUrl
--> Just <| fromString "0D7GrGrN1bg"
or from shortend links such as; https://youtu.be/0D7GrGrN1bg
import Url
Url.fromString "https://youtu.be/0D7GrGrN1bg"
|> Maybe.andThen fromUrl
--> Just <| fromString "0D7GrGrN1bg"
fromString : String -> Youtube
Create a new Youtube from a string representing a VideoId
There is no validation on the input
Check Embed.Youtube.Attributes for all the available Attribute helpers
attributes : List Attribute -> Youtube -> Youtube
Add Attributes to your Youtube type
toHtml : Youtube -> Html msg
Renders an iFrame based on your settings