0

I am giving Video.js a source from PHP using:

header("Cache-Control: no-cache");
header("Content-Type: video/mp4");
header("Content-Transfer-Encoding: chunked");
header("Accept-Ranges: bytes");
header("Content-Length: $length");

readfile("$url");
exit;

However, the video will not start playing until it is fully downloaded. How can I get Video.js to commence playback immediately without waiting for file to fully download?

user5919866
  • 69
  • 1
  • 8
  • Lots of variables here. It may even be due to the way the .mp4 is encoded, ie if the metadata block is not at the beginning of the file. – cOle2 Feb 24 '21 at 19:59
  • possible duplicate of https://stackoverflow.com/q/58047449/13695921 – EEAH Feb 24 '21 at 20:00
  • If I give it the direct mp4 file link, it works fine. The stream begins immediately and does not wait for download. It is when I use a php script to fetch file and send to video.js that the problem occurs. – user5919866 Feb 24 '21 at 20:31

0 Answers0