Blocking a video from being accessed via url?

Thanks for your reply.

I’d like to test this, just to get an idea of how it might work;

I have added this code to an .htaccess file:

RewriteEngine OnRewriteCond %{REQUEST_URI} \.(mp4)$ [NC]
RewriteRule ^ validate.php?request_url=%{REQUEST_URI} [L]

I have added this (validate)php file:

<?php
$v = $_GET['video'] ?? null;

if(file_exists($v)) {
    unlink($v);
    header('Content-type: application/mp4');
    header('Content-Disposition: inline; filename=video.mp4');    
    readfile("./mytestvideoo.mp4");    
} else
   http_response_code(404);

I just don’t know what to do with this part that was provided:

//Generate the link

$normalText = "this is just your average string with words and stuff";

$hashedText = md5($normalText);

fopen($hashedTest, 'w');

echo "<a href='validate.php?video={$hashedText}'>Link to the video</a>

any additional guidance is appreciated.