GithubHelp home page GithubHelp logo

myhlsnew's Introduction

介绍

该插件依赖github.com/Monibuca/plugin-ts

功能

  1. 该插件可用来拉取网络上的m3u8文件并解析后转换成其他协议
  2. 该插件可以在服务器写HLS文件,配合nginx等可以提供HLS的服务
  3. 配合gateway插件可以直接访问http://localhost:8081/hls/live/user1.m3u8 进行播放,其中8081端口是gateway插件配置的,live/user1是streamPath,需要根据实际情况修改

配置

[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,如果没有就传本对象
  4. 使用UI界面,点击拉流转发,可以将一个远程的hls流拉入服务器中,配置StreamPath用于从服务器中播放这个流。

如果拉取远程ts文件需要cookie或者http的验证,可以将验证头设置到HLS对象的TsHead属性中。

import 	. "github.com/Monibuca/plugin-ts"
func demo(){
    p:=new(HLS)
    p.Video.Req = http.NewRequest("GET","http://xxxx.com/demo.m3u8", nil)
    p.Publish("live/hls")
}

myhlsnew's People

Contributors

a1226202820 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.