Yii2 Lazy YouTube Loader
YouTube lazy load. Accelerate page loading with youtube video.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist ilis/yii2-lazy-youtube "*"
or add
"ilis/yii2-lazy-youtube": "*"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your code by :
<?= \ilis\lazyyt\LazyYT::widget([
'url' => 'https://www.youtube.com/watch?v=S5S9LIT-hdc'
]); ?>
or by short link to :
<?= \ilis\lazyyt\LazyYT::widget([
'url' => 'https://youtu.be/S5S9LIT-hdc'
]); ?>