whip

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package whip contains a WHIP/WHEP client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ICEFragmentMarshal

func ICEFragmentMarshal(offer string, candidates []*webrtc.ICECandidateInit) ([]byte, error)

ICEFragmentMarshal encodes an ICE fragment.

func ICEFragmentUnmarshal

func ICEFragmentUnmarshal(buf []byte) ([]*webrtc.ICECandidateInit, error)

ICEFragmentUnmarshal decodes an ICE fragment.

func LinkHeaderMarshal

func LinkHeaderMarshal(iceServers []webrtc.ICEServer) []string

LinkHeaderMarshal encodes a link header.

func LinkHeaderUnmarshal

func LinkHeaderUnmarshal(link []string) ([]webrtc.ICEServer, error)

LinkHeaderUnmarshal decodes a link header.

Types

type Client

type Client struct {
	HTTPClient *http.Client
	URL        *url.URL
	Log        logger.Writer
	// contains filtered or unexported fields
}

Client is a WHIP client.

func (*Client) Close

func (c *Client) Close() error

Close closes the client.

func (*Client) PeerConnection

func (c *Client) PeerConnection() *webrtc.PeerConnection

PeerConnection returns the underlying peer connection.

func (*Client) Publish

func (c *Client) Publish(
	ctx context.Context,
	outgoingTracks []*webrtc.OutgoingTrack,
) error

Publish publishes tracks.

func (*Client) Read

func (c *Client) Read(ctx context.Context) ([]*webrtc.IncomingTrack, error)

Read reads tracks.

func (*Client) StartReading

func (c *Client) StartReading()

StartReading starts reading all incoming tracks.

func (*Client) Wait

func (c *Client) Wait(ctx context.Context) error

Wait waits for client errors.

Jump to

Keyboard shortcuts

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