yaroslawww/nova-chunked-video

A highly targeted package for downloading video in chunks.

1.0.0 2021-04-22 22:26 UTC

This package is auto-updated.

Last update: 2021-04-22 22:28:09 UTC


README

A highly targeted package for downloading video in chunks.

Installation

You can install the package via composer:

composer require yaroslawww/nova-chunked-video
# optional publish configs
php artisan vendor:publish --provider="ThinkOne\ChunkedVideo\FieldServiceProvider" --tag="config"

Usage

ChunkedVideo::make( 'Video', 'big_video' )
    ->acceptedTypes( 'video/mp4' )
    ->disk( 'my_private_disk' )
    ->store( function ( $filePath, $disk, $model, $attribute, $request ) {
        // something like delete old video and save new
        
        $model->big_video = $filePath;
        $model->save();
        
        return Storage::disk($disk)->url($filePath);
    } )
    ->preview( function ( $value, $disk, $model ) {
        // return preview url
        return Storage::disk($disk)->url($value);
    } )
    ->help( 'Usually a large video: 0.5-2GB. Max size 3GB' ),

Credits

  • Think Studio