webrtc

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: MIT Imports: 18 Imported by: 0

README

StateChange

  1. offer = pc.CreateOffer()
  2. pc.SetLocalDescription(offer)
  3. OnICEGatheringStateChange: gathering
  4. OnSignalingStateChange: have-local-offer *. OnICEGatheringStateChange: complete
  5. pc.SetRemoteDescription(answer)
  6. OnSignalingStateChange: stable
  7. OnICEConnectionStateChange: checking
  8. OnICEConnectionStateChange: connected

Documentation

Index

Constants

View Source
const PriorityComponentRTP = uint32(256 - ice.ComponentRTP)
View Source
const PriorityLocalTCPPassive = (1 << 8) * uint32((1<<13)*4+8191)
View Source
const PriorityLocalUDP = (1 << 8) * uint32(65535)
View Source
const PriorityManualHost = (1 << 24) * uint32(120)
View Source
const ReceiveMTU = 1472

ReceiveMTU = Ethernet MTU (1500) - IP Header (20) - UDP Header (8)

Variables

This section is empty.

Functions

func CandidateManualHostTCPPassive added in v1.3.0

func CandidateManualHostTCPPassive(address string, port int) string

func CandidateManualHostUDP added in v1.3.0

func CandidateManualHostUDP(host string, port int) string

func GetCachedPublicIP

func GetCachedPublicIP() (net.IP, error)

func GetPublicIP

func GetPublicIP() (net.IP, error)

GetPublicIP example from https://github.com/pion/stun

func IsIP

func IsIP(host string) bool

func LookupIP

func LookupIP(address string) (string, error)

func MimeType

func MimeType(codec *core.Codec) string

func NewAPI

func NewAPI(address string) (*webrtc.API, error)

func NewCandidate

func NewCandidate(network, address string) (string, error)

func RegisterDefaultCodecs

func RegisterDefaultCodecs(m *webrtc.MediaEngine) error

func UnmarshalMedias added in v1.3.0

func UnmarshalMedias(descriptions []*sdp.MediaDescription) (medias []*core.Media)

Types

type Conn

type Conn struct {
	core.Listener

	UserAgent string
	Desc      string
	Mode      core.Mode
	// contains filtered or unexported fields
}

func NewConn added in v1.3.0

func NewConn(pc *webrtc.PeerConnection) *Conn

func (*Conn) AddCandidate

func (c *Conn) AddCandidate(candidate string) error

func (*Conn) AddTrack

func (c *Conn) AddTrack(media *core.Media, codec *core.Codec, track *core.Receiver) error

func (*Conn) Close added in v1.3.0

func (c *Conn) Close() error

func (*Conn) CreateCompleteOffer added in v1.3.0

func (c *Conn) CreateCompleteOffer(medias []*core.Media) (string, error)

func (*Conn) CreateOffer added in v1.3.0

func (c *Conn) CreateOffer(medias []*core.Media) (string, error)

func (*Conn) GetAnswer

func (c *Conn) GetAnswer() (answer string, err error)

func (*Conn) GetCompleteAnswer

func (c *Conn) GetCompleteAnswer() (answer string, err error)

func (*Conn) GetMedias

func (c *Conn) GetMedias() []*core.Media

func (*Conn) GetTrack added in v1.3.0

func (c *Conn) GetTrack(media *core.Media, codec *core.Codec) (*core.Receiver, error)

func (*Conn) MarshalJSON

func (c *Conn) MarshalJSON() ([]byte, error)

func (*Conn) SetAnswer added in v1.3.0

func (c *Conn) SetAnswer(answer string) (err error)

func (*Conn) SetOffer

func (c *Conn) SetOffer(offer string) (err error)

func (*Conn) Start added in v1.3.0

func (c *Conn) Start() error

func (*Conn) Stop added in v1.3.0

func (c *Conn) Stop() error

type Track added in v1.3.0

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

func NewTrack added in v1.3.0

func NewTrack(kind string) *Track

func (*Track) Bind added in v1.3.0

func (t *Track) Bind(context webrtc.TrackLocalContext) (webrtc.RTPCodecParameters, error)

func (*Track) ID added in v1.3.0

func (t *Track) ID() string

func (*Track) Kind added in v1.3.0

func (t *Track) Kind() webrtc.RTPCodecType

func (*Track) RID added in v1.3.0

func (t *Track) RID() string

func (*Track) StreamID added in v1.3.0

func (t *Track) StreamID() string

func (*Track) Unbind added in v1.3.0

func (t *Track) Unbind(context webrtc.TrackLocalContext) error

func (*Track) WriteRTP added in v1.3.0

func (t *Track) WriteRTP(payloadType uint8, packet *rtp.Packet) error

Jump to

Keyboard shortcuts

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