Video 如何在elm应用中嵌入视频

Video 如何在elm应用中嵌入视频,video,youtube,elm,Video,Youtube,Elm,我将YouTube视频嵌入到我的elm示例应用程序中。因此为了实现,我编写了elm视频代码 [ embed [ attribute "-video" "", attribute "api" "1", attribute "height" "100%", href "//vimeo.com/111690998", attribute "iframe-id" "vimeo1", attribute "player_id" "vimeo1", attribute "width" "100%" ]

我将YouTube视频嵌入到我的elm示例应用程序中。因此为了实现,我编写了elm视频代码

[ 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" ]
]
但我得到一些错误的嵌入视频元素


请任何人帮助我实现这一功能。

您只需将嵌入代码(html)转换为Elm代码即可

例如,在youtube的情况下

导入Html公开(…)
导入Html.Attributes(..)
导入Json.Encode
视频帧=
iframe
[宽度560
,高315
,src“https://www.youtube.com/embed/test"
,属性“frameborder”(Json.Encode.string“0”)
,属性“allowfullscreen”(Json.Encode.string“true”)
]
[]

谢谢@Tosh的帮助我正在浏览如何处理没有给定值的属性,上面的“true”提示非常有用!不过,FWIW属性对这些属性不起作用(目前仅在Chrome中测试)<但是,代码>属性可以。这个bug很难被注意到——因为它仍然“有效”,只是没有全屏或无边界的视频!