ghost

package module
v2.9.9 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: MIT Imports: 10 Imported by: 0

README

eyeson Ghost - Go Host Streaming Client

A pion based eyeson client written in Go. Build cross-plattform video applications that connect to any eyeson video conference.

Create a community eyeson API key to get started, visit the documentation or eyeson-go package

Usage

Visit examples to find ready-to-use cli apps for streaming with RTMP or local video files.

Please note that you're required to keep the meeting busy as if no participants are connected it will shutdown after a short period of time. A common way to do so is to join with a participant using the web interface and mute your audio and video.

Reader Interface

The rtp-packet stream is made available on the interface.

Development

$ make test # run the testsuite

Documentation

Index

Constants

View Source
const PlatformVersion string = "gosepp-2.8.1"

PlatformVersion identifies this libs version

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client implements the EyesonClient call interface

func (*Client) Call

func (cl *Client) Call() error

Call initiates a connection.

func (*Client) Destroy

func (cl *Client) Destroy()

Destroy destroyes a client and closes call and peer connection.

func (*Client) SetAudioReceivedHandler added in v2.5.0

func (cl *Client) SetAudioReceivedHandler(handler MediaReceivedHandler)

SetAudioReceivedHandler forwards media rtp packets.

func (*Client) SetConnectedHandler

func (cl *Client) SetConnectedHandler(handler ConnectedHandler)

SetConnectedHandler forwards a listener callback to receive connection status updates.

func (*Client) SetDataChannelHandler added in v2.0.1

func (cl *Client) SetDataChannelHandler(handler DataChannelReceivedHandler)

SetDataChannelHandler forwards data received via data-channel.

func (*Client) SetTerminatedHandler

func (cl *Client) SetTerminatedHandler(handler TerminatedHandler)

SetTerminatedHandler forwards a listener callback to receive termination status updates.

func (*Client) SetVideoReceivedHandler added in v2.5.0

func (cl *Client) SetVideoReceivedHandler(handler MediaReceivedHandler)

SetVideoReceivedHandler forwards media rtp packets.

func (*Client) TerminateCall

func (cl *Client) TerminateCall() error

TerminateCall requests to stop a call.

type ClientConfigInterface

type ClientConfigInterface interface {
	gosepp.CallInfoInterface

	GetStunServers() []string
	GetTurnServerURLs() []string
	GetTurnServerPassword() string
	GetTurnServerUsername() string
	GetDisplayname() string
}

ClientConfigInterface extends the gosepp CallInfoInterface with methods to get STUN and TURN-servers.

type ClientOption

type ClientOption func(*Client)

ClientOption following options pattern to specify options for the client.

func WithCustomCAFile added in v2.4.2

func WithCustomCAFile(customCAFile string) ClientOption

WithCustomCAFile specify a custom CA file name which is used instead of the system CA pool.

func WithCustomLogger added in v2.2.1

func WithCustomLogger(logger gosepp.Logger) ClientOption

WithCustomLogger configures a custom logger.

func WithForceAV1Codec added in v2.5.0

func WithForceAV1Codec() ClientOption

WithForceAV1Codec forces the av1 codec.

func WithForceH264Codec

func WithForceH264Codec() ClientOption

WithForceH264Codec forces the h264 codec.

func WithForceH265Codec added in v2.8.0

func WithForceH265Codec() ClientOption

WithForceH265Codec forces the h265 codec.

func WithForceVP8Codec added in v2.8.0

func WithForceVP8Codec() ClientOption

WithForceVP8Codec forces the vp8 codec.

func WithForceVP9Codec added in v2.8.0

func WithForceVP9Codec() ClientOption

WithForceVP9Codec forces the vp9 codec.

func WithInsecureSkipVerify added in v2.7.1

func WithInsecureSkipVerify() ClientOption

func WithNoConfProtocol added in v2.2.1

func WithNoConfProtocol() ClientOption

WithNoConfProtocol deactivates the confserver protocol. So no additional infos will be sent.

func WithNoSFUSupport added in v2.2.1

func WithNoSFUSupport() ClientOption

WithNoSFUSupport configures that no SFU support should be used.

func WithSendOnly

func WithSendOnly() ClientOption

WithSendOnly signals the only outbound (client->server) traffic is wanted

type ConnectedHandler

type ConnectedHandler func(connected bool, localVideoTrack RTPWriter, localAudioTrack RTPWriter)

ConnectedHandler called when connection succeeded. Providing tracks to write to.

type DataChannelReceivedHandler added in v2.0.1

type DataChannelReceivedHandler func(data []byte)

DataChannelReceivedHandler delegate for the data channel

type EyesonClient

type EyesonClient interface {
	Call() error
	TerminateCall() error
	Destroy()
	SetConnectedHandler(ConnectedHandler)
	SetTerminatedHandler(TerminatedHandler)
	SetDataChannelHandler(DataChannelReceivedHandler)
	SetAudioReceivedHandler(MediaReceivedHandler)
	SetVideoReceivedHandler(MediaReceivedHandler)
}

EyesonClient call interface

func NewClient

func NewClient(callInfo ClientConfigInterface, opts ...ClientOption) (EyesonClient, error)

NewClient creates a new ghost client.

type MediaReceivedHandler added in v2.5.0

type MediaReceivedHandler func(rtpPacket *rtp.Packet)

MediaReceivedHandler called when a new rtp-Packet is available.

type RTPWriter

type RTPWriter interface {
	WriteRTP(p *rtp.Packet) error
}

RTPWriter interface which is implemented by video and audio tracks

type StdoutLogger added in v2.2.1

type StdoutLogger struct{}

StdoutLogger simple logger logging everything to stdout

func (*StdoutLogger) Debug added in v2.2.1

func (sl *StdoutLogger) Debug(format string, v ...interface{})

Debug log debug message

func (*StdoutLogger) Error added in v2.2.1

func (sl *StdoutLogger) Error(format string, v ...interface{})

Error log error msg

func (*StdoutLogger) Info added in v2.2.1

func (sl *StdoutLogger) Info(format string, v ...interface{})

Info log info message

func (*StdoutLogger) Trace added in v2.2.1

func (sl *StdoutLogger) Trace(format string, v ...interface{})

Trace log trace message

func (*StdoutLogger) Warn added in v2.2.1

func (sl *StdoutLogger) Warn(format string, v ...interface{})

Warn log warn message

type TerminatedHandler

type TerminatedHandler func()

TerminatedHandler handle function call when call is terminated

Jump to

Keyboard shortcuts

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