HTTP Range requests with php for Video Embedding for solving going to specific time in video (seek bar not work)



PHP Snippet 1:

$_SERVER['HTTP_RANGE'] 
header('HTTP/1.1 206 Partial Content');
header('Content-Range: ...); //etc ...

PHP Snippet 2:

<?php
  $vids = ['asbiudsaudsausbdisa' => 'video.mp4'];

  $file_path = "/absolute_path/video_folder";    
  $filehash = $_GET['h'];
  $file_name = $vids[$filehash];
  $file = $file_path."/".$file_name;
  $filesize = filesize($file);

    
  header('Content-Length: ' . $filesize);
  header('Content-Type: video/mp4');
  header('Accept-Ranges: bytes');
  readfile($file);
?>