Embedder plugin for Craft CMS 3.x
Embed videos (YouTube, Vimeo, Facebook) easily!, (*1)
Requirements
This plugin requires Craft CMS 3.0.0-beta.23 or later., (*2)
Installation
To install the plugin, follow these instructions., (*3)
-
Open your terminal and go to your Craft project:, (*4)
cd /path/to/project
-
Then tell Composer to load the plugin:, (*5)
composer require tibemolde/embedder
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for Embedder., (*6)
Embedder Overview
Embed videos easily!, (*7)
Configuring Embedder
No configuration is needed outside of runtime-options, however you can tweak where video-posters are stored locally through the plugin-settings, (*8)
Using Embedder
Basic usage:, (*9)
<div class="embed embed--{{ craft.embedder.getVideoType(videoUrl) }}">
<iframe src="{{ craft.embedder.getVideoEmbedUrl(videoUrl) }}" title="{{ 'Watch video'|t }}"></iframe>
</div>
Style as you please (this is just an example):, (*10)
.embed {
position: relative;
overflow: hidden;
width: 100%;
height: auto;
padding-bottom: 56.25%; /* ratio for 16:9 embed */
iframe,
object,
embed {
position: absolute;
top: 0;
left: 0;
width: 100% !important;
height: 100% !important;
border: 0;
}
}
Embedder Roadmap
Some things to do, and ideas for potential features:, (*11)
- Support oEmbed
- Support audio-playlists (Spotify, Soundcloud etc)
Brought to you by TIBE Molde, (*12)