dharma/laravel-video-uploader

A Laravel package to handle large video uploads with adaptive streaming (HLS) and progress tracking.

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/dharma/laravel-video-uploader

dev-main 2025-12-23 20:30 UTC

This package is auto-updated.

Last update: 2025-12-23 20:39:06 UTC


README

Packagist Version PHP Version License Laravel Version

A simple and elegant Laravel package to handle video uploads effortlessly. Supports single or multiple video uploads with optional validation and storage support. Perfect for modern Laravel applications.

🌟 Features

  • Upload single or multiple videos
  • Supports popular video formats (mp4, mov, avi, etc.)
  • Optional size/type validation
  • Compatible with Laravel 10+
  • Easy integration with custom storage disks
  • Lightweight and developer-friendly

⚙️ Dependencies

Before using dharma/laravel-video-uploader, install:

composer require pbmedia/laravel-ffmpeg:^8.7

⚡ Installation

Install via Composer:

composer require dharma/laravel-video-uploader:^0.1

Publish the config file:

php artisan vendor:publish --provider="Dharma\VideoUploader\VideoUploaderServiceProvider" --tag=config

🚀 Usage Examples

use Dharma\VideoUploader\VideoUploader;

class VideoController extends Controller
{
    protected VideoUploader $video;

    public function __construct(VideoUploader $video)
    {
        $this->video = $video;
    }


    /**
     * List all videos
     */
    public function index()
    {
        // List videos with pagination (20 per page)
        $videos = $this->video->list([], 20);
        return view('video', compact('videos'));
    }

    /**
     * Upload a new video
     */
    public function store(Request $request)
    {
        // Upload video and dispatch processing job
        $video = $this->video->uploadVideo($request->file('video'));
        return response()->json([
            'message' => 'Video uploaded and queued for processing.!',
            'video' => $video
        ]);
    }


    /**
     * Show single video
     */
    public function show(int $id)
    {
        $video = $this->video->getById($id);
        return view('video', compact('video'));
    }


    /**
     * Delete a video by ID
     */
    public function destroy(int $id)
    {
        $this->video->deleteById($id);
        return response()->json([
            'message' => 'Video deleted successfully.!'
        ]);
    }
}