我在我的 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 的情况下......
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")
]
[]
关于video - 如何在榆树应用程序中嵌入视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38695651/