Shopify骑行模板
我正在使用Shopify的骑行主题(我知道我知道),并在index.json文件中查看我的视频:
"video_url": "https:\/\/www.youtube.com\/watch?v=KlxiEKrhWIQ",
我想在某人降落在页面上后立即开始播放。
我还看到一个具有以下iframe的部分:
<template>
{%- if section.settings.video_url.type == 'youtube' -%}
<iframe src="https://www.youtube.com/embed/{{ section.settings.video_url.id }}?enablejsapi=1" class="js-youtube" allow="autoplay; encrypted-media" allowfullscreen title="{{ section.settings.description | escape }}"></iframe>
{%- else -%}
<iframe src="https://player.vimeo.com/video/{{ section.settings.video_url.id }}" class="js-vimeo" allow="autoplay; encrypted-media" allowfullscreen title="{{ section.settings.description | escape }}"></iframe>
{%- endif -%}
</template>
希望有任何帮助。我尝试添加吗?autoplay = 1之后和之前?enablejsapi = 1,但它没有用,
谢谢
I'm using the ride theme from shopify (I know I know) and see my video in an index.json file:
"video_url": "https:\/\/www.youtube.com\/watch?v=KlxiEKrhWIQ",
I'd like to have it start playing as soon as someone lands on the page.
I also see a section that has the follow iframe:
<template>
{%- if section.settings.video_url.type == 'youtube' -%}
<iframe src="https://www.youtube.com/embed/{{ section.settings.video_url.id }}?enablejsapi=1" class="js-youtube" allow="autoplay; encrypted-media" allowfullscreen title="{{ section.settings.description | escape }}"></iframe>
{%- else -%}
<iframe src="https://player.vimeo.com/video/{{ section.settings.video_url.id }}" class="js-vimeo" allow="autoplay; encrypted-media" allowfullscreen title="{{ section.settings.description | escape }}"></iframe>
{%- endif -%}
</template>
Would appreciate any help. I tried adding ?autoplay=1 after the ID and before ?enablejsapi=1 but it didn't work
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看我使用充值主题的主题的视频,该主题基本上与Ride相同,希望我能提供帮助。
https://youtu.be/idjju-jtjmg
这是视频中已提及的代码。
Check my video on the topic it uses the Recharge theme which is basically the same thing as Ride, I hope I helped.
https://youtu.be/IDJju-jTJmg
Here is the code anippet mentionned in the video.