Manu Chawla
Manu Chawla

Reputation: 327

how to embedded video in elm application

I am embedding you tube videos in my elm sample application.So to implement i have write the elm video code

[ embed [ attribute "-video" "", attribute "api" "1", attribute "height" "100%", href "//vimeo.com/111690998", attribute "iframe-id" "vimeo1", attribute "player_id" "vimeo1", attribute "width" "100%" ]
     []
   , a [ href "//vimeo.com/111690998" ]
   [ text "Watch" ]
]

but i am getting some error of embed-video element

Please any one help me to impelment this feature.

Upvotes: 10

Views: 1107

Answers (1)

Tosh
Tosh

Reputation: 36030

You can simply translate embed code (html) into Elm code.

For example, in case of youtube...

import Html exposing (..)
import Html.Attributes exposing (..)
import Json.Encode

videoframe =
  iframe
  [ width 560
  , height 315
  , src "https://www.youtube.com/embed/test"
  , property "frameborder" (Json.Encode.string "0")
  , property "allowfullscreen" (Json.Encode.string "true")
  ]
  []

Upvotes: 13

Related Questions