mirror of
https://github.com/pion/webrtc.git
synced 2025-10-05 15:16:52 +08:00
Process RTCP Packets in OnTrack examples
TWCC and Receiver Reports are needed for a good default experience
This commit is contained in:
@@ -110,6 +110,18 @@ func main() {
|
||||
}
|
||||
}()
|
||||
|
||||
// Read incoming RTCP packets
|
||||
// Before these packets are returned they are processed by interceptors. For things
|
||||
// like TWCC and RTCP Reports this needs to be called.
|
||||
go func() {
|
||||
rtcpBuf := make([]byte, 1500)
|
||||
for {
|
||||
if _, _, rtcpErr := receiver.Read(rtcpBuf); rtcpErr != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
fmt.Printf("Track has started, of type %d: %s \n", track.PayloadType(), track.Codec().MimeType)
|
||||
for {
|
||||
// Read RTP packets being sent to Pion
|
||||
|
Reference in New Issue
Block a user