index.php 691 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /**
  3. * index.php - The Entry File
  4. **/
  5. // Start the session
  6. session_start();
  7. // It is really important to regenerate id on every click...
  8. session_regenerate_id();
  9. // We will tell the next file that we have a token set using session
  10. $_SSEION['setToken'] = true;
  11. // The filename... You can get that from a $_GET variable and store it here
  12. $token = "./test.mp4";
  13. // We will be encrypting the video name using session id as key ans AES128 as the algorithm
  14. $token_encrypted = openssl_encrypt($token, "aes128", session_id(), 0, '1234567812345678');
  15. ?>
  16. <video controls controlslist="nodownload">
  17. <source src="./video.php?vid=<?php echo $token_encrypted; ?>">
  18. </source>
  19. </video>