Skip to content

Commit

Permalink
Add RTPTransceiver func
Browse files Browse the repository at this point in the history
In webrtc web_api on_track event contain rtp transciever, but in pion  on_track func cannot get rtptransciever. So add RTPTransceiver func in rtp receiver class.
ref: https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/track_event
  • Loading branch information
do-hyung-kim committed Aug 2, 2023
1 parent 90e3a83 commit b3369bb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rtpreceiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ func (r *RTPReceiver) Tracks() []*TrackRemote {
return tracks
}

// Transceiver returns the RTPTransceiver this RTPReceiver is associated with or nil
func (r *RTPReceiver) Transceiver() *RTPTransceiver {
r.mu.Lock()
defer r.mu.Unlock()

return r.tr
}

// configureReceive initialize the track
func (r *RTPReceiver) configureReceive(parameters RTPReceiveParameters) {
r.mu.Lock()
Expand Down

0 comments on commit b3369bb

Please sign in to comment.