0

In my application i need an ability for the user to dial-in into existing video room where he already has video track created under his identity, so whenever user calls i generate the following TwiML:

<?xml version="1.0" encoding="UTF-8"?>
<Response>  
   <Connect>  
      <Room participantIdentity='MyIdentity'>DailyStandup</Room>  
   </Connect> 
</Response> 

But since participant identity matches the one that is already connected to the room instead of adding audio track to the existing user i get an error:

TwilioError: Participant disconnected because of duplicate identity

Is there a way to merge video/audio channels into one participant by pure twiml without doing any complex mumbo-jumbo logical coding?

AnKing
  • 1,994
  • 6
  • 31
  • 54

1 Answers1

2

Twilio developer evangelist here.

No, there isn't a way to merge the identity in just TwiML.

I would suggest using the same identity, suffixed with "-phone" (or something obvious) and use that consistent suffix to recognise a second stream from the same participant and merge the two.

philnash
  • 70,667
  • 10
  • 60
  • 88
  • Phil, this is what I ended up doing, but the problem with this approach is that the user that called-in cannot mute his own audio track in the UI(only using hardware on a device), just because `remoteAudioTrack.disable()` does not exist according to the API (https://media.twiliocdn.com/sdk/js/video/releases/1.19.2/docs/RemoteAudioTrack.html) – AnKing Oct 14 '19 at 12:53
  • Yes, this is a point. Right now, Twilio Video treats each participant in a room as an individual who can control their own media. You could build something that mutes/unmutes another track across the room, but that would involve triggering code on each other end point. In my experience of people joining a room via phone and wanting to mute/unmute themself, they would do so using their device, rather than a different UI. Is that enough for your use case? – philnash Oct 15 '19 at 12:09
  • This will work for me for now, I just disable "mute" function in the UI in case the track is "unmutable" – AnKing Oct 16 '19 at 12:54