inquid / yii2-howler-js
Javascript audio library for the modern web. https://howlerjs.com *WIDGET FOR Yii*
Installs: 211
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Language:CSS
Type:yii2-extension
Requires
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2024-10-29 05:34:20 UTC
README
Javascript audio library for the modern web. https://howlerjs.com WIDGET FOR Yii
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist inquid/yii2-howler-js "dev-master"
or add
"inquid/yii2-howler-js": "dev-master"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your code by : Some Howler options are available like volume
<?= \inquid\howlerjs\HowlerJsSimple::widget(['songs' => ["http://www.hochmuth.com/mp3/Vivaldi_Sonata_eminor_.mp3"]]); ?>
Or if you want to use the example full screen player (recommended to use with an empty layout view):
<?= \inquid\howlerjs\HowlerJsPlayer::widget(['path' => Yii::getAlias('@web/music'), 'files' => [ ['title' => 'Vivaldi Example', 'file' => 'Vivaldi_Sonata_eminor_.mp3', 'howl' => null] ] ]); ?>
If you want to use remote http files
\inquid\howlerjs\HowlerJsPlayer::widget([ 'remoteFiles' => true, 'files' => [['title' => $file->name, 'file' => 'https://storage.googleapis.com/enter-video.appspot.com/music/Vivaldi_Sonata_eminor_.mp3', 'howl' => null]] ]);