PHPackages                             viget/craft-video-embed - 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. viget/craft-video-embed

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

viget/craft-video-embed
=======================

Generate an embed URL from a YouTube or Vimeo URL

3.1.0(2w ago)2467.6k↓61.1%4[8 issues](https://github.com/vigetlabs/craft-videoembed/issues)[2 PRs](https://github.com/vigetlabs/craft-videoembed/pulls)MITPHPPHP ^8.2.0CI passing

Since Sep 13Pushed 2w ago25 watchersCompare

[ Source](https://github.com/vigetlabs/craft-videoembed)[ Packagist](https://packagist.org/packages/viget/craft-video-embed)[ RSS](/packages/viget-craft-video-embed/feed)WikiDiscussions v3 Synced yesterday

READMEChangelog (6)Dependencies (6)Versions (23)Used By (0)

Video Embed plugin for Craft CMS 5.x
====================================

[](#video-embed-plugin-for-craft-cms-5x)

Generate an embed URL from a YouTube or Vimeo URL.

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

[](#requirements)

This plugin requires Craft CMS 5.0.0 or later.

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

[](#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
-----------------

[](#using-video-embed)

Pass a YouTube or Vimeo URL to the `getVideoData` method and a `VideoData` object is returned.

If the plugin is unable to parse the URL, `null` is returned.

- `type` - If the video is `youtube` or `vimeo`
- `id` - The ID of the video
- `image` - The thumbnail of the video (only works for Youtube)
- `embedUrl` - The URL you would use for the embed
- `url` - The link to the embedded video
- `isVertical` - `true` for YouTube Shorts (vertical/portrait) videos, otherwise `false`. Detected from the `/shorts/` URL form, not the video's true orientation.

**Example:**

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

{% if video %}

{% endif %}
```

**Output:**

```

```

YouTube embed URLs include `rel=0` so related-video suggestions stay on the same channel rather than promoting unrelated videos.

### Customizing URL params

[](#customizing-url-params)

Because `embedUrl` already carries a query string (YouTube's `rel=0`, or a Vimeo privacy `h` hash), add your own player params with Craft's built-in [`url()`](https://craftcms.com/docs/5.x/reference/twig/functions.html#url) function rather than concatenating onto `embedUrl`. `url()` preserves the existing params and merges in your own:

```

{# → https://www.youtube.com/embed/6xWpo5Dn254?rel=0&autoplay=1&mute=1 #}
```

---

[ ![Code At Viget](https://camo.githubusercontent.com/93b8927421fe8b33578eb274ce1d4b71954df6f83e2b0e51c28d92e8ac64d6ac/687474703a2f2f636f64652e76696765742e636f6d2f6769746875622d62616e6e65722e706e67)](http://code.viget.com)Visit [code.viget.com](http://code.viget.com) to see more projects from [Viget.](https://viget.com)

###  Health Score

63

—

FairBetter than 99% of packages

Maintenance90

Actively maintained with recent releases

Popularity40

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 50% 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 ~266 days

Recently: every ~10 days

Total

13

Last Release

16d ago

Major Versions

1.2.2 → 2.0.02022-09-07

2.0.3 → 3.0.02025-02-04

v2.x-dev → 3.1.02026-06-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/9728af4299f2de6d5f099f957bf6f4c8b312076b104910f8d4d8afc39540b686?d=identicon)[viget](/maintainers/viget)

---

Top Contributors

[![joshuapease](https://avatars.githubusercontent.com/u/2145998?v=4)](https://github.com/joshuapease "joshuapease (14 commits)")[![davist11](https://avatars.githubusercontent.com/u/199985?v=4)](https://github.com/davist11 "davist11 (5 commits)")[![maxfenton](https://avatars.githubusercontent.com/u/906502?v=4)](https://github.com/maxfenton "maxfenton (4 commits)")[![ten1seven](https://avatars.githubusercontent.com/u/137020?v=4)](https://github.com/ten1seven "ten1seven (4 commits)")[![ThomasDeMarez](https://avatars.githubusercontent.com/u/10974106?v=4)](https://github.com/ThomasDeMarez "ThomasDeMarez (1 commits)")

---

Tags

craft-plugincraft5craftcmscmsCraftcraftcmscraft-pluginvideo-embed

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/viget-craft-video-embed/health.svg)

```
[![Health](https://phpackages.com/badges/viget-craft-video-embed/health.svg)](https://phpackages.com/packages/viget-craft-video-embed)
```

###  Alternatives

[verbb/formie

The most user-friendly forms plugin for Craft.

102393.6k69](/packages/verbb-formie)[verbb/comments

Add comments to your site.

13753.9k](/packages/verbb-comments)[verbb/navigation

Create navigation menus for your site.

92705.0k18](/packages/verbb-navigation)[verbb/vizy

A flexible visual editor field for Craft.

4250.4k](/packages/verbb-vizy)[verbb/hyper

A user-friendly links field for Craft.

24147.8k12](/packages/verbb-hyper)[verbb/workflow

Enforce multi-step review processes for creating entries.

138124.1k1](/packages/verbb-workflow)

PHPackages © 2026

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