wolfpack-it / yii2-youtube
Yii2 Widget for YouTube
Installs: 150
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
pkg:composer/wolfpack-it/yii2-youtube
Requires
- php: >=7.1.0
- yiisoft/yii2: ~2.0.19
This package is auto-updated.
Last update: 2025-09-11 20:55:21 UTC
README
This extension provides a widget to show a YouTube player for Yii2 Framework.
Installation
The preferred way to install this extension is through composer.
Either run
$ composer require wolfpack-it/yii2-youtube
or add
"wolfpack-it/yii2-youtube": "^<latest version>"
to the require
section of your composer.json
file.
Usage
echo \WolfpackIT\youtube\widgets\YouTube::widget([ 'id' => 'yt-video-player', 'videoId' => '<videoId>', 'enableJsApi' => true, 'jsEvents' => [ 'onStateChange' => new JsExpression('onStateChange'), ], ]);
Full width or responseive video
If you want to have the video to be full width or responsive, check out the following link: https://avexdesigns.com/responsive-youtube-embed/.
Credits
License
The MIT License (MIT). Please see LICENSE for more information.