resolved!
my route:
Route::get('get-video/{video}', 'SiteController@getVideo')->name('getVideo');
my controller action:
public function getVideo(Video $video)
{
$name = $video->name;
$fileContents = Storage::disk('local')->get("uploads/videos/{$name}");
$response = Response::make($fileContents, 200);
$response->header('Content-Type', "video/mp4");
return $response;
}
my view:
<video width="320" height="240" controls>
<source src="{{ route('getVideo', $video->id) }}" type="video/mp4">
Your browser does not support the video tag.
</video>
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community