twilio-video.js icon indicating copy to clipboard operation
twilio-video.js copied to clipboard

Allow calling `track.restart()` on local tracks created using constructors

Open jpodwys opened this issue 11 months ago • 1 comments

Twilio employee Donal Toomey requested that I create this issue.

Today, calling const videoTrack = new LocalVideoTrack(mediaStreamTrack) results in being unable to call videoTrack.restart(). Today, we're bypassing this by passing the following into the constructor's options object.

// @ts-ignore
isCreatedByCreateLocalTracks: true,

We'd like to request one of the following two solutions

  1. Allow calling track.restart() on local tracks created via constructors (this is our preferred solution)
  2. Make isCreatedByCreateLocalTracks public (this is a reasonable fallback solution)

jpodwys avatar Mar 11 '24 17:03 jpodwys