diff --git a/clienttrack.go b/clienttrack.go index bfba7a3..f144a15 100644 --- a/clienttrack.go +++ b/clienttrack.go @@ -188,7 +188,7 @@ func (t *clientTrack) IsScaleable() bool { } func (t *clientTrack) RequestPLI() { - t.remoteTrack.sendPLI() + t.remoteTrack.SendPLI() } func (t *clientTrack) SetMaxQuality(_ QualityLevel) { diff --git a/clienttracksimulcast.go b/clienttracksimulcast.go index 962891a..b8e4227 100644 --- a/clienttracksimulcast.go +++ b/clienttracksimulcast.go @@ -180,15 +180,15 @@ func (t *simulcastClientTrack) push(p *rtp.Packet, quality QualityLevel) { // check if it's a first packet to send if currentQuality == QualityNone && t.sequenceNumber.Load() == 0 { // we try to send the low quality first if the track is active and fallback to upper quality if not - if t.remoteTrack.getRemoteTrack(QualityLow) != nil && quality == QualityLow { + if t.remoteTrack.GetRemoteTrack(QualityLow) != nil && quality == QualityLow { t.lastQuality.Store(uint32(QualityLow)) // send PLI to make sure the client will receive the first frame t.remoteTrack.sendPLI() - } else if t.remoteTrack.getRemoteTrack(QualityMid) != nil && quality == QualityMid { + } else if t.remoteTrack.GetRemoteTrack(QualityMid) != nil && quality == QualityMid { t.lastQuality.Store(uint32(QualityMid)) // send PLI to make sure the client will receive the first frame t.remoteTrack.sendPLI() - } else if t.remoteTrack.getRemoteTrack(QualityHigh) != nil && quality == QualityHigh { + } else if t.remoteTrack.GetRemoteTrack(QualityHigh) != nil && quality == QualityHigh { t.lastQuality.Store(uint32(QualityHigh)) // send PLI to make sure the client will receive the first frame t.remoteTrack.sendPLI() diff --git a/clienttracksvc.go b/clienttracksvc.go index 8c1670f..333d5ef 100644 --- a/clienttracksvc.go +++ b/clienttracksvc.go @@ -313,5 +313,5 @@ func (t *scaleableClientTrack) IsScaleable() bool { } func (t *scaleableClientTrack) RequestPLI() { - go t.remoteTrack.sendPLI() + go t.remoteTrack.SendPLI() } diff --git a/examples/http-websocket/main.go b/examples/http-websocket/main.go index 56efd28..e2790d7 100644 --- a/examples/http-websocket/main.go +++ b/examples/http-websocket/main.go @@ -205,6 +205,7 @@ func clientHandler(isDebug bool, conn *websocket.Conn, messageChan chan Request, // add a new client to room // you can also get the client by using r.GetClient(clientID) opts := sfu.DefaultClientOptions() + opts.EnableOpusDTX = true opts.EnableVoiceDetection = true opts.ReorderPackets = false client, err := r.AddClient(clientID, clientID, opts) diff --git a/remotetrack.go b/remotetrack.go index cc84caa..9a99d07 100644 --- a/remotetrack.go +++ b/remotetrack.go @@ -179,7 +179,7 @@ func (t *remoteTrack) Track() IRemoteTrack { return t.track } -func (t *remoteTrack) sendPLI() { +func (t *remoteTrack) SendPLI() { t.mu.Lock() defer t.mu.Unlock() @@ -208,7 +208,7 @@ func (t *remoteTrack) enableIntervalPLI(interval time.Duration) { case <-ctx.Done(): return case <-ticker.C: - t.sendPLI() + t.SendPLI() } } }() diff --git a/track.go b/track.go index 79fac86..bf649a5 100644 --- a/track.go +++ b/track.go @@ -310,7 +310,7 @@ func (t *Track) subscribe(c *Client) iClientTrack { } if t.Kind() == webrtc.RTPCodecTypeVideo { - t.remoteTrack.sendPLI() + t.remoteTrack.SendPLI() } t.base.clientTracks.Add(ct) @@ -652,7 +652,7 @@ func (t *SimulcastTrack) AddRemoteTrack(track IRemoteTrack, minWait, maxWait tim return remoteTrack } -func (t *SimulcastTrack) getRemoteTrack(q QualityLevel) *remoteTrack { +func (t *SimulcastTrack) GetRemoteTrack(q QualityLevel) *remoteTrack { t.mu.Lock() defer t.mu.Unlock() @@ -784,19 +784,19 @@ func (t *SimulcastTrack) sendPLI() { defer t.mu.RUnlock() if t.remoteTrackHigh != nil { - t.remoteTrackHigh.sendPLI() + t.remoteTrackHigh.SendPLI() } else { t.base.client.log.Warnf("track: remote track high is nil") } if t.remoteTrackMid != nil { - t.remoteTrackMid.sendPLI() + t.remoteTrackMid.SendPLI() } else { t.base.client.log.Warnf("track: remote track mid is nil") } if t.remoteTrackLow != nil { - t.remoteTrackLow.sendPLI() + t.remoteTrackLow.SendPLI() } else { t.base.client.log.Warnf("track: remote track low is nil") }