Skip to content

Commit

Permalink
Create ppv-rtsp-rtmp.php
Browse files Browse the repository at this point in the history
  • Loading branch information
WMSPanel authored Mar 9, 2019
1 parent 8497f96 commit 9502880
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions php/ppv-rtsp-rtmp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<?php


$nimble_host = "nimble.ultimatemediastreaming.com";
$id = "ID_1";
$ip = $_SERVER['REMOTE_ADDR'];
$password = "defaultpassword";
$app = "live";
$stream = "stream";

$stream_name ="/$app/$stream";
$str2hash = "$id$stream_name$password$ip";
$md5raw = md5($str2hash, true);
$base64hash = base64_encode($md5raw);

$urlsignature = "id=$id&sign=$base64hash&ip=$ip";

$base64urlsignature = base64_encode($urlsignature);

$rtmp_url = "rtmp://$nimble_host/$app?publishsign=$base64urlsignature/$stream";
$rtsp_url = "rtsp://$nimble_host/$app/$stream?publishsign=$base64urlsignature";

?>
<html>
<head>
</head>
<body>
<p>
<b>RTMP publish signature</b>: <?=$rtmp_url?><br>
<b>RTSP publish signature</b>: <?=$rtsp_url?>
</p>
</body>
</html>

0 comments on commit 9502880

Please sign in to comment.