Quickblox iOS:在视频聊天中连接2个用户而无需发起呼叫 [英] Quickblox iOS: Connecting 2 users in video chat without initiating a call

查看:123
本文介绍了Quickblox iOS:在视频聊天中连接2个用户而无需发起呼叫的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个视频聊天要求,其中我必须通过视频聊天连接2个(有点相关)用户.我找不到要调用的必要api,因此出现了问题.

I have a video chat requirement wherein I have to connect 2 (somewhat related) users through video chat. I am not finding necessary api to call, hence the question.

我基本上是在遵循本教程,但似乎并没有全部内容我需要.我不需要显式的呼叫此用户"功能.用户永远不会看到整个用户列表.

I am basically following this tutorial but it seems it doesn't have everything I need. I do not need explicit "call to this user" sort of function. The user never gets to see entire user list.

结果,我想知道是否可以让X个用户拨打电话,再让X个用户等待接听该电话.

As a result, I wonder if I could have X number of users calling and another X number of users waiting to accept that call.

总结:

我只想根据某些特征(例如他们的注册标签)来连接用户.对于任何用户A,可以有一个以上的用户具有与A相似的标签-因此,所有这些用户都是用户A的潜在视频聊天用户.

I just want to connect users based on some traits (like their registered tags). For any user A, there can be more than one users having similar tags as A - so all of them are prospect video chat users for user A.

我需要选择其中之一(可能会随机播放),并在其中流式传输A的视频/音频.

I need to pick one of them (random may work) and stream A's video / audio among them.

我必须做什么?这是部分清单,但我不知道我说的对不对.

What all things do I have to do? Here is partial list but I don't know I am right at the end.

1-致电[QBAuth createSessionWithDelegate:self]

2-在产生的会话中,调用[QBUsers logInWithUserLogin]

2 - From the resulting session, call [QBUsers logInWithUserLogin]

3-在产生的会话中,调用[[QBChat instance] loginWithUser:user]

3 - From the resulting session, call [[QBChat instance] loginWithUser:user]

4-从生成的chatDidLogin委托中,调用什么?

4 - From the resulting chatDidLogin delegate, call what?

应该进入某个聊天室,还是使用 chatRoomDidChangeOnlineUsers 使用某些代码?我不知道.

Should it be entering some chat room, or use of some code using chatRoomDidChangeOnlineUsers? I don't know.

请帮助我以最简单的方式调用事情,简而言之,修改上面的1-2-3-4.

Please help me with the minimal required sequence of things to call, in short, modify 1-2-3-4 above.

更新为何无法发起呼叫的原因:

这是因为由于聊天是非自愿的,因此通话可能会发生冲突.如果我使用calluser api,则每个人最终都会调用.等待接听电话也是如此.我无法想到一种公平的策略,在该策略中,系统不会因呼叫请求而变得不知所措,也不会因每个人都在等待而保持沉默.

This is because since chat is involuntary, calls may collide. If I use calluser api, everyone would end up calling. Likewise is true for waiting to accept a call. I am unable to think of a fair strategy wherein the system does not get overwhelmed with call requests, or silent due to everyone keeps waiting.

换句话说,我支持以下解决方案:每个用户都可以选择一个随机的人呼叫,但不介意是否有人呼叫他,他应该能够优雅地处理它.

In other words I am for the solution wherein every user can pick a random person to call, but does not mind if someone else calls him, and he should be able to handle it gracefully.

推荐答案

首先,您应该注册新用户并向他发送一些标签.为此,您必须:

First of all you should register new user and send him some tag. To do this you have to:

1)创建一个会话

[QBAuth createSessionWithDelegate:self]

[QBAuth createSessionWithDelegate:self]

2)注册新用户并为其设置一些标签:

2) Register new User and set him some tag:

 QBUUser *user = [QBUUser user];
 user.login = @"someuser";
 user.password = @"somepass";
 user.tags = @[@"Tag1"];

3)使用相同的标签创建更多用户

3) Create more users with the same tag

接下来,为了与某个用户进行通话,您必须随机获得它.这是要求所有具有特定标签的用户的请求:

Next, in order to have a call with some user you have to randomly get it. Here is a request to get all the users with particular tag:

[QBUsers usersWithTags:@[@"Tag1"] delegate:self];

您将获得所有使用此标签的用户.接下来-随机选择其中之一

you will get all users with this tag. Next - choose one of them randomly

最后,与该用户进行视频通话

Finally, make a video call to this user

使用用户"样本来学习如何使用用户"模块 http://quickblox.com/developers/SimpleSample-users-ios

Use Users sample to learn how to work with Users module http://quickblox.com/developers/SimpleSample-users-ios

顺便说一句:QuickBlox发布了带有新块API的SDK 2.0-您可以尝试 http:///quickblox.com/developers/IOS#iOS_SDK_Transition_guide_from_version_1.9_to_2.0

btw: QuickBlox released SDK 2.0 with new blocks API - you can try it http://quickblox.com/developers/IOS#iOS_SDK_Transition_guide_from_version_1.9_to_2.0

这篇关于Quickblox iOS:在视频聊天中连接2个用户而无需发起呼叫的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆