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.1(1y ago)01.2k↓50%GPL-3.0-onlyPHPPHP &gt;=8.1

Since Jul 8Pushed 1y 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 1mo ago

READMEChangelog (10)Dependencies (10)Versions (24)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

39

—

LowBetter than 86% of packages

Maintenance47

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 89.4% of commits — single point of failure

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 ~62 days

Recently: every ~104 days

Total

23

Last Release

392d 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

[![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

[scssphp/scssphp

scssphp is a compiler for SCSS written in PHP.

62827.7M220](/packages/scssphp-scssphp)[php-soap/wsdl

Deals with WSDLs

173.5M12](/packages/php-soap-wsdl)[league/uri-components

URI components manipulation library

31932.3M67](/packages/league-uri-components)[fivefilters/readability.php

A PHP port of Readability.js

311826.8k5](/packages/fivefilters-readabilityphp)[bezhansalleh/filament-panel-switch

Easily Switch between your Filament Panels

159323.5k2](/packages/bezhansalleh-filament-panel-switch)[jane-php/json-schema-runtime

Jane runtime Library

1811.1M13](/packages/jane-php-json-schema-runtime)

PHPackages © 2026

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