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
81
81
*/
82
82
public $ authTime = 604800 ;
83
83
84
+ /**
85
+ * @var string
86
+ */
87
+ public $ recordDomain ;
88
+
84
89
/**
85
90
* @var int 秘钥过期时间
86
91
*/
@@ -129,6 +134,10 @@ public function __construct($config = [])
129
134
if (empty ($ this ->domain )) {
130
135
throw new \Exception ('The "domain" property must be set. ' );
131
136
}
137
+
138
+ if (empty ($ this ->recordDomain )) {
139
+ throw new \Exception ('The "recordDomain" property must be set. ' );
140
+ }
132
141
}
133
142
134
143
/**
@@ -391,6 +400,16 @@ public function getExpirationTime()
391
400
return $ this ->expirationTime ;
392
401
}
393
402
403
+ /**
404
+ * 获取录像播放地址
405
+ * @param string $uri
406
+ * @return string
407
+ */
408
+ public function getRecordUrl ($ uri )
409
+ {
410
+ return '// ' . $ this ->recordDomain . '/ ' . $ uri ;
411
+ }
412
+
394
413
/**
395
414
* @return string
396
415
*/
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ public function init()
119
119
throw new InvalidConfigException ('The "domain" property must be set. ' );
120
120
}
121
121
if (empty ($ this ->recordDomain )) {
122
- throw new InvalidConfigException ('The "domain " property must be set. ' );
122
+ throw new InvalidConfigException ('The "recordDomain " property must be set. ' );
123
123
}
124
124
125
125
}
You can’t perform that action at this time.
0 commit comments