PHP code example of remiheens / php-wowza-securetoken
1. Go to this page and download the library: Download remiheens/php-wowza-securetoken library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
remiheens / php-wowza-securetoken example snippets
$wowzaToken = new \remiheens\WowzaSecureToken\WowzaSecureToken('wowzaprefix','mySharedSecret');
$wowzaToken->setClientIP($_SERVER['REMOTE_ADDR']);
$wowzaToken->setURL('rtmp://192.168.1.19:1935/vod/mp4:sample.mp4');
$wowzaToken->setHashMethod(\remiheens\WowzaSecureToken\WowzaSecureToken::SHA256);
$starttime = time();
$endtime = strtotime('+3 HOUR');
$params = array(
'endtime' => $endtime,
'starttime' => $starttime,
'CustomParam1' => 'CustomValue'
);
$wowzaToken->setExtraParams($params);
$hash = $wowzaToken->getHash();
$url = $wowzaToken->getFullURL();
{
" "remiheens/php-wowza-securetoken" : "0.1.*"
}
}