-
-
Save SlaSerX/782e44df9fd218b4559e517bc64ed303 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
insert into flussonic.conf: | |
web_script securetoken /etc/flussonic/securetoken.lua key=mysecretkey password=mypassword; | |
auth /etc/flussonic/securetoken.lua key=mysecretkey; | |
Read more at: | |
English - http://flussonic.com/doc/auth/securelink | |
Russian - http://erlyvideo.ru/doc/auth/securelink | |
*/ | |
$streamname = "STREAMNAME"; | |
$flussonic = "http://flussonic:8080"; | |
$password = "mypassword"; | |
$session_lifetime = 3; // in hours | |
$query = http_build_query(array( | |
"password" => $password, | |
"name" => $streamname, | |
"ip" => $_SERVER["REMOTE_ADDR"], | |
"salt" => bin2hex(openssl_random_pseudo_bytes(16)), | |
"starttime" => time(), | |
"endtime" => time() + $session_lifetime*3600)); | |
$token = file_get_contents("$flussonic/securetoken/sign?$query"); | |
$embed = "$flussonic/$streamname/embed.html?dvr=false&token=$token"; | |
?> | |
<iframe frameborder="0" style="width:853px; height:480px;" src="<?= $embed?>"> </iframe> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment