如何在聚合物3中安装Google Web Components元素
示例-使用google-youtube或更多的元素还不能支持npm安装!
https://www.webcomponents.org/element/GoogleWebComponents/google-youtube
有没有人能想出办法为聚合物3安装这个。
发布于 2018-05-22 03:39:24
你可以试着安装它的聚合物调制器
npm install -g polymer-modulizer
您还需要安装bower,然后在您的repo中可以运行
modulizer GoogleWebComponents/google-youtube
,它将下载组件并将其转换到文件夹modulizer_workspace。
发布于 2018-05-22 11:14:10
简单地说:
npm install -g polymer-modulizer
git clone https://github.com/GoogleWebComponents/google-youtube.git
cd google-youtube
modulizer --out .在node_modules中
复制新文件夹"google-youtube“并粘贴到你的项目中
发布于 2018-06-08 00:47:14
调制器对我不起作用,因此,如果只是简单地使用iframe来集成视频。由于我不需要任何google-youtube webcomponent属性,这在我的网站上运行良好。
<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以了解其他查询参数,如自动播放等。
https://stackoverflow.com/questions/50445580
复制相似问题