https://github.com/monibuca/hlsplugin
hls plugin for monibuca
https://github.com/monibuca/hlsplugin
hls
Last synced: 10 months ago
JSON representation
hls plugin for monibuca
- Host: GitHub
- URL: https://github.com/monibuca/hlsplugin
- Owner: Monibuca
- Created: 2020-03-02T02:32:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-12T00:09:03.000Z (almost 2 years ago)
- Last Synced: 2025-04-29T14:35:04.529Z (about 1 year ago)
- Topics: hls
- Language: Go
- Size: 558 KB
- Stars: 3
- Watchers: 2
- Forks: 5
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hlsplugin
hls plugin for monibuca
> 该插件依赖github.com/Monibuca/tsplugin
## 功能
1. 该插件可用来拉取网络上的m3u8文件并解析后转换成其他协议
2. 该插件可以在服务器写HLS文件,配合nginx等可以提供HLS的服务
## 配置
```toml
[Plugins.HLS]
EnableWrite = false
Fragment = 5
Window = 2
Path = "hls"
```
EnableWrite 用来控制是否启用HLS文件写入功能
## 使用方法
1. 创建HLS结构体实例
2. 设置该对象的Video.Req和Audio.Req属性(用于请求m3u8文件)没有audio单独的m3u8可不设置Audio.Req属性
3. 调用对象的Publish方法,传入流名称和上级publisher,如果没有就传本对象
> 如果拉取远程ts文件需要cookie或者http的验证,可以将验证头设置到HLS对象的TsHead属性中。
```go
import . "github.com/Monibuca/tsplugin"
func demo(){
p:=new(HLS)
p.Video.Req = http.NewRequest("GET","http://xxxx.com/demo.m3u8", nil)
p.Publish("live/hls",p)
}
```