定制 sitegeist/media-components 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sitegeist/media-components

最新稳定版本:0.2.2

Composer 安装命令:

composer require sitegeist/media-components

包简介

Ready-to-use fluid components for embedding different media files

README 文档

README

This extension is still in development and might not ready for production usage.

This extension provides ready-to-use Fluid Components for various media assets:

WebP conversion

As these components are such basic atoms, you could use them to change the format of any image to WebP to reduce file sizes. The extension configuration contains a list of file extensions that will be converted to WebP if not explicitly defined with format=. You colud use autoWebpConversionFormats with gif,jpg,jpeg,tif,tiff,bmp,pcx,tga,png,pdf,ai to get full conversion to WebP (without svg as it already has a smaller file size).

Usage

We use the public namespace from fluid-components.

Images

<fc:image src="{width:200, height:100}" />

<fc:image
    src="5"
    width="500"
    height="100"
    maxDimensions="true"
    cropVariant="Default"
    srcset="400w, 800w, 1200w"
    sizes="(min-width: 400px) 400px, (min-width: 800px) 800px, (min-width:1200px) 1200px, 100vw"
    format="jpg"
    alt="Alt text"
    title="Title text"
    lazyload="true"
    preload="true"
/>

Pictures

Use pictureClass for the outer <picture> element; class still applies to the fallback <img>.

<fc:picture
    src="{originalImage: {fileUid: 5}, srcset: \'400,800,1200\'}"
    sources="{desktop: {originalImage: {fileUid: 5}, srcset: \'1000, 1200, 1400, 1600, 1800, 2000\'}}"
    width="500"
    height="100"
    maxDimensions="true"
    alt="Alt text"
    title="Title text"
    lazyload="true"
    preload="true"
    pictureClass="my-picture"
    class="my-image"
/>

Video

<fc:video
    sources="{0: 7}"
    tracks="{0: 8}"
    width="800"
    height="600"
    autoplay="false"
    controls="true"
    loop="true"
    muted="false"
    poster="{fileUid: 4}"
    preload="metadata"
    fallbackText="Fallback"
    crossorigin="anonymous"
    playsinline="true"
/>

Audio

<fc:audio
    sources="{0: 1, 1: 2, 3: 2}"
    autoplay="true"
    controls="true"
    loop="true"
    muted="true"
    preload="metadata"
    fallbackText="Fallback"
    crossorigin="anonymous"
/>

统计信息

  • 总下载量: 3.25k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 4
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2024-10-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固