跳至主要內容

西瓜视频

MonoLogueChi小于 1 分钟

介绍

可以插入 西瓜 视频

使用

{% mmedia "xigua" "xid=6925997698269053453" %}
{% mmedia "xigua" "xid:6925997698269053453" "autoplay:true" %}

参数

  • 使用 := 分割。

详细参数表:

参数默认解释
xid-西瓜视频的 ID,就是那一串数字
id-一般情况下不需要填写
autoplayfalseautoplay
startTime0开始时间,秒
allowfullscreenallowfullscreen允许全屏, allowfullscreen 或 true 允许,其他选项不允许
sandbox配置iframe sandbox
width100%css 属性
max_width850pxcss 属性
marginautocss 属性

JSON 参数

mmedia 插件允许在 contents 部分使用 JSON 编写配置,使用 JSON5 标准。

配置

默认配置可写入 _config.yml

mmedia:
  xigua:
    default:
      autoplay: false
      startTime: 0
      allowfullscreen: allowfullscreen
      sandbox: allow-top-navigation allow-same-origin allow-forms allow-scripts allow-popups
      width: 100%
      max_width: 850px
      margin: auto