首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在聚合物3中使用Google Web Components元素

在聚合物3中使用Google Web Components元素
EN

Stack Overflow用户
提问于 2018-05-21 17:20:19
回答 4查看 826关注 0票数 3

如何在聚合物3中安装Google Web Components元素

示例-使用google-youtube或更多的元素还不能支持npm安装!

https://www.webcomponents.org/element/GoogleWebComponents/google-youtube

有没有人能想出办法为聚合物3安装这个。

EN

回答 4

Stack Overflow用户

发布于 2018-05-22 03:39:24

你可以试着安装它的聚合物调制器

npm install -g polymer-modulizer

您还需要安装bower,然后在您的repo中可以运行

modulizer GoogleWebComponents/google-youtube

,它将下载组件并将其转换到文件夹modulizer_workspace

https://github.com/Polymer/polymer-modulizer#workspace-mode

票数 2
EN

Stack Overflow用户

发布于 2018-05-22 11:14:10

简单地说:

代码语言:javascript
复制
npm install -g polymer-modulizer
git clone https://github.com/GoogleWebComponents/google-youtube.git
cd google-youtube
modulizer --out .

node_modules

复制新文件夹"google-youtube“并粘贴到你的项目中

票数 1
EN

Stack Overflow用户

发布于 2018-06-08 00:47:14

调制器对我不起作用,因此,如果只是简单地使用iframe来集成视频。由于我不需要任何google-youtube webcomponent属性,这在我的网站上运行良好。

代码语言:javascript
复制
<iframe 
  class="video-frame"
  src="https://www.youtube.com/embed/[[videoId]]"
  allowfullscreen="allowfullscreen"
  mozallowfullscreen="mozallowfullscreen" 
  msallowfullscreen="msallowfullscreen" 
  oallowfullscreen="oallowfullscreen" 
  webkitallowfullscreen="webkitallowfullscreen"
  frameBorder="0">
</iframe>

另请参阅w3schools以了解其他查询参数,如自动播放等。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50445580

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档