我正在使用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之前添加?enablejsapi=1,但是它没有工作
谢谢
发布于 2022-06-19 21:29:03
查看我的视频主题,它使用充电的主题,这基本上是相同的东西,我希望我的帮助。
这是视频中提到的代码。
{%- 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>https://stackoverflow.com/questions/72456335
复制相似问题