Skip to content

Commit 0afd256

Browse files
committed
增加两个方法控制封锁和解封主播
1 parent e6a9af6 commit 0afd256

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/Client.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,39 @@ public function createRequest(array $params)
168168
return $this->getHttpClient()->get('/', ['query' => $params]);
169169
}
170170

171+
/**
172+
* 禁止推流
173+
* @param string $streamName
174+
* @return string
175+
*/
176+
public function ForbidLiveStream($streamName)
177+
{
178+
return $this->createRequest([
179+
'Action' => 'ForbidLiveStream',
180+
'DomainName' => $this->domain,
181+
'AppName' => $this->appName,
182+
'StreamName' => $streamName,
183+
'LiveStreamType' => 'publisher',
184+
'ResumeTime' => gmdate('Y-m-d\TH:i:s\Z', mktime(0, 0, 0, 1, 1, 2099))
185+
]);
186+
}
187+
188+
/**
189+
* 允许推流
190+
* @param string $streamName
191+
* @return string
192+
*/
193+
public function StartLiveStream($streamName)
194+
{
195+
return $this->createRequest([
196+
'Action' => 'StartLiveStream',
197+
'DomainName' => $this->domain,
198+
'AppName' => $this->appName,
199+
'StreamName' => $streamName,
200+
'LiveStreamType' => 'publisher'
201+
]);
202+
}
203+
171204
/**
172205
* 直播签名
173206
* @param string $streamName

0 commit comments

Comments
 (0)