Expose Participant.IsPublisher to differentiate pubs from subs (#643)

This commit is contained in:
David Zhao
2022-04-21 22:15:01 -07:00
committed by GitHub
parent 8bb46637bb
commit 57e2321a18
9 changed files with 56 additions and 23 deletions
+5
View File
@@ -241,6 +241,11 @@ func (t *PCTransport) PeerConnection() *webrtc.PeerConnection {
return t.pc
}
// IsEstablished returns true if the PeerConnection has been established
func (t *PCTransport) IsEstablished() bool {
return t.pc.ConnectionState() != webrtc.PeerConnectionStateNew
}
func (t *PCTransport) Close() {
if t.streamAllocator != nil {
t.streamAllocator.Stop()