protonemedia / laravel-ffmpeg

This package provides an integration with FFmpeg for Laravel. Laravel's Filesystem handles the storage of the files.
https://protone.media/en/blog/how-to-use-ffmpeg-in-your-laravel-projects
MIT License
1.67k stars 194 forks source link

Error ProtoneMedia\LaravelFFMpeg\Http\DynamicHLSPlaylist::parseLines(): Argument #1 ($lines) must be of type string, null given, called in #497

Closed isarjanfaza closed 1 year ago

isarjanfaza commented 1 year ago

Hi My Code is:

Route::group(['prefix' => 'video'], function () {
    Route::get('/secret/{key}', function ($key) {
        return Storage::disk('public')->download("videos/redfield.m3u8");
       // return Storage::disk('secrets')->download("videos/{$key}");
    })->name('video.key');

    Route::get('/{playlist}', function ($playlist) {
        return FFMpeg::dynamicHLSPlaylist()
            ->fromDisk('public')
            ->open($playlist)
            ->setKeyUrlResolver(function ($key) {
                return route('video.key', ['key' => $key]);
            })
            ->setMediaUrlResolver(function ($mediaFilename) {
                return Storage::disk('public')->url("videos/{$mediaFilename}");
            })
            ->setPlaylistUrlResolver(function ($playlistFilename) {
                return route('video.playlist', ['playlist' => $playlistFilename]);
            });
    })->name('video.playlist');
});

but when Call Show Error :

TypeError PHP 8.1.2-1ubuntu2.11 10.13.2 ProtoneMedia\LaravelFFMpeg\Http\DynamicHLSPlaylist::parseLines(): Argument #1 ($lines) must be of type string, null given, called in /var/www/MasterApi/vendor/pbmedia/laravel-ffmpeg/src/Http/DynamicHLSPlaylist.php on line 227

please help me

isarjanfaza commented 1 year ago

I Found Error change Code To ->open("videos/{$playlist}")