Lolak
Lolak

Reputation: 317

Pseudo Streaming MP4 with php

i am trying to make the video seek using php file

this is my code

<?php
$path = 'http://exmaple.com/video.mp4'; 
$mm_type="video/mp4"; 

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Type: " . $mm_type);
header("Content-Length: " .(string)(filesize($path)) );
header('Content-Disposition: attachment; filename="'.basename($path).'"');
header("Content-Transfer-Encoding: binary
");

readfile($path); // outputs the content of the file

exit();

?>

the video work but it is not possible to seek

Upvotes: 0

Views: 919

Answers (1)

szatmary
szatmary

Reputation: 31101

Seeking requires that your server support handling of the Content-Range: header

Upvotes: 1

Related Questions