Shopify骑行模板

发布于 2025-02-03 07:02:00 字数 874 浏览 2 评论 0原文

我正在使用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦毁影碎の 2025-02-10 07:02:00

查看我使用充值主题的主题的视频,该主题基本上与Ride相同,希望我能提供帮助。

https://youtu.be/idjju-jtjmg

这是视频中已提及的代码。

{%- liquid
  assign video_handle = ''
  assign video_format = ''
-%}

<video title="Video is about this in that." autoplay loop muted playsinline style="inline-size: 100%;">
  <source src="{{ video_handle }}" 
    type="video/{{ video_format }}">
</video>

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.

{%- liquid
  assign video_handle = ''
  assign video_format = ''
-%}

<video title="Video is about this in that." autoplay loop muted playsinline style="inline-size: 100%;">
  <source src="{{ video_handle }}" 
    type="video/{{ video_format }}">
</video>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文