Skip to content

Commit 02c3b95

Browse files
committed
add 实时查询在线人数的请求参数
add 查询在线人数
1 parent 0afd256 commit 02c3b95

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

src/Client.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,43 @@ public function StartLiveStream($streamName)
201201
]);
202202
}
203203

204+
/**
205+
* 实时查询在线人数的请求参数
206+
* @param null|string $streamName
207+
* @param null|int $startTime
208+
* @param null|int $endTime
209+
* @return string
210+
*/
211+
public function DescribeLiveStreamOnlineUserNum($streamName = null, $startTime = null, $endTime = null)
212+
{
213+
$params = [
214+
'Action' => 'DescribeLiveStreamOnlineUserNum',
215+
'DomainName' => $this->domain,
216+
'AppName' => $this->appName
217+
];
218+
if (!empty($streamName)) {
219+
$params['StreamName'] = $streamName;
220+
}
221+
if (!empty($startTime) && !empty($endTime)) {
222+
$params['StartTime'] = gmdate('Y-m-d\TH:i:s\Z', $startTime);
223+
$params['EndTime'] = gmdate('Y-m-d\TH:i:s\Z', $endTime);
224+
}
225+
return $this->createRequest($params);
226+
}
227+
228+
/**
229+
* 查询在线的直播推流列表
230+
* @return string
231+
*/
232+
public function DescribeLiveStreamsOnlineList()
233+
{
234+
return $this->createRequest([
235+
'Action' => 'DescribeLiveStreamsOnlineList',
236+
'DomainName' => $this->domain,
237+
'AppName' => $this->appName
238+
]);
239+
}
240+
204241
/**
205242
* 直播签名
206243
* @param string $streamName

0 commit comments

Comments
 (0)