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 44 * @copyright Copyright (c) 2012 TintSoft Technology Co. Ltd.
55 * @license http://www.tintsoft.com/license/
66 */
7+
78namespace aliyun \live ;
89
910use yii \base \Component ;
@@ -58,6 +59,11 @@ class Live extends Component
5859 */
5960 public $ pushDomain = 'video-center.alivecdn.com ' ;
6061
62+ /**
63+ * @var string
64+ */
65+ public $ recordDomain ;
66+
6167 /**
6268 * @var bool 是否使用安全连接
6369 */
@@ -92,7 +98,8 @@ class Live extends Component
9298 * 初始化直播组件
9399 * @throws InvalidConfigException
94100 */
95- public function init (){
101+ public function init ()
102+ {
96103 parent ::init ();
97104 $ this ->expirationTime = time () + $ this ->authTime ;
98105 $ this ->playScheme = $ this ->secureConnection ? 'https:// ' : 'http:// ' ;
@@ -111,6 +118,10 @@ public function init(){
111118 if (empty ($ this ->domain )) {
112119 throw new InvalidConfigException ('The "domain" property must be set. ' );
113120 }
121+ if (empty ($ this ->recordDomain )) {
122+ throw new InvalidConfigException ('The "domain" property must be set. ' );
123+ }
124+
114125 }
115126
116127 /**
@@ -381,6 +392,16 @@ public function getPlayScheme()
381392 return $ this ->playScheme ;
382393 }
383394
395+ /**
396+ * 获取录像播放地址
397+ * @param string $uri
398+ * @return string
399+ */
400+ public function getRecordUrl ($ uri )
401+ {
402+ return '// ' . $ this ->recordDomain . '/ ' . $ uri ;
403+ }
404+
384405 /**
385406 * @return string
386407 */
You can’t perform that action at this time.
0 commit comments