jessica

package module
v4.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2023 License: MIT Imports: 15 Imported by: 1

README

JESSICA 插件

通过Websocket传输音视频数据,使用Jessibuca播放器进行播放。

插件地址

https://github.com/Monibuca/plugin-jessica

插件引入

import (
    _ "m7s.live/plugin/jessica/v4"
)

配置

可配置WS协议和WSS协议监听地址端口

jessica:
    http:
      listenaddr: :8080 # 网关地址,用于访问API
      listenaddrtls: ""  # 用于HTTPS方式访问API的端口配置
      certfile: ""
      keyfile: ""
      cors: true  # 是否自动添加cors头
      username: ""  # 用户名和密码,用于API访问时的基本身份认证
      password: ""
    subscribe:
        subaudio: true # 是否订阅音频流
        subvideo: true # 是否订阅视频流
        subaudioargname: ats # 订阅音频轨道参数名
        subvideoargname: vts # 订阅视频轨道参数名
        subdataargname: dts # 订阅数据轨道参数名
        subaudiotracks: [] # 订阅音频轨道名称列表
        subvideotracks: [] # 订阅视频轨道名称列表
        submode: 0 # 订阅模式,0为跳帧追赶模式,1为不追赶(多用于录制),2为时光回溯模式
        iframeonly: false # 只订阅关键帧
        waittimeout: 10s # 等待发布者的超时时间,用于订阅尚未发布的流

协议说明

该插件提供两种格式的协议供播放器播放。

WS-RAW
  • 地址格式:ws://[HOST]/jessica/[streamPath]

  • 该协议传输的是私有格式,第一个字节代表音视频,1为音频,2为视频,后面跟4个字节的时间戳,然后接上字节流(RTMP的VideoTag或AudioTag)

WS-FLV
  • 地址格式:ws://[HOST]/jessica/[streamPath].flv
  • 该协议传输的flv格式的文件流

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JessicaPlugin = InstallPlugin(jessicaConfig)

Functions

This section is empty.

Types

type JessicaBase added in v4.2.0

type JessicaBase struct {
	Subscriber
	IsWebSocket bool
}

type JessicaConfig

type JessicaConfig struct {
	config.HTTP
	config.Subscribe
}

func (*JessicaConfig) OnEvent

func (j *JessicaConfig) OnEvent(event any)

func (*JessicaConfig) ServeHTTP

func (j *JessicaConfig) ServeHTTP(w http.ResponseWriter, r *http.Request)

type JessicaFLV

type JessicaFLV struct {
	JessicaBase
}

func (*JessicaFLV) OnEvent

func (j *JessicaFLV) OnEvent(event any)

func (*JessicaFLV) WriteFLVTag

func (j *JessicaFLV) WriteFLVTag(tag FLVFrame)

type JessicaH26x added in v4.2.0

type JessicaH26x struct {
	JessicaBase
}

func (*JessicaH26x) OnEvent added in v4.2.0

func (j *JessicaH26x) OnEvent(event any)

type JessicaSubscriber

type JessicaSubscriber struct {
	JessicaBase
	// contains filtered or unexported fields
}

func (*JessicaSubscriber) OnEvent

func (j *JessicaSubscriber) OnEvent(event any)

func (*JessicaSubscriber) WriteAVCC

func (j *JessicaSubscriber) WriteAVCC(typ byte, ts uint32, avcc ...[]byte)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL