Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working with track SID across full-reconnects #553

Open
SijmenHuizenga opened this issue Nov 1, 2024 · 0 comments
Open

Working with track SID across full-reconnects #553

SijmenHuizenga opened this issue Nov 1, 2024 · 0 comments

Comments

@SijmenHuizenga
Copy link
Contributor

We are having difficulties managing track SIDs in scenarios where a full reconnect occurs. During a reconnect, tracks are re-published with new SID's, which prevents us from call UnpublishTrack on specific tracks after the full-reconnect. Because after a full reconnect, the application’s previously stored SID is no longer valid, giving an errors when attempting to unpublish the track.

Usual Flow (No Reconnect):

  1. Video track is published with SID_A. Our application stores SID_A. ✅
  2. Time passes. ⏰
  3. The application calls UnpublishTrack(SID_A) to stop streaming the video track. ✅

Flow with Full Reconnect:

  1. Video track is published with SID_A. Our application stores SID_A. ✅
  2. Time passes. ⏰
  3. Full reconnect occurs, handled completely by the Go SDK. The video keeps streaming, but a new track SID is assigned. ✅
  4. Time passes. ⏰
  5. The application calls UnpublishTrack(SID_A) to stop streaming the video track but receives an error: "could not find track." ❌

With the amazing help of @boks1971 and 15f576a we are now listening for LocalTrackPublished events to update our SIDs after a full reconnect. In the next few days we will find out if this is stable

Some ideas to improve this process for the future:

  • Document the fact that SID's change across full-reconnects, and document how to use LocalTrackPublished together with .UnpublishTrack(). Maybe even an example?
  • Provide a method similar to UnpublishTrack that takes some kind of unique track reference which is consistent across reconnects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant