Files
meet-api/track.go
Smile Rex f85d36b183
All checks were successful
Create and publish a Docker image 🚀 / build-and-push-image (push) Successful in 1m34s
add files and ci
2026-01-26 15:18:05 +03:00

24 lines
405 B
Go

package main
import (
"github.com/pion/rtp"
"github.com/pion/webrtc/v4"
)
type Track struct {
Local *webrtc.TrackLocalStaticRTP
}
func NewTrack(remote *webrtc.TrackRemote) *Track {
local, _ := webrtc.NewTrackLocalStaticRTP(
remote.Codec().RTPCodecCapability,
remote.ID(),
remote.StreamID(),
)
return &Track{Local: local}
}
func (t *Track) Write(pkt *rtp.Packet) {
t.Local.WriteRTP(pkt)
}