Can someone kindly let me know what I am missing here? I want to play a video using html5 video tag by calling a php script. I don't want to display the source of the video directly.
HTML file: video.html
<video width="400" controls>
<source src="getVideo.php" type="video/mp4">
</video>
PHP file: getVideo.php
<?php
$file_name = 'media/abc_video.mp4';
$file_size = (string)(filesize($file_name));
header('Content-Type: video/mp4');
header('Content-Length: '.$file_size);
readfile($file_name);
?>
The html page is not loading video, only a blank video player ...
I am able to play the video directly so permission should be working:
HTML file: video.html
<video width="400" controls>
<source src="media/abc_video.mp4" type="video/mp4">
</video>
Many thanks,