aodihis/video-utils

Twig filter to get the video id of youtube or Vimeo URL.

Maintainers

πŸ‘ aodihis

Package info

github.com/aodihis/craftcms-video-utils

Documentation

Type:craft-plugin

pkg:composer/aodihis/video-utils

Statistics

Installs: 5 374

Dependents: 2

Suggesters: 0

Stars: 2

Open Issues: 1

3.0.2 2024-07-12 22:24 UTC

Requires

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT e7eaa3122975a4fbec0dc1b9b941f97546b81cee

  • aodihis

cmsCraftcraftcmscraft-pluginyoutube idget video idvideo utils

This package is auto-updated.

Last update: 2026-06-13 07:53:58 UTC


README

Twig filter to get the video id of youtube or Vimeo URL.

Requirements

This plugin requires Craft CMS 3.0.0 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 aodihis/video-utils
    
  3. In the Control Panel, go to Settings β†’ Plugins and click the β€œInstall” button for Get Video Id.

Using Vide Utils

To check url is vimeo or youtube.

{{ "url"|isYoutube}}
{{ "url"|isVimeo}}

To get the video id from the url.

{{ "your youtube video url"|getYoutubeId }}
{{ "your Vimeo video url"|getVimeoId }}

Also you can do this:

{{ "url"|getVideoId }}

To generate the embed video url from your video id :

{{ "your youtube video url"|generateYoutubeEmbedUrl }}
{{ "your Vimeo video url"|generateVimeoEmbedUrl }}

Also you can do this :

{{ "url"|generateVideoEmbedUrl }}

if you wanted to get the embedded video with the no cookie :

{{ "url"|generateVideoEmbedUrl('no-cookie') }}
{{ "your youtube video url"|generateYoutubeEmbedUrl('no-cookie') }}
{{ "your Vimeo video url"|generateVimeoEmbedUrl('no-cookie') }}

To generate youtube live chat url:

{{ "url"|generateYoutubeLiveChatUrl }}