Files
plugin-hdl/README.md
2021-12-27 15:55:52 +08:00

55 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# HDL插件
HDL插件主要功能是提供HTTP-FLV协议的访问
## 插件地址
github.com/Monibuca/plugin-hdl
## 插件引入
```go
import (
_ "github.com/Monibuca/plugin-hdl"
)
```
## 默认插件配置
```toml
[HDL]
ListenAddr = ":2020" #默认为空
ListenAddrTLS = ":2021" #默认为空
CertFile = "file.cert" #默认为空
KeyFile = "file.key" #默认为空
Reconnect = false #默认为false
[HDL.AutoPullList]
"live/hdl" = "http://flv.bdplay.nodemedia.cn/live/bbb.flv"
```
- `ListenAddr`是监听的地址如果配置为空字符串则是复用Gateway插件监听的公共端口
- `ListenAddrTLS` 公共https监听端口默认为空则不监听
- `CertFile` https用的证书默认为空
- `KeyFile` https用的证书的key默认为空
- Reconnect 拉流断开后是否重连
- `HDL.AutoPullList` 自动拉流可以设置多个key为流唯一标识value为拉流地址
## 插件功能
### 从m7s拉取http-flv协议流
如果m7s中已经存在live/test流的话就可以用http-flv协议进行播放
如果监听端口不配置则公用Gateway的端口(默认8080)
```bash
ffplay -i http://localhost:8080/hdl/live/test.flv
```
如果配置了端口监听则可以省略hdl路由例如
```bash
ffplay -i http://localhost:2020/live/test.flv
```
### m7s从远程拉取http-flv协议流
可调用接口
`/hdl/pull/pull?target=[HTTP-FLV地址]&streamPath=[流标识]&save=[是否保存配置(留空则不保存)]`
或者编程方式拉流
`PullStream(streamPath, targetURL)`
### m7s读取本地flv文件重新发布
同上只需要把http地址改成本地文件地址即可如果此时开启Reconnect则会在文件读取完成后重新开始读取