Skip to content

Commit

Permalink
Only trigger dead track detection when connected states are active
Browse files Browse the repository at this point in the history
  • Loading branch information
third774 committed Aug 22, 2024
1 parent 4af2783 commit 9117682
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/hooks/useDeadPulledTrackMonitor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ export function useDeadPulledTrackMonitor(
const stat = [...report.values()].find(
(s) => s.trackIdentifier === track.id
)
if (stat?.bytesReceived === 0) {
if (
peerConnection.connectionState === 'connected' &&
peerConnection.iceConnectionState === 'connected' &&
stat?.bytesReceived === 0
) {
setDeadTrack(true)
}
})
Expand Down

0 comments on commit 9117682

Please sign in to comment.