video - 如何在榆树应用程序中嵌入视频

标签 video youtube elm

我在我的 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/

相关文章:

html - 我如何通过上传单个视频文件来获取任何html5视频的多种质量(360p,480p,720p)选择

youtube - 使用 allThreadsRelatedToChannelId 参数时/commentThreads 端点不返回任何数据

functional-programming - 了解 Elm 的类型签名返回类型

elm - 如何在 Elm 中创建一个 Dict 进行测试?

javascript - Dailymotion 视频自动播放和静音

audio - HandbrakeCLI命令行

iphone - 为什么我的 <video autoplay> 元素直到我点击它才开始在 iPhone 上播放?即使使用 JavaScript?

c# - 限制通过C#上传到YouTube的视频的长度

jquery - jQuery YouTube检索描述

Elm 端口不运行