John Davidson

javascript - Video streaming of the movie with blocked access

0 comments
Message:


I made a small private site (16 people) with a movie player and database.
The idea is that the videos can only be played in the page player, but not directly from the link (domain / media / video.mp4). And I did it, but hosting imposes a limit on the weight of one movie by this way. In addition, I have to wait for the entire movie to download. I have searched many guides, but none match my expectations. What can I do?


My current code (simplified):


I blocked access via .htaccess in the media folder:


Order allow, deny
from all

Encode movie to base64:


if ($file_location == 1) {
$topic_komunikat = $topic;
$file = $location;
$h = fopen($file, 'rb');
$c = fread($h, filesize($file));
fclose($h);
$film = getimagesize($file);
$film = base64_encode($c);
}

and player:


echo
'<video
width="500px"
controls
src="data: video / mp4; base64, '. $film.'"> The “video” tag is not supported by yourbrowser.
</video>';


My Answer:
';

Rate this post

4 of 5 based on 3704 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us