Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlapa committed Jul 29, 2024
1 parent dc5a0ad commit ae31727
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,16 @@ class PeerObserver : PeerConnection.Observer {
if (transceiver != null && peer != null) {
if (!peer!!.disposed) {
Handler(Looper.getMainLooper()).post {
val receiver = transceiver.receiver
val receiverId: String
try {
receiverId = transceiver.receiver.id()
} catch (e: IllegalStateException) {
// Receiver is dead already - exit callback.
return@post
}
val transceivers = peer?.getTransceivers()!!
for (trans in transceivers) {
if (trans.receiver.id == receiver.id()) {
if (trans.receiver.id == receiverId) {
peer?.observableEventBroadcaster()?.onTrack(trans.receiver.track, trans)
}
}
Expand Down

0 comments on commit ae31727

Please sign in to comment.