From 6c6afd6c883570b51b59c98e950bcaa56c098311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=90=E4=BA=8C=E9=BE=8D?= Date: Wed, 6 Oct 2021 18:01:48 +0800 Subject: [PATCH] feat(relay):Audioobserver supported on relaying SFU --- pkg/buffer/buffer.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/buffer/buffer.go b/pkg/buffer/buffer.go index 1fd124ab8..43826f91f 100644 --- a/pkg/buffer/buffer.go +++ b/pkg/buffer/buffer.go @@ -165,6 +165,13 @@ func (b *Buffer) Bind(params webrtc.RTPParameters, o Options) { } } } else if b.codecType == webrtc.RTPCodecTypeAudio { + if len(params.HeaderExtensions) == 0 { + t := &webrtc.RTPHeaderExtensionParameter{ + URI: "urn:ietf:params:rtp-hdrext:ssrc-audio-level", + ID: 1, + } + params.HeaderExtensions = append(params.HeaderExtensions, *t) + } for _, h := range params.HeaderExtensions { if h.URI == sdp.AudioLevelURI { b.audioLevel = true