Skip to content

Commit

Permalink
增加一个参数用来获取录像地址
Browse files Browse the repository at this point in the history
  • Loading branch information
xutl committed May 5, 2017
1 parent a5dc475 commit cdd7850
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ class Client
*/
public $authTime = 604800;

/**
* @var string
*/
public $recordDomain;

/**
* @var int 秘钥过期时间
*/
Expand Down Expand Up @@ -129,6 +134,10 @@ public function __construct($config = [])
if (empty ($this->domain)) {
throw new \Exception ('The "domain" property must be set.');
}

if (empty ($this->recordDomain)) {
throw new \Exception ('The "recordDomain" property must be set.');
}
}

/**
Expand Down Expand Up @@ -391,6 +400,16 @@ public function getExpirationTime()
return $this->expirationTime;
}

/**
* 获取录像播放地址
* @param string $uri
* @return string
*/
public function getRecordUrl($uri)
{
return '//' . $this->recordDomain . '/' . $uri;
}

/**
* @return string
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Live.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function init()
throw new InvalidConfigException ('The "domain" property must be set.');
}
if (empty ($this->recordDomain)) {
throw new InvalidConfigException ('The "domain" property must be set.');
throw new InvalidConfigException ('The "recordDomain" property must be set.');
}

}
Expand Down

0 comments on commit cdd7850

Please sign in to comment.