MCPcopy
hub / github.com/livekit/livekit / AddStaticTrackWithCodec

Method AddStaticTrackWithCodec

test/client/client.go:966–973  ·  view source on GitHub ↗
(codec webrtc.RTPCodecCapability, id string, label string, opts ...AddTrackOption)

Source from the content-addressed store, hash-verified

964}
965
966func (c *RTCClient) AddStaticTrackWithCodec(codec webrtc.RTPCodecCapability, id string, label string, opts ...AddTrackOption) (writer TrackWriter, err error) {
967 track, err := webrtc.NewTrackLocalStaticSample(codec, id, label)
968 if err != nil {
969 return
970 }
971
972 return c.AddTrack(track, "", opts...)
973}
974
975func (c *RTCClient) AddFileTrack(path string, id string, label string) (writer TrackWriter, err error) {
976 // determine file mime

Callers 4

AddStaticTrackMethod · 0.95
TestFireTrackBySdpFunction · 0.80

Calls 1

AddTrackMethod · 0.95

Tested by 3

TestFireTrackBySdpFunction · 0.64