【问题标题】:Shopify Ride TemplateShopify 骑行模板
【发布时间】: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 但它不起作用

谢谢

【问题讨论】:

标签: css json shopify


【解决方案1】:

查看我的视频,它使用与 Ride 基本相同的 Recharge 主题,希望对我有所帮助。

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>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-30
    • 2017-09-16
    • 1970-01-01
    相关资源
    最近更新 更多