title: how to stream video from a thread in PHP?
body: <p>hey i am trying to write web page that stream live video, from my locally server. i want to use threads. so i tried  to use file_get_content and i got gibberish presenting in my web page  . this is the thread, does anybody know different method for presenting video within the thread? </p>
  
  <pre><code>class stream extends Thread {   
      public function run() { 
  $file = "/var/www/html/movie.mp4"; // The media file's location
  
  $f = fopen($file, 'rb'); // Open the file in binary mode
      $chunkSize = 8192; // The size of each chunk to output
  
  // Start outputting the data
      while(true){
  fpassthru($f);
  echo file_get_contents('/var/www/html/movie.mp4');
  
          //echo fread($f, $chunkSize);
      //$data = fread($f, $chunkSize);
            //  echo $data;
              flush();
  }
  }
  }
  </code></pre>