I am trying to stream the video in the blade file. Normally video is loading but I am not able to go to and fro.
Here is the link which I followed: https://codesamplez.com/programming/php-html5-video-streaming-tutorial
I have added the class things in my App/VideoStream.php
class and in the blade
<?php
$video_path = 'my_video_ath';
$tmp = new \App\VideoStream($video_path);
$tmp->start();
?>
<video controls preload="auto" src="{{ $tmp }}" width="100%"></video>'
Whats issue in this, please help me out.
The class you're using is to handle the actual range requests. you need to provide a route that uses that as well:
Route::get('stream', function () {
$video_path = 'my_video_path';
$tmp = new \App\VideoStream($video_path);
$tmp->start();
})->name('stream');
Then the HTML will be:
<video controls preload="auto" src="{{ route('stream') }}" width="100%"></video>'
The class in question can be found in Github
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With