Skip to content

Feature Request - localParticipant.unpublishTrack(track) promise #2152

@jpodwys

Description

@jpodwys

Today, localParticipant.publishTrack(track) returns a promise while localParticipant.unpublishTrack(track) does not. Being unable to await a promise results in bug reports like #1227. I also wonder if this is why issues like #656 and #1007 were created.

This is especially problematic when a consumer's application uses the same custom track name such as "camera" or "screen" for both the just-unpublished and newly-published tracks because Twilio throws an error when a single participant publishes two tracks using the same name.

Twilio-Video users can work around this issue in a number of ways including

  1. Append random characters to the end of hard-coded track names then manage those extra characters as you see fit
  2. Catch publishTrack errors, check if they're due to a duplicate track issue, wait for an arbitrary delay, then attempt to publish again

It would be great if Twilio instead provided some means of knowing when a track is fully unpublished.

To avoid breaking changes, perhaps a new unpublishTrackAsync method could be introduced.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions