webrtc icon indicating copy to clipboard operation
webrtc copied to clipboard

Chrome Track Readystate Ended When Restarted ICE

Open lamhai1401 opened this issue 1 year ago • 0 comments

Your environment.

  • Version: 3.2.40
  • Browser: Chrome for Win newest version
  • Other Information: Testing ice restart and simulcast feature

What did you do?

sequenceDiagram
participant h as Host
participant w as WebApp
participant n as Node 
participant v as Viewers

rect rgb(191, 223, 255)
note over h, v: Phase 1 Init Connection with
    h ->> w: Webrtc using 1 video/audio track
    w ->> n: Webrtc default using 5 video/audio tracks
    n ->> v: Webrtc default using 5 video/audio tracks
end

rect rgb(0,128,128)
note over h, v : Phase 2 Start Streaming and Forward Track Data (RTP package)
    h ->> w: Host uploaded 1 Stream (audio/video)
    w ->> n: Forward RTP pkg (video/audio) to track id `video-1`, `audio-1`
    n ->> v: Forward RTP pkg (video/audio) to track id `video-1`, `audio-1`
    v ->> v: Receive and Display data of track id `video-1`, `audio-1`
    note over v: Can see and hear Host
end

rect rgb(79 148 205)
note over h, v: Phase 3 Host sharing his screen
    h ->> w: Init new connection and pushing RTP pkg (video/audio)
    w ->> n: Forward RTP pkg (video/audio) to track id `video-3`, `audio-3`
    n ->> v: Forward RTP pkg (video/audio) to track id `video-3`, `audio-3`
    v ->> v: Receive and Display data of track id `video-3`, `audio-3`
    note over v: Can see and hear Host Sharing Screen
end

rect rgb(244 164 96)
note over h, v: Phase 4 Host re-sharing his screen
    h ->> w: Init new share screen connection <br> due to some mistake or network issues
    w ->> n: Remove and Add new track of id `video-3`, `audio-3`, send ice restart
    n ->> v: Remove and Add new track of id `video-3`, `audio-3`, send ice restart
    note over h,v: Everything is ok, ice connection state is connected after do all things above
end

rect rgb(139 137 137)
note over h, v: Phase 5 Error Happened
    h ->> w: Host push share screen RTP pkg (video/audio)
    w ->> n: Forward RTP pkg (video/audio) to track id `video-3`, `audio-3`
    n ->> v: Forward RTP pkg (video/audio) to track id `video-3`, `audio-3`
    note over v: Can hear the Host (from track id audio-3) but cannot see anything <br> (from track id video-3) also their still receive the video-3 rtp package
end

What did you expect?

Viewers can see and hear normally

What happened?

Viewers can receive new onTrack event but the track inside it has readyState: ended so that browser do not display the video

We try to send PLI signal but it not solve the issue

telegram-cloud-photo-size-5-6206465727314116029-x

lamhai1401 avatar May 22 '24 05:05 lamhai1401