for my current project i need a folder that contains videos which should only be seeable for registered users, i know that i can block the access via .htaccess file but at least i dont exactly get what i want..
my currently .htaccess file is like this:
Deny from all
at the moment im importing the videos/pictures through php which works for accessing them but its really really slow..
here is an example for my pictures:
<img src="data:image/png;base64,<?php echo base64_encode(file_get_contents("directory")) ?>">
and here for my videos:
<img src="data:video/mp4;base64,<?php echo base64_encode(file_get_contents("directory")) ?>">
im sure there is a better way where the page doesnt take forever to load, i also tried a video stream with php but i get another problem there, i cant leave the page anymore or again like before it takes forever to click links or leave.. 🙁
help is much appreciated!
2
Answers
For anyone having the same issue i found a working code in another thread: https://stackoverflow.com/a/47626870/16587767
the code which also works on mobile devices while still having the skip functionality in the videos is this:
You can do something like
<img src="getfile.php?file=foo.mp4">
and: