iamriajul/laravel-bunny-stream-filesystem-adapter
最新稳定版本:v0.0.11
Composer 安装命令:
composer require iamriajul/laravel-bunny-stream-filesystem-adapter
包简介
Use Bunny Stream Filesystem Adapter for Laravel application
README 文档
README
Bunny Stream for Laravel
This is Laravel Filesystem's Driver for simple integration with Laravel.
Installation
composer require iamriajul/laravel-bunny-stream-filesystem-adapter
Configuration
This package automatically register the service provider and the storage disk for the driver bunny_stream. You can configure the disk in config/filesystems.php:
'bunny_stream' => [ 'driver' => 'bunny_stream', 'hostname' => env('BUNNY_STREAM_HOSTNAME'), 'library_id' => env('BUNNY_STREAM_LIBRARY_ID'), 'api_key' => env('BUNNY_STREAM_API_KEY'), ],
and remember to add the environment variables in your .env file:
BUNNY_STREAM_HOSTNAME=your-stream-cdn.b-cdn.net BUNNY_API_KEY=your-api-key BUNNY_STREAM_LIBRARY_ID=123456
Usage
$videoId = Storage::disk('bunny_stream')->put('abc.mp4', file_get_contents('abc.mp4')); // $videoId = guid from bunny. // Enable Direct File Access from Bunny to Access m3u8 return response(Storage::disk('bunny_stream')->get("$videoId/playlist.m3u8"));
Extra Methods
| Method | Description |
|---|---|
| get($path) | By default returns playlist.m3u8's content, but you can customize it by adding suffix like "$path/playlist.m3u8", "$path/play_240p.mp4" and more. |
| getHls($path) | Returns playlist.m3u8's content, which would be the main entrypoint for any HLS player. |
| getOriginal($path) | As the name suggests, it just returns the original file's content user had uploaded initially |
| getMp4($path, $quality = '240p,360p,etc') | Returns Mp4 file's content, $quality param allows you to customize which file you want, such 240p, 360p, 720p, NOTE: all the quality might not be available depending on the Original file's quality |
| getMp4($path, $quality = 'low,mid,high') | Not recommended to be called in N+1 situation, as this requires API to resolve what resolution is the low, and what is high, mid, etc. |
统计信息
- 总下载量: 8.86k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-20