PHP code example of gebruederheitz / wp-block-video-overlay
1. Go to this page and download the library: Download gebruederheitz/wp-block-video-overlay library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
gebruederheitz / wp-block-video-overlay example snippets
new \Gebruederheitz\GutenbergBlocks\VideoOverlay\VideoOverlayBlock();
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;
});
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")
add_filter(VideoOverlayBlock::HOOK_CC_LANG_PREFS, function ($enabled) {
/* ... */
return true;
});