Skip to content

Commit cdd7850

Browse files
committed
增加一个参数用来获取录像地址
1 parent a5dc475 commit cdd7850

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/Client.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ class Client
8181
*/
8282
public $authTime = 604800;
8383

84+
/**
85+
* @var string
86+
*/
87+
public $recordDomain;
88+
8489
/**
8590
* @var int 秘钥过期时间
8691
*/
@@ -129,6 +134,10 @@ public function __construct($config = [])
129134
if (empty ($this->domain)) {
130135
throw new \Exception ('The "domain" property must be set.');
131136
}
137+
138+
if (empty ($this->recordDomain)) {
139+
throw new \Exception ('The "recordDomain" property must be set.');
140+
}
132141
}
133142

134143
/**
@@ -391,6 +400,16 @@ public function getExpirationTime()
391400
return $this->expirationTime;
392401
}
393402

403+
/**
404+
* 获取录像播放地址
405+
* @param string $uri
406+
* @return string
407+
*/
408+
public function getRecordUrl($uri)
409+
{
410+
return '//' . $this->recordDomain . '/' . $uri;
411+
}
412+
394413
/**
395414
* @return string
396415
*/

src/Live.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function init()
119119
throw new InvalidConfigException ('The "domain" property must be set.');
120120
}
121121
if (empty ($this->recordDomain)) {
122-
throw new InvalidConfigException ('The "domain" property must be set.');
122+
throw new InvalidConfigException ('The "recordDomain" property must be set.');
123123
}
124124

125125
}

0 commit comments

Comments
 (0)