Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to embedded video in elm application

Tags:

youtube

video

elm

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.

like image 959
Manu Chawla Avatar asked Aug 01 '16 09:08

Manu Chawla


People also ask

How do I embed an Iframe video?

To embed a video in an HTML page, use the <iframe> element. The source attribute included the video URL. For the dimensions of the video player, set the width and height of the video appropriately. The Video URL is the video embed link.

What is embedded code for video?

An embed code is essentially a little bit of a computer code which starts the video player and showcases it with regards to your website page. However, embed codes are not always so straightforward and simple. When it comes to professional and expert video hosting services, the embed codes tend to be much longer.


1 Answers

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")
  ]
  []
like image 195
Tosh Avatar answered Oct 17 '22 00:10

Tosh