PHPackages                             coomm/qiniucloud - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. coomm/qiniucloud

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

coomm/qiniucloud
================

PhalApi 2.x 扩展类库 - 七牛云直播扩展

01PHP

Since Dec 20Pushed 6y ago1 watchersCompare

[ Source](https://github.com/coomm/qiniucloud)[ Packagist](https://packagist.org/packages/coomm/qiniucloud)[ RSS](/packages/coomm-qiniucloud/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

七牛云直播扩展
=======

[](#七牛云直播扩展)

安装和配置
-----

[](#安装和配置)

修改项目下的composer.json文件，并添加：

```
    "coomm/qiniucloud":"dev-master"

```

然后执行`composer update`。

配置
--

[](#配置)

在vendor/coomm/qiniucloud/src/Lite.php修改短信配置

```
```

注册
--

[](#注册)

在/path/to/phalapi/config/di.php文件中，注册：

```
$di->qiniulive = function() {
	return new \Coomm\Qiniucloud\Lite();
};
```

使用
--

[](#使用)

1. 创建流

```
// Create a new Stream
$stream = \PhalApi\DI()->qiniulive->hub->createStream($streamName); # => Stream Object
```

2.获取流列表

```
$result = \PhalApi\DI()->qiniulive->hub->listStreams(); # => Array
```

3.获取流

```
// Get Stream
$streamId = $stream->id;
$stream = \PhalApi\DI()->qiniulive->hub->getStream($streamId); # => Stream Object
```

4.更新流

```
// Get Stream
$stream->disabled        = true/false;
$stream = $stream->update(); # => Stream Object
```

5.禁用流

```
// Disable a Stream
$disabledTill = time() + 10; # disabled in 10s from now
$result = $stream->disable($disabledTill); # => NULL
```

6.启用流

```
// enable a Stream
$result = $stream->enable(); # => NULL
```

7.获取流状态

```
// Get Stream status
$result = $stream->status(); # => Array
```

8.删除流

```
// Delete a Stream
$result = $stream->delete(); # => NULL
```

9.获取推拉流地址

```
// Generate RTMP publish URL
$publishUrl = $stream->rtmpPublishUrl();

// Generate RTMP live play URLs
$urls = $stream->rtmpLiveUrls();

// Generate HLS play URLs
$urls = $stream->hlsLiveUrls();

// Generate Http-Flv live play URLs
$urls = $stream->httpFlvLiveUrls();

// Generate HLS playback URLs
$start     = -1;  // optional, in second, unix timestamp
$end       = -1;  // optional, in second, unix timestamp
$urls = $stream->hlsPlaybackUrls($start, $end);
```

10.保存流到文件

```
// Save Stream as a file
 $result = $stream->saveAs($filename);
```

更多请参考官方文档

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b909d3833baebf80e3a412a45a1a220a6835ac411002c14a9eed3ec45143610a?d=identicon)[alan\_arke](/maintainers/alan_arke)

---

Top Contributors

[![coomm](https://avatars.githubusercontent.com/u/39479410?v=4)](https://github.com/coomm "coomm (4 commits)")

### Embed Badge

![Health badge](/badges/coomm-qiniucloud/health.svg)

```
[![Health](https://phpackages.com/badges/coomm-qiniucloud/health.svg)](https://phpackages.com/packages/coomm-qiniucloud)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
