【发布时间】:2022-06-20 05:29:03
【问题描述】:
我正在使用来自 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>
不胜感激。我尝试在 ID 之后和 ?enablejsapi=1 之前添加 ?autoplay=1 但它不起作用
谢谢
【问题讨论】:
-
嗨!如果对您有帮助,请查看此链接stackoverflow.com/questions/40685142/…