I have a site where the main idea is .webms playing and every time you click a button it loads the next .webm at random but I would like to somehow give each webm its own unique URL kind of like (website.com/WEBM-NAME-HERE). I have unique names for all the webm files and would like to also hide the file extenstion in the URL somehow.
Here is what I am currently working with for random webms:
function random_vid($dir = 'storage')
{
$files = glob($dir . '/*.*');
$file = array_rand($files);
return $files[$file];
}
and then in my html I have it give me a random video like this:
<?php include('randomizevid.php');?>
<video autoplay loop>
<source src="<?php echo random_vid(); ?>" type='video/webm'>
</video>
Any help getting those unique URLs is greatly appreciated. I just want it to be so if you share a URL with someone it takes them to the same webm.