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:
- Provide a
createfunction to theLocalVideoTrackclass that will trigger initialization at the native layer. - Maintain a map of
LocalVideoTracksat the native layer to avoid initializing a second track with the same id should the end developer then provide this when connecting. - Add a
publishTrackmethod to LocalParticipants to allow for publishing LocalVideoTracks as needed. - Make sure this all works as expected.