twilio / video-quickstart-ios

Twilio Video Quickstart for iOS
https://www.twilio.com/docs/api/video
MIT License
460 stars 178 forks source link

How can we disabled audio/video track while connecting and enable the same track later? #518

Closed Balasnest closed 4 years ago

Balasnest commented 4 years ago
  1. How can we disabled audio/video track while connecting?

Step to reproduce:

  1. Connect to room
  2. Disable video track immediately after connect
  3. In web twilio js, track for video event is coming but disabled, still track is active for an opponent.

Do we have anything similar to web in native SDK which can disable track while connecting?

Video.connect(videoAccessToken, {
        name: videoRoomId,
        audio: false,
        video: false,
        ...
      })
}

How can I disabled video track at the creation time, then later create video track and set with builder if user wants to enable?

builder.videoTracks = disableVideo ? @[ ] ; @[ self.localVideoTrack ] ;
// Now how should we assign the video tracks later while in call ?
paynerc commented 4 years ago

@Balasnest,

A LocalVideoTrack can be published either when you connect to the room via the videoTrack property of the ConnectOptionsBuilder or can be published at a later time via the LocalParticipant.publishVideoTrack(_ track: LocalVideoTrack, publicationOptions options: LocalTrackPublicationOptions) method.

Ryan

Balasnest commented 4 years ago

@paynerc Yeah. I have managed to get it to work. Thanks!