PHPackages                             gebruederheitz/wp-block-video-overlay - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. gebruederheitz/wp-block-video-overlay

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

gebruederheitz/wp-block-video-overlay
=====================================

The backend helper for the video overlay block.

v4.0.2(1mo ago)01.3k↓75%GPL-3.0-onlyPHPPHP &gt;=8.1

Since Jul 8Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/gebruederheitz/wp-block-video-overlay-backend)[ Packagist](https://packagist.org/packages/gebruederheitz/wp-block-video-overlay)[ RSS](/packages/gebruederheitz-wp-block-video-overlay/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (20)Versions (25)Used By (0)

Wordpress Block Video Overlay (Backend Module)
==============================================

[](#wordpress-block-video-overlay-backend-module)

see [@gebruederheitz/wp-block-video-overlay](https://www.npmjs.com/package/@gebruederheitz/wp-block-video-overlay)

Usage
-----

[](#usage)

### Registering the block

[](#registering-the-block)

Given you have already initialized the [gebruederheitz/wp-gutenberg-blocks](https://packagist.org/packages/gebruederheitz/wp-gutenberg-blocks)BlockRegistrar somewhere:

```
\Gebruederheitz\GutenbergBlocks\BlockRegistrar::getInstance();
```

You will then simply have to instantiate a `VideoOverlayBlock`:

```
new \Gebruederheitz\GutenbergBlocks\VideoOverlay\VideoOverlayBlock();
```

### Using consent management functionality

[](#using-consent-management-functionality)

Managing user consent of third-party platforms is quite simple with this block and [`@gebruederheitz/consent-tools`](https://www.npmjs.com/package/@gebruederheitz/consent-tools). To provide the editor scripts in [`@gebruderheitz/wp-block-video-overlay`](https://www.npmjs.com/package/@gebruederheitz/wp-block-video-overlay)with a list of possible embed types, use the filter hook:

```
use Gebruederheitz\GutenbergBlocks\VideoOverlay\VideoOverlayBlock;

add_filter(VideoOverlayBlock::HOOK_EMBED_TYPES, function ($embedTypes) use $services {
    $embedTypes[''] = ['displayName' => 'internal'];

        foreach ($services as $serviceId => $service) {
            $embedTypes[$serviceId] = [
                'displayName' => $service['prettyName'] ?? $serviceId,
            ];
        }

        return $embedTypes;
});
```

#### Changing the default embed provider

[](#changing-the-default-embed-provider)

You can simply pass the default service's identifier to the constructor:

```
use Gebruederheitz\GutenbergBlocks\VideoOverlay\VideoOverlayBlock;

new VideoOverlayBlock();   // Default: 'youtube' service (data-ghct-src and data-ghct-type="youtube")
new VideoOverlayBlock(''); // Default: no consent management (src and no data-ghct-src)
new VideoOverlayBlock('vimeo') // Default: 'vimeo' service (data-ghct-src and data-ghct-type="vimeo")
```

### Enabling video captions

[](#enabling-video-captions)

Use the filter hook `HOOK_CC_LANG_PREFS` to provide an array of available languages on your site to allow editors to input a language preset for Youtube captions:

```
add_filter(VideoOverlayBlock::HOOK_CC_LANG_PREFS, function ($enabled) {
    /* ... */
    return true;
});
```

Editors may input a string in the Block Editor representing a language or locale slug (like "en", "en-GB", "en-US", "fr", "de-DE" etc.). The input is sanitized to only allow alphanumeric characters, dashes and underscores.

### Defining additional attributes

[](#defining-additional-attributes)

Yes, there's a filter hook for that:

```
use Gebruederheitz\GutenbergBlocks\VideoOverlay\VideoOverlayBlock;

add_filter(VideoOverlayBlock::HOOK_ATTRIBUTES, function ($attributes) {
    $attributes['myCustomAttribute'] = [
        'type' => 'string',
        'default' => 'attribute default value',
    ];

    return $attributes;
})
```

### Changing the block markup

[](#changing-the-block-markup)

You can override the template used by the block by simply putting a file into `wp-content/themes/{your-theme}/template-parts/blocks/video-overlay.php`. The block's attributes are accessible using `get_query_var('attributeName')`. Take look at [the default template](templates/video-overlay.php) as an example.

Alternatively you can filter &amp; override the template partial path and gain even more control:

```
add_filter(VideoOverlayBlock::HOOK_TEMPLATE_PARTIAL, function (string $partial, string $type, array $attributes) {
    if ($type === 'overlay') {
        return get_theme_file_path('templates/block/video/video-type-overlay.php');
    }

    return $partial;
}, 3);
```

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance92

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~77 days

Recently: every ~203 days

Total

24

Last Release

38d ago

Major Versions

v1.1.0 → v2.0.02021-10-27

v2.4.0-alpha.1 → v3.0.0-alpha.12024-02-05

v3.1.0 → v4.0.0-beta.12024-03-06

PHP version history (3 changes)v1.0.0PHP ^7.3

v2.2.1PHP &gt;=7.3

v3.0.0-alpha.2PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/d2a201d58341e3ed71321bcb66cb375a8c6efffce7d8fe33244e821afc087c78?d=identicon)[mediocrity](/maintainers/mediocrity)

---

Top Contributors

[![CVE42-chicken](https://avatars.githubusercontent.com/u/25008845?v=4)](https://github.com/CVE42-chicken "CVE42-chicken (44 commits)")[![AndreasMaros](https://avatars.githubusercontent.com/u/25008845?v=4)](https://github.com/AndreasMaros "AndreasMaros (42 commits)")[![koetzsch](https://avatars.githubusercontent.com/u/109957039?v=4)](https://github.com/koetzsch "koetzsch (5 commits)")

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gebruederheitz-wp-block-video-overlay/health.svg)

```
[![Health](https://phpackages.com/badges/gebruederheitz-wp-block-video-overlay/health.svg)](https://phpackages.com/packages/gebruederheitz-wp-block-video-overlay)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[php-soap/wsdl

Deals with WSDLs

184.0M19](/packages/php-soap-wsdl)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[amphp/http-server

A non-blocking HTTP application server for PHP based on Amp.

1.3k6.7M110](/packages/amphp-http-server)[amphp/http-client

An advanced async HTTP client library for PHP, enabling efficient, non-blocking, and concurrent requests and responses.

7309.5M205](/packages/amphp-http-client)[symfony/html-sanitizer

Provides an object-oriented API to sanitize untrusted HTML input for safe insertion into a document's DOM.

27941.7M141](/packages/symfony-html-sanitizer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
