hfg / video
Embed YouTube and Vimeo Videos
Installs: 45
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 2
Type:craft-plugin
Requires
- craftcms/cms: ^3.3.0
This package is auto-updated.
Last update: 2023-01-20 12:22:05 UTC
README
Embed YouTube and Vimeo Videos using a helper function.
Requirements
This plugin requires Craft CMS 3.3.0 or later.
Installation
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require hfg/video
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for hfgvideo.
Configuration
Embed parameters can be configured using a plugin specific config file. Create a new file called video.php
in the config
-Folder of your Craft installation. The following settings are available:
return [
// https://developers.google.com/youtube/player_parameters?hl=de
"youtube" => [
"modestbranding" => 1,
"showinfo" => 0,
"rel" => 0
],
"vimeo" => [
"title" => 0,
"byline" => 0,
"portrait" => 0,
"dnt" => 1
]
];
Usage
This plugin exposes a twig function that renders a YouTube or Vimeo Embed.
<iframe src="{{ generateEmbedUrl(url) }}" frameborder="0" allowfullscreen></iframe>