iamriajul/laravel-bunny-stream-filesystem-adapter
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. |
iamriajul/laravel-bunny-stream-filesystem-adapter 适用场景与选型建议
iamriajul/laravel-bunny-stream-filesystem-adapter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12.09k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 02 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 iamriajul/laravel-bunny-stream-filesystem-adapter 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 iamriajul/laravel-bunny-stream-filesystem-adapter 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 12.09k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-20