Craft plugin to generate an embed URL from a YouTube or Vimeo URL.
PHP
Switch branches/tags
Nothing to show
Clone or download
Latest commit e6124ad Sep 13, 2017
Permalink
Failed to load latest commit information.
src rewrite for craft 3 compatibility Sep 13, 2017
.craftplugin rewrite for craft 3 compatibility Sep 13, 2017
.gitignore rewrite for craft 3 compatibility Sep 13, 2017
CHANGELOG.md
LICENSE.md fix license holder Sep 13, 2017
README.md
composer.json rewrite for craft 3 compatibility Sep 13, 2017

README.md

Video Embed plugin for Craft CMS 3.x

Generate an embed URL from a YouTube or Vimeo URL.

Requirements

This plugin requires Craft CMS 3.0.0-beta.23 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require viget/craft-video-embed
    
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Video Embed.

Using Video Embed

Pass a YouTube or Vimeo URL to the getEmbedUrl method and an embed URL will be returned.

<iframe src="{{ craft.videoEmbed.getEmbedUrl('https://www.youtube.com/watch?v=6xWpo5Dn254') }}"></iframe>

Output:

<iframe src="//www.youtube.com/embed/6xWpo5Dn254"></iframe>

Code At Viget

Visit code.viget.com to see more projects from Viget.