Allow for previewing local video tracks, and publishing them when ready

Problem to solve

At this time, LocalVideoTracks are only initialized at the native layer at the time of connection. As such, this prevents usage of them for a pre-call preview.

Proposal

Per https://www.twilio.com/docs/video/android-getting-started#display-a-camera-preview it is possible to preview a local video track without publishing it.

Per https://twilio.github.io/twilio-video-android/docs/latest/ it is possible to publish track at times other than when connection is being performed.

Proposal is to:

  1. Provide a create function to the LocalVideoTrack class that will trigger initialization at the native layer.
  2. Maintain a map of LocalVideoTracks at the native layer to avoid initializing a second track with the same id should the end developer then provide this when connecting.
  3. Add a publishTrack method to LocalParticipants to allow for publishing LocalVideoTracks as needed.
  4. Make sure this all works as expected.

More information