I'm trying to display a video with HTML5 but the videos are in the storage folder because the user needs to be logged to watch it. The video is working fine, the problem is I can't skip forward and if you want to see the last minute, you need to see the whole video. If I upload the video to the public folder, this is working properly but I can't do it. I'm using Laravel 5.2 if that helps.
Any suggestion?
HTML
<video width="100%" height="auto" controls>
<source src="{{ route('get-video', ['filename' => 'video1.webm']) }}" type="video/webm">
Your browser does not support the video tag.
</video>
Route
Route::get('storage/{filename}', function ($filename)
{
$path = storage_path('app/videos/' . $filename);
return \Response::make(file_get_contents($path), 200, [
'Content-Type' => 'video/webm',
'Content-Disposition' => 'inline; filename="'.$filename.'"'
]);
})->name('get-video');
Thanks.