I'm trying to play a video via php and html5, and hiding or protecting the url.
<?php
$path = "http://myserver.com/myfiles/greetings.mp4";
$filePointer = fopen($path, 'r');
header('Content-Type: video/mp4');
fpassthru($filePointer);
?>
It works not good, the video loads in the player, but the player not play the video until the video are fully 100% loaded, my video is a 40mb file size.
- note: header("Content-Length: ".filesize($path)); // this not work correctly too //
This is my html code
<video width="400" controls>
<source src="myvideo.php" type="video/mp4">
</video>
Sorry if my question is not perfect :(
Comment: In other words im, using fopen(); for transfer the video not direct, for protect or hide my original video source...