PHPackages                             mikestecker/craft-videoembedder - 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. mikestecker/craft-videoembedder

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

mikestecker/craft-videoembedder
===============================

Craft plugin to generate an embed URL from a YouTube or Vimeo URL.

1.1.4(6y ago)1799.3k16[1 PRs](https://github.com/mikestecker/craft-videoembedder/pulls)1MITPHPCI failing

Since Aug 6Pushed 1y ago2 watchersCompare

[ Source](https://github.com/mikestecker/craft-videoembedder)[ Packagist](https://packagist.org/packages/mikestecker/craft-videoembedder)[ RSS](/packages/mikestecker-craft-videoembedder/feed)WikiDiscussions v1 Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (15)Used By (1)

Important

**Video Embedder** is no longer in development, in favour of [Video Picker](https://verbb.io/blog/video-picker).

If you've got a Craft 3 site using Video Embedder, [talk to us](https://verbb.io/contact) about a **free** licenses for Video Picker to get your site upgraded.

Video Embedder plugin for Craft CMS 3.x
=======================================

[](#video-embedder-plugin-for-craft-cms-3x)

Craft plugin to generate an embed URL from a YouTube or Vimeo URL. This plugin will be 100% free.

Ported over from [Viget's](https://viget.com) [Video Embed plugin for Craft 2.x](https://github.com/vigetlabs/craft-videoembed).

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 3.0.0 or later.

Installation
------------

[](#installation)

To install Video Embedder, follow these steps:

1. Install with Composer via `composer require mikestecker/craft-videoembedder` from your project directory
2. Install plugin in the Craft Control Panel under Settings &gt; Plugins

Video Embedder works on Craft 3.x.

Video Embedder Overview
-----------------------

[](#video-embedder-overview)

Video Embedder will take your YouTube or Vimeo URL's and convert the URL into an embed-friendly URL for use inside an iframe tag. Video Embedder also has a variable which will take the same URL and get the thumbnail image URL.

Using Video Embedder
--------------------

[](#using-video-embedder)

Pass a YouTube or Vimeo URL to the `getEmbedUrl` variable and an embed URL will be returned. The plugin will check if the URL is valid and allows embedding. If it doesn't, it will return an empty string.

```
{% set embed = craft.videoEmbedder.getEmbedUrl('https://www.youtube.com/watch?v=6xWpo5Dn254') %}

{% if embed | length %}
    {{ embed }}
{% endif %}

```

**Example:**

```
{% set embed = craft.videoEmbedder.getEmbedUrl('https://www.youtube.com/watch?v=6xWpo5Dn254') %}

{% if embed | length %}

{% endif %}

```

**Output:**

```

```

---

***New in 1.0.5:***

`getEmbedUrl` will now accept optional parameters to YouTube and Vimeo URL's such as `autoplay`, `rel`, etc:

```
{% set embed = craft.videoEmbedder.getEmbedUrl('https://www.youtube.com/watch?v=6xWpo5Dn254', {autoplay: 1, rel: 0, theme: 'dark'}) %}

```

---

Video Embedder will also pull the largest thumbnail URL from YouTube or Vimeo using the `getVideoThumbnail` variable.

```
{% set thumbnail = craft.videoEmbedder.getVideoThumbnail('https://www.youtube.com/watch?v=6xWpo5Dn254') %}

{% if thumbnail | length %}
    {{ thumbnail }}
{% endif %}

```

**Output:**

```
//img.youtube.com/vi/6xWpo5Dn254/0.jpg

```

---

***New in 1.0.5:***

Video Embedder will now generate the iframe code. Simple use the `embed` variable with your URL. You can also pass in optional parameters to YouTube and Vimeo URL's such as `autoplay`, `rel`, etc.

Basic example:

```
{% set embed = craft.videoEmbedder.embed('https://www.youtube.com/watch?v=6xWpo5Dn254') %}

{% if embed | length %}
    {{ embed }}
{% endif %}

```

With parameters:

```
{% set embed = craft.videoEmbedder.embed('https://www.youtube.com/watch?v=6xWpo5Dn254', {autoplay: 1, rel: 0, theme: 'dark'}) %}

```

These parameters will simply output at the end of the embed URL string and have only been tested with YouTube and Vimeo. Check with each provider for which parameters are supported.

---

***New in 1.0.9:***

Return only the Vimeo or YouTube ID from the URL. This is helpful in use cases such as using it with [Plyr](https://github.com/sampotts/plyr/)

Basic example:

```
{% set videoUrl = 'https://www.youtube.com/watch?v=6xWpo5Dn254' %}
{% set videoId = craft.videoEmbedder.getVideoId(videoUrl) %}
{% set providerName = craft.videoEmbedder.getProviderName(videoUrl) %}

{% if videoId | length %}

{% endif %}

```

Video Embedder Roadmap
----------------------

[](#video-embedder-roadmap)

Some things to do, and ideas for potential features:

- Add in the ability to actually generate the iframe HTML
- Add new Video URL fieldype (thanks @samuelbirch!)
- Limit Video URL fieldtype to only allow for supported video URL's
- Add support for more video providers (partially added with 1.0.5 by switching to using the [Embed](https://github.com/oscarotero/Embed) library)
- Add more thumbnail size options
- Testing

This is my first plugin and I'm not very experienced with plugin development. Feel free to fork away, add whatever you'd like to see and send me a pull request.

Brought to you by [Mike Stecker](http://github.com/mikestecker)

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 87.8% 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 ~194 days

Recently: every ~566 days

Total

15

Last Release

490d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ab6d55f16a3cd45b28057a9a4c838a4f25ef57ee9933307b2351e95cbd688ae9?d=identicon)[mikestecker](/maintainers/mikestecker)

---

Top Contributors

[![mikestecker](https://avatars.githubusercontent.com/u/407465?v=4)](https://github.com/mikestecker "mikestecker (43 commits)")[![samuelbirch](https://avatars.githubusercontent.com/u/13586?v=4)](https://github.com/samuelbirch "samuelbirch (2 commits)")[![billythekid](https://avatars.githubusercontent.com/u/330170?v=4)](https://github.com/billythekid "billythekid (1 commits)")[![brandonkelly](https://avatars.githubusercontent.com/u/47792?v=4)](https://github.com/brandonkelly "brandonkelly (1 commits)")[![engram-design](https://avatars.githubusercontent.com/u/1221575?v=4)](https://github.com/engram-design "engram-design (1 commits)")[![mijewe](https://avatars.githubusercontent.com/u/1457786?v=4)](https://github.com/mijewe "mijewe (1 commits)")

---

Tags

cmsCraftcraftcmscraft-pluginvideo embedder

### Embed Badge

![Health badge](/badges/mikestecker-craft-videoembedder/health.svg)

```
[![Health](https://phpackages.com/badges/mikestecker-craft-videoembedder/health.svg)](https://phpackages.com/packages/mikestecker-craft-videoembedder)
```

###  Alternatives

[verbb/navigation

Create navigation menus for your site.

90683.7k17](/packages/verbb-navigation)[verbb/hyper

A user-friendly links field for Craft.

24130.9k9](/packages/verbb-hyper)[verbb/formie

The most user-friendly forms plugin for Craft.

101372.9k40](/packages/verbb-formie)[verbb/comments

Add comments to your site.

13753.1k](/packages/verbb-comments)[verbb/tablemaker

Create customizable and user-defined table fields.

40168.8k1](/packages/verbb-tablemaker)[supercool/tablemaker

Create customizable and user-defined table fields.

40141.7k](/packages/supercool-tablemaker)

PHPackages © 2026

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