whip

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package whip contains WebRTC / WHIP utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetICEServers

func GetICEServers(
	ctx context.Context,
	hc *http.Client,
	ur string,
) ([]webrtc.ICEServer, error)

GetICEServers posts a WHIP/WHEP request for ICE servers.

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.

func PostCandidate

func PostCandidate(
	ctx context.Context,
	hc *http.Client,
	ur string,
	offer *webrtc.SessionDescription,
	etag string,
	candidate *webrtc.ICECandidateInit,
) error

PostCandidate posts a WHIP/WHEP candidate.

Types

type PostOfferResponse

type PostOfferResponse struct {
	Answer   *webrtc.SessionDescription
	Location string
	ETag     string
}

PostOfferResponse is the response to a post offer.

func PostOffer

func PostOffer(
	ctx context.Context,
	hc *http.Client,
	ur string,
	offer *webrtc.SessionDescription,
) (*PostOfferResponse, error)

PostOffer posts a WHIP/WHEP offer.

Jump to

Keyboard shortcuts

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