astrotomic / laravel-medialibrary-hls
                                    Fund package maintenance!
                                                                            
                                                                                                                                        Gummibeer
                                                                                    
                                                                            
                                                                                                                                        forest.astrotomic.info
                                                                                    
                                                                
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 2
Forks: 4
Open Issues: 0
pkg:composer/astrotomic/laravel-medialibrary-hls
Requires
- php: ^7.4 || ^8.0
- illuminate/broadcasting: ^7.0 || ^8.0
- illuminate/contracts: ^7.0 || ^8.0
- illuminate/filesystem: ^7.0 || ^8.0
- illuminate/queue: ^7.0 || ^8.0
- illuminate/support: ^7.0 || ^8.0
- php-ffmpeg/php-ffmpeg: ^0.18.0
- spatie/laravel-medialibrary: ^9.1.0
- symfony/process: ^5.3
Requires (Dev)
- orchestra/testbench: ^5.0 || ^6.0
- phpunit/phpunit: ^9.3
README
Installation
composer require astrotomic/laravel-medialibrary-hls
Usage
You can listen for \Astrotomic\MediaLibrary\Hls\Events\HlsHasBeenGenerated event to do anything after the HLS files have been generated and stored.
The files will be stored in a structure like the following:
conversions/hls/
├── 1080p
│   ├── 0000.ts
│   ├── 0001.ts
│   └── playlist.m3u8
├── 360p
│   ├── 0000.ts
│   ├── 0001.ts
│   └── playlist.m3u8
├── 720p
│   ├── 0000.ts
│   ├── 0001.ts
│   └── playlist.m3u8
└── playlist.m3u8
To play the video you should pass the playlist.m3u8 URL to your video player. The lowest one contains a reference to all explicit playlists so the user can pick the favorite resolution. In case you want to predefine this you can also pass an explicit playlist file to your frontend.