driebit / elm-ginger / Ginger.Media

Definitions


type Media
    = Image (Dict String String)
    | Video VideoData
    | Empty


type MediaClass
    = Avatar
    | Thumbnail
    | Card
    | Small
    | Medium
    | Large
    | Cinemascope
    | Custom String


type alias VideoData =
{ embedCode : String
, width : Basics.Int
, height : Basics.Int 
}

Build & Query

imageUrl : MediaClass -> Media -> Maybe String

The image url with a given MediaClass

videoData : Media -> Maybe VideoData

The video data.

imageClassToString : MediaClass -> String

empty : Media

Decode

fromJson : Json.Decode.Decoder Media

Decode image and video data