Twilio Video/Chat

浪尽此生 提交于 2019-12-12 06:27:59

问题


I am working on a reactjs - Twilio video/chat application. Its a requirement to include the name of the person as a tag on top of the video.

However when I look at the json response with the participatory information - it only lists an identity id -- is there a way of pushing a name into the service, or doing a lookup on Twilio for the name of the person?

So where you have

identity: "17003", personName: "Bob Pip"

https://www.npmjs.com/package/twilio-video

I am able to get the sid and the identity.

During video connect tried to pump in a custom value for this localparticipant to push it into the service.

var connectOptions = {
          name: roomName,
          personName: 'Collin Baker',
          logLevel: 'debug'
        }
Video.connect(data.token, connectOptions)

but it doesn't come out.


"Hey, so, the short answer is "no" you can't do that through the Video SDK itself."

"However, I would recommend checking out Twilio Sync (https://www.twilio.com/docs/api/sync ). Sync is an API that let's you sync data across devices. So, you could create a sync object that contains the id that you use with the Video SDK paired with the user's visible name."

"They wouldn't link up directly, but if you keep your identities consistent (i.e. User Id from your db) and then keep the visible user name also in sync in the Sync object, then you can share that object between calling parties and display the names. You might, for example, also keep one sync document per video room."

https://www.twilio.com/docs/api/sync/sync-sdk-download

https://www.twilio.com/sync

https://www.twilio.com/docs/api/sync/quickstart-js

https://www.twilio.com/docs/api/sync/identity-and-access-tokens

"Ah, Sync is in beta, so you need to install the alpha version of the npm library. Slightly confusing I appreciate, it's something like twilio@3.4.0-alpha1"

来源:https://stackoverflow.com/questions/45059146/twilio-video-chat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!