定制 rajurayhan/larastreamer 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 49
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-07-07