Closed davidbonting closed 4 years ago
hmmmmmm, I have to test it out. Honestly since I have too many packages I am not that much accurate these days.
I am experiencing the same issue on Laravel 5.7
I think the return
keyword is forgotten.
Could you please go to the vendor folder and change the source code like this:
public function register()
{
Response::macro('streamVideoFile', function ($filePath) {
return response()->stream(function () use ($filePath) {
$stream = new VideoStreamer($filePath);
return $stream->start();
});
});
}
If it did not work, then test this :
public function register()
{
Response::macro('streamVideoFile', function ($filePath) {
$stream = new VideoStreamer($filePath);
return $stream->start();
});
}
and report me the result, thanks
I highly recommend you to install version 2.x there is an other important fix which causes the video to stream more gradually. there is also a config file for you.
Sorry for the late reply, but 2.x indeed works, thanks!
Iman\Streamer\VideoStreamer::streamFile($path);
On a fresh installation of Laravel, your example did not workout for me. I did solve it, by looking at your code and manually doing the same thing in my web.php routes:
But this:
Didn't workout. Maybe more people are experience this issue? Or do macro's never work directly from web.php?
But all in all, great package!