Yii2 Widget for YouTube
This extension provides a widget to show a YouTube player for Yii2 Framework.
The preferred way to install this extension is through composer.
$ composer require wolfpack-it/yii2-youtube
"wolfpack-it/yii2-youtube": "^<latest version>"
require section of your
echo \WolfpackIT\youtube\widgets\YouTube::widget([ 'id' => 'yt-video-player', 'videoId' => '<videoId>', 'enableJsApi' => true, 'jsEvents' => [ 'onStateChange' => new JsExpression('onStateChange'), ], ]);
If you want to have the video to be full width or responsive, check out the following link: https://avexdesigns.com/responsive-youtube-embed/.
The MIT License (MIT). Please see LICENSE for more information.