File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change 4
4
* @copyright Copyright (c) 2012 TintSoft Technology Co. Ltd.
5
5
* @license http://www.tintsoft.com/license/
6
6
*/
7
+
7
8
namespace aliyun \live ;
8
9
9
10
use yii \base \Component ;
@@ -58,6 +59,11 @@ class Live extends Component
58
59
*/
59
60
public $ pushDomain = 'video-center.alivecdn.com ' ;
60
61
62
+ /**
63
+ * @var string
64
+ */
65
+ public $ recordDomain ;
66
+
61
67
/**
62
68
* @var bool 是否使用安全连接
63
69
*/
@@ -92,7 +98,8 @@ class Live extends Component
92
98
* 初始化直播组件
93
99
* @throws InvalidConfigException
94
100
*/
95
- public function init (){
101
+ public function init ()
102
+ {
96
103
parent ::init ();
97
104
$ this ->expirationTime = time () + $ this ->authTime ;
98
105
$ this ->playScheme = $ this ->secureConnection ? 'https:// ' : 'http:// ' ;
@@ -111,6 +118,10 @@ public function init(){
111
118
if (empty ($ this ->domain )) {
112
119
throw new InvalidConfigException ('The "domain" property must be set. ' );
113
120
}
121
+ if (empty ($ this ->recordDomain )) {
122
+ throw new InvalidConfigException ('The "domain" property must be set. ' );
123
+ }
124
+
114
125
}
115
126
116
127
/**
@@ -381,6 +392,16 @@ public function getPlayScheme()
381
392
return $ this ->playScheme ;
382
393
}
383
394
395
+ /**
396
+ * 获取录像播放地址
397
+ * @param string $uri
398
+ * @return string
399
+ */
400
+ public function getRecordUrl ($ uri )
401
+ {
402
+ return '// ' . $ this ->recordDomain . '/ ' . $ uri ;
403
+ }
404
+
384
405
/**
385
406
* @return string
386
407
*/
You can’t perform that action at this time.
0 commit comments