jorarmarfin/laravel_youtube
Composer 安装命令:
composer require jorarmarfin/laravel_youtube
包简介
Get the information from a YouTube video
README 文档
README
A simple way to show the metadata of a YouTube video in Laravel
Installation
The LaravelYoutube service provider can be installed via composer by requiring the jorarmarfin/laravel_youtube package in your project's composer.json.
Laravel 5.5+ will use the auto-discovery function.
{
"require": {
"jorarmarfin/laravel_youtube": "0.0.2"
}
}
If you don't use auto-discovery you will need to include the service provider / facade in config/app.php.
'providers' => [ //... JorarMarfin\LaravelYoutube\LaravelYoutubeServiceProvider::class, ] //... 'aliases' => [ //... 'LaravelYoutube' => JorarMarfin\LaravelYoutube\Facades\LaravelYoutubeFacade::class ]
That's it! You're good to go.
Here is a little example:
use LaravelYoutube; // at the top of the file $data = LaravelYoutube::getData('https://www.youtube.com/watch?v=cYgkfQUUwWQ'); $data is object +"thumbnail_url": "https://i.ytimg.com/vi/cYgkfQUUwWQ/hqdefault.jpg" +"version": "1.0" +"type": "video" +"html": "<iframe width="480" height="270" src="https://www.youtube.com/embed/cYgkfQUUwWQ?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; ▶" +"provider_url": "https://www.youtube.com/" +"thumbnail_width": 480 +"width": 480 +"thumbnail_height": 360 +"author_url": "https://www.youtube.com/user/CocinoThai" +"height": 270 +"author_name": "Kwan Homsai" +"title": "Receta de Pollo Teriyaki - Chicken Teriyaki Recipe l Kwan Homsai" +"provider_name": "YouTube"
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-02-07