rajurayhan/larastreamer
最新稳定版本:v1.0.0
Composer 安装命令:
composer require rajurayhan/larastreamer
包简介
A laravel package to stream video content.
README 文档
README
Installation
Install via Composer
composer require rajurayhan/larastreamer
Publish Configuration
php artisan vendor:publish --tag=larastreamer
Usage
This package shipped with a built in streaming route -
Route::get('/stream/{filename}', 'Raju\Streamer\Controllers\StreamController@stream')->name('stream');
Just send filename on route and stream!
Or just build your own method following this-
/* Controller */
use Raju\Streamer\Helpers\VideoStream;
class StreamController extends Controller
{
public function stream($filename)
{
$videosDir = config('larastreamer.basepath');
if (file_exists($filePath = $videosDir."/".$filename)) {
$stream = new VideoStream($filePath);
return response()->stream(function() use ($stream) {
$stream->start();
});
}
return response("File doesn't exists", 404);
}
}
Note
Default file base path is set to -
storage_path('app/uploads/')
To change, edit config/larastreamer.php
Find Me
Email: devraju.bd@gmail.com
统计信息
- 总下载量: 7.55k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 50
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-07-07