定制 robole/sulu-video-bundle 二次开发

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

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

robole/sulu-video-bundle

Composer 安装命令:

composer require robole/sulu-video-bundle

包简介

Preview, extract and embed videos in Sulu CMS

README 文档

README

SuluVideoBundle

Preview and extract embed URLs from Youtube, Vimeo, Dailymotion and HTML5 videos.

GitHub release Supports Sulu 2.6 or later

This bundle adds a new content type video and provides the Twig functions video_provider and video_embed_url to embed external videos in an iframe or video element.

Demonstration of video content type

Installation

This bundle requires PHP 8.2 or later and Node 18 (or Node 14 for Sulu versions <2.6.0) for building the Sulu administration UI.

  1. Open a command console, enter your project directory and run:
composer require robole/sulu-video-bundle

If you're not using Symfony Flex, you'll also need to add the bundle in your config/bundles.php file:

return [
    //...
    Robole\SuluVideoBundle\SuluVideoBundle::class => ['all' => true],
];
  1. Link the frontend code by adding the following to your assets/admin/package.json:
"dependencies": {
    "sulu-video-bundle": "file:../../vendor/robole/sulu-video-bundle/src/Resources/js"
}
  1. Import the frontend code by adding the following to your assets/admin/app.js:
import "sulu-video-bundle";
  1. Install all npm dependencies and build the admin UI (see all options):
cd assets/admin
npm install
npm run build

Usage

  1. Add the video content type to any of your page templates:
<property name="my_video" type="video" mandatory="true">
    <meta>
        <title lang="de">Video</title>
        <title lang="en">Video</title>
    </meta>
</property>
  1. Render the embeddable link in your twig templates:
{% if content['my_video'] %}
    {% if video_provider(content['my_video']) %}
        <!-- YouTube, Vimeo or Dailymotion -->
        <iframe
            src="{{ video_embed_url(content['my_video']) }}"
            frameborder="0"
            allow="fullscreen"
        ></iframe>
    {% else %}
        <!-- HTML5 video -->
        <video
            controls
            src="{{ video_embed_url(content['my_video']) }}"
        ></video>
    {% endif %}
{% endif %}

Background

This small bundle serves as a reference for our blog series "Sulu Bundle Development" showcasing major steps to build a Sulu bundle from scratch. The underlying idea was inspired by the Statamic Video Fieldtype.

Scripts

  • To test the PHP code, run:

    composer phpunit

  • To check the coding standards, run:

    composer php-cs

  • To apply coding standards, run:

    composer php-cs-fix

robole/sulu-video-bundle 适用场景与选型建议

robole/sulu-video-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 286 次下载、GitHub Stars 达 6, 最近一次更新时间为 2025 年 01 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 robole/sulu-video-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 robole/sulu-video-bundle 我们能提供哪些服务?
定制开发 / 二次开发

基于 robole/sulu-video-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 286
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 20
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-22