I have media files like mp4, ogg etc to server on page. But the problem is due to some security reasons files don't have any extensions although they are media files. So Apache cant recognize the mime type and hence html5 video tags fail to play videos.
What are my options ?
since i don't have any extension, .htaccess
doesnot work.
If I put file-extension in names then it starts working.
Also I have mime type of these files stored in databse.
File strucure:
asdsad/media
werewr/media
23frwe/media
//where media is the file ( could be mp4/ogg/webm) with no extension.
// before / is folder name
// If i change media to media.mp4 , it works
.htaccess file
AddType video/ogg .ogv .ogm .ogg
AddType audio/ogg .oga .ogg
AddType video/mp4 .mp4
AddType video/webm .webm
AddType video/x-m4v .m4v
AddType text/x-vcard .vcf
what if I output file from php instead of linking it from localpath ? will it work ? something like this.
header("Content-type: video/mp4");
echo file_get_contents($pathTmp4);