File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff 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 */
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments