Skip to content

Commit

Permalink
fix gen_drm_token and add support for max_replay
Browse files Browse the repository at this point in the history
  • Loading branch information
sebest committed Sep 14, 2012
1 parent 339e72e commit 87f2930
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CloudKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ public function __call($method, $args)

class CloudKey_Helpers
{
static public function gen_drm_token($user_id, $media_id, $api_key, $rights=null, $meta=null, $callback_url=null, $expires=null, $encode=true)
static public function gen_drm_token($user_id, $media_id, $api_key, $rights=null, $meta=null, $callback_url=null, $expires=null, $max_replay=null, $encode=true)
{
$info = array(
'user_id' => $user_id,
Expand All @@ -358,11 +358,15 @@ static public function gen_drm_token($user_id, $media_id, $api_key, $rights=null
'nonce' => md5(uniqid(rand(), true)),
);

if ($max_replay != null)
{
$info['max_replay'] = $max_replay;
}
if ($rights != null)
{
$info['rights'] = $rights;
}
if ($data != null)
if ($meta != null)
{
$info['meta'] = $meta;
}
Expand Down

0 comments on commit 87f2930

Please sign in to comment.