remiheens / php-wowza-securetoken
PHP library for Wowza SecureToken module
Installs: 40 281
Dependents: 0
Suggesters: 0
Security: 0
Stars: 20
Watchers: 6
Forks: 18
Open Issues: 0
Requires
- php: >=5.2.0
This package is not auto-updated.
Last update: 2024-11-09 18:19:01 UTC
README
PHP library to create secure token for Wowza server
Installation
Install with Composer. First, install composer on your server
$ curl -s http://getcomposer.org/installer | php
Create/Edit your composer.json
file
{
"require": {
"remiheens/php-wowza-securetoken" : "0.1.*"
}
}
Install the library
$ composer install
Add composer Autoloader to your php file
require_once __DIR__.'/vendor/autoload.php';
Example
$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();